1 | /* |
2 | Copyright - 2017 2023 - wwwouaiebe - Contact: https://www.ouaie.be/ |
3 | |
4 | This program is free software; |
5 | you can redistribute it and/or modify it under the terms of the |
6 | GNU General Public License as published by the Free Software Foundation; |
7 | either version 3 of the License, or any later version. |
8 | |
9 | This program is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | GNU General Public License for more details. |
13 | |
14 | You should have received a copy of the GNU General Public License |
15 | along with this program; if not, write to the Free Software |
16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
17 | */ |
18 | /* |
19 | Changes: |
20 | - v4.0.0: |
21 | - created from v3.6.0 |
22 | Doc reviewed 202208 |
23 | */ |
24 | |
25 | import AllControlsFocusEL from './AllControlsFocusEL.js'; |
26 | import AllControlsInputEL from './AllControlsInputEL.js'; |
27 | import AddressButtonClickEL from '../../../controls/addressControl/AddressButtonClickEL.js'; |
28 | import UrlInputBlurEL from './UrlInputBlurEL.js'; |
29 | import EditionButtonsClickEL from './EditionButtonsClickEL.js'; |
30 | import IconSelectorChangeEL from './IconSelectorChangeEL.js'; |
31 | import OpenCfgFileButtonClickEL from './OpenCfgFileButtonClickEL.js'; |
32 | |
33 | /* ------------------------------------------------------------------------------------------------------------------------- */ |
34 | /** |
35 | A simple container for the NoteDialog event listeners |
36 | */ |
37 | /* ------------------------------------------------------------------------------------------------------------------------- */ |
38 | |
39 | class NoteDialogEventListeners { |
40 | |
41 | /** |
42 | The focus control event listener |
43 | @type {AllControlsFocusEL} |
44 | */ |
45 | |
46 | #controlFocus; |
47 | |
48 | /** |
49 | The input event listener |
50 | @type {AllControlsInputEL} |
51 | */ |
52 | |
53 | #controlInput; |
54 | |
55 | /** |
56 | The address buton click event listener |
57 | @type {AddressButtonClickEL} |
58 | */ |
59 | |
60 | #addressButtonClick; |
61 | |
62 | /** |
63 | The blur url input event listener |
64 | @type {UrlInputBlurEL} |
65 | */ |
66 | |
67 | #urlInputBlur; |
68 | |
69 | /** |
70 | The edition button click event listener |
71 | @type {EditionButtonsClickEL} |
72 | */ |
73 | |
74 | #editionButtonsClick; |
75 | |
76 | /** |
77 | The icon selector change event listener |
78 | @type {IconSelectorChangeEL} |
79 | */ |
80 | |
81 | #iconSelectorChange; |
82 | |
83 | /** |
84 | The open file button click event listener |
85 | @type {OpenCfgFileButtonClickEL} |
86 | */ |
87 | |
88 | #openCfgFileButtonClick; |
89 | |
90 | /** |
91 | The constructor |
92 | @param {NoteDialog} noteDialog A reference to the NoteDialog object |
93 | @param {Array.<Number>} noteLatLng The lat and lng of the note |
94 | */ |
95 | |
96 | constructor ( noteDialog, noteLatLng ) { |
97 | Object.freeze ( this ); |
98 | this.#controlFocus = new AllControlsFocusEL ( noteDialog ); |
99 | this.#controlInput = new AllControlsInputEL ( noteDialog ); |
100 | this.#addressButtonClick = new AddressButtonClickEL ( noteDialog, noteLatLng ); |
101 | this.#urlInputBlur = new UrlInputBlurEL ( noteDialog ); |
102 | this.#editionButtonsClick = new EditionButtonsClickEL ( noteDialog ); |
103 | this.#iconSelectorChange = new IconSelectorChangeEL ( noteDialog ); |
104 | this.#openCfgFileButtonClick = new OpenCfgFileButtonClickEL ( noteDialog ); |
105 | } |
106 | |
107 | /** |
108 | Set all events listeners to nul and then release all references to the dialog |
109 | */ |
110 | |
111 | destructor ( ) { |
112 | this.#controlFocus = null; |
113 | this.#controlInput = null; |
114 | this.#addressButtonClick = null; |
115 | this.#urlInputBlur = null; |
116 | this.#editionButtonsClick = null; |
117 | this.#iconSelectorChange = null; |
118 | this.#openCfgFileButtonClick = null; |
119 | } |
120 | |
121 | /** |
122 | The focus control event listener |
123 | @type {AllControlsFocusEL} |
124 | */ |
125 | |
126 | get controlFocus ( ) { return this.#controlFocus; } |
127 | |
128 | /** |
129 | The input event listener |
130 | @type {AllControlsInputEL} |
131 | */ |
132 | |
133 | get controlInput ( ) { return this.#controlInput; } |
134 | |
135 | /** |
136 | The address buton click event listener |
137 | @type {AddressButtonClickEL} |
138 | */ |
139 | |
140 | get addressButtonClick ( ) { return this.#addressButtonClick; } |
141 | |
142 | /** |
143 | The blur url input event listener |
144 | @type {UrlInputBlurEL} |
145 | */ |
146 | |
147 | get urlInputBlur ( ) { return this.#urlInputBlur; } |
148 | |
149 | /** |
150 | The edition button click event listener |
151 | @type {EditionButtonsClickEL} |
152 | */ |
153 | |
154 | get editionButtonsClick ( ) { return this.#editionButtonsClick; } |
155 | |
156 | /** |
157 | The icon selector change event listener |
158 | @type {IconSelectorChangeEL} |
159 | */ |
160 | |
161 | get iconSelectorChange ( ) { return this.#iconSelectorChange; } |
162 | |
163 | /** |
164 | The open file button click event listener |
165 | @type {OpenCfgFileButtonClickEL} |
166 | */ |
167 | |
168 | get openCfgFileButtonClick ( ) { return this.#openCfgFileButtonClick; } |
169 | } |
170 | |
171 | export default NoteDialogEventListeners; |
172 | |
173 | /* --- End of file --------------------------------------------------------------------------------------------------------- */ |
174 |