Changeset View
Changeset View
Standalone View
Standalone View
src/kconfigdialog.h
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | 80 | Q_SIGNALS: | |||
---|---|---|---|---|---|
87 | * One or more of the settings have been permanently changed such as if | 87 | * One or more of the settings have been permanently changed such as if | ||
88 | * the user clicked on the Apply or Ok button. | 88 | * the user clicked on the Apply or Ok button. | ||
89 | * @param dialogName the name of the dialog. | 89 | * @param dialogName the name of the dialog. | ||
90 | */ | 90 | */ | ||
91 | void settingsChanged(const QString &dialogName); | 91 | void settingsChanged(const QString &dialogName); | ||
92 | 92 | | |||
93 | public: | 93 | public: | ||
94 | /** | 94 | /** | ||
95 | * Describes ways the size of this dialog adapts to the page content widget. | ||||
96 | */ | ||||
97 | enum PageContentAlignment { | ||||
98 | /** | ||||
99 | * Page does not adapt to the content widget in any way. | ||||
100 | * This means scrolling may be required to view the entire content. | ||||
101 | */ | ||||
102 | NoAlignment = 0, | ||||
103 | | ||||
104 | /** | ||||
105 | * Page is resized by default to show the entire width of the content. | ||||
106 | * Vertical scrolling may still be required to view the entire content. | ||||
107 | */ | ||||
108 | FitWidth = 1 | ||||
109 | }; | ||||
110 | Q_DECLARE_FLAGS(PageContentAlignments, PageContentAlignment) | ||||
111 | | ||||
112 | /** | ||||
95 | * @param parent - The parent of this object. Even though the class | 113 | * @param parent - The parent of this object. Even though the class | ||
96 | * deletes itself the parent should be set so the dialog can be centered | 114 | * deletes itself the parent should be set so the dialog can be centered | ||
97 | * with the application on the screen. | 115 | * with the application on the screen. | ||
98 | * | 116 | * | ||
99 | * @param name - The name of this object. The name is used in determining if | 117 | * @param name - The name of this object. The name is used in determining if | ||
100 | * there can be more than one dialog at a time. Use names such as: | 118 | * there can be more than one dialog at a time. Use names such as: | ||
101 | * "Font Settings" or "Color Settings" and not just "Settings" in | 119 | * "Font Settings" or "Color Settings" and not just "Settings" in | ||
102 | * applications where there is more than one dialog. | 120 | * applications where there is more than one dialog. | ||
Show All 27 Lines | |||||
130 | * @returns The KPageWidgetItem associated with the page. | 148 | * @returns The KPageWidgetItem associated with the page. | ||
131 | */ | 149 | */ | ||
132 | KPageWidgetItem *addPage(QWidget *page, const QString &itemName, | 150 | KPageWidgetItem *addPage(QWidget *page, const QString &itemName, | ||
133 | const QString &pixmapName = QString(), | 151 | const QString &pixmapName = QString(), | ||
134 | const QString &header = QString(), | 152 | const QString &header = QString(), | ||
135 | bool manage = true); | 153 | bool manage = true); | ||
136 | 154 | | |||
137 | /** | 155 | /** | ||
156 | * Adds page to the dialog and to KConfigDialogManager. When an | ||||
157 | * application is done adding pages show() should be called to | ||||
158 | * display the dialog. | ||||
159 | * @param page - Pointer to the page that is to be added to the dialog. | ||||
160 | * This object is reparented. | ||||
161 | * @param itemName - Name of the page. | ||||
162 | * @param contentAlignment - In which way to adapt the size of the page | ||||
163 | * to the size of the "page" widget. | ||||
164 | * @param pixmapName - Name of the icon that should be used, if needed, when | ||||
165 | * displaying the page. The string may either be the name of a themed | ||||
166 | * icon (e.g. "document-save"), which the internal icon loader will be | ||||
167 | * used to retrieve, or an absolute path to the pixmap on disk. | ||||
168 | * @param header - Header text use in the list modes. Ignored in Tabbed | ||||
169 | * mode. If empty, the itemName text is used when needed. | ||||
170 | * @param manage - Whether KConfigDialogManager should manage the page or not. | ||||
171 | * @returns The KPageWidgetItem associated with the page. | ||||
172 | */ | ||||
173 | KPageWidgetItem *addPage(QWidget *page, const QString &itemName, | ||||
174 | PageContentAlignment contentAlignment, | ||||
175 | const QString &pixmapName = QString(), | ||||
176 | const QString &header = QString(), | ||||
177 | bool manage = true); | ||||
178 | | ||||
179 | /** | ||||
138 | * Adds page to the dialog that is managed by a custom KConfigDialogManager. | 180 | * Adds page to the dialog that is managed by a custom KConfigDialogManager. | ||
139 | * This is useful for dialogs that contain settings spread over more than | 181 | * This is useful for dialogs that contain settings spread over more than | ||
140 | * one configuration file and thus have/need more than one KConfigSkeleton. | 182 | * one configuration file and thus have/need more than one KConfigSkeleton. | ||
141 | * When an application is done adding pages show() should be called to | 183 | * When an application is done adding pages show() should be called to | ||
142 | * display the dialog. | 184 | * display the dialog. | ||
143 | * @param page - Pointer to the page that is to be added to the dialog. | 185 | * @param page - Pointer to the page that is to be added to the dialog. | ||
144 | * This object is reparented. | 186 | * This object is reparented. | ||
145 | * @param config - Config object containing corresponding settings. | 187 | * @param config - Config object containing corresponding settings. | ||
146 | * @param itemName - Name of the page. | 188 | * @param itemName - Name of the page. | ||
147 | * @param pixmapName - Name of the icon that should be used, if needed, when | 189 | * @param pixmapName - Name of the icon that should be used, if needed, when | ||
148 | * displaying the page. The string may either be the name of a themed | 190 | * displaying the page. The string may either be the name of a themed | ||
149 | * icon (e.g. "document-save"), which the internal icon loader will be | 191 | * icon (e.g. "document-save"), which the internal icon loader will be | ||
150 | * used to retrieve, or an absolute path to the pixmap on disk. | 192 | * used to retrieve, or an absolute path to the pixmap on disk. | ||
151 | * @param header - Header text use in the list modes. Ignored in Tabbed | 193 | * @param header - Header text use in the list modes. Ignored in Tabbed | ||
152 | * mode. If empty, the itemName text is used when needed. | 194 | * mode. If empty, the itemName text is used when needed. | ||
153 | * @returns The KPageWidgetItem associated with the page. | 195 | * @returns The KPageWidgetItem associated with the page. | ||
154 | */ | 196 | */ | ||
155 | KPageWidgetItem *addPage(QWidget *page, KCoreConfigSkeleton *config, | 197 | KPageWidgetItem *addPage(QWidget *page, KCoreConfigSkeleton *config, | ||
156 | const QString &itemName, | 198 | const QString &itemName, | ||
157 | const QString &pixmapName = QString(), | 199 | const QString &pixmapName = QString(), | ||
158 | const QString &header = QString()); | 200 | const QString &header = QString()); | ||
159 | 201 | | |||
160 | /** | 202 | /** | ||
203 | * Adds page to the dialog that is managed by a custom KConfigDialogManager. | ||||
204 | * This is useful for dialogs that contain settings spread over more than | ||||
205 | * one configuration file and thus have/need more than one KConfigSkeleton. | ||||
206 | * When an application is done adding pages show() should be called to | ||||
207 | * display the dialog. | ||||
208 | * @param page - Pointer to the page that is to be added to the dialog. | ||||
209 | * This object is reparented. | ||||
210 | * @param config - Config object containing corresponding settings. | ||||
211 | * @param itemName - Name of the page. | ||||
212 | * @param contentAlignment - In which way to adapt the size of the page | ||||
213 | * to the size of the "page" widget. | ||||
214 | * @param pixmapName - Name of the icon that should be used, if needed, when | ||||
215 | * displaying the page. The string may either be the name of a themed | ||||
216 | * icon (e.g. "document-save"), which the internal icon loader will be | ||||
217 | * used to retrieve, or an absolute path to the pixmap on disk. | ||||
218 | * @param header - Header text use in the list modes. Ignored in Tabbed | ||||
219 | * mode. If empty, the itemName text is used when needed. | ||||
220 | * @returns The KPageWidgetItem associated with the page. | ||||
221 | */ | ||||
222 | KPageWidgetItem *addPage(QWidget *page, KCoreConfigSkeleton *config, | ||||
223 | const QString &itemName, | ||||
224 | PageContentAlignment contentAlignment, | ||||
225 | const QString &pixmapName = QString(), | ||||
226 | const QString &header = QString()); | ||||
227 | | ||||
228 | /** | ||||
161 | * See if a dialog with the name 'name' already exists. | 229 | * See if a dialog with the name 'name' already exists. | ||
162 | * @see showDialog() | 230 | * @see showDialog() | ||
163 | * @param name - Dialog name to look for. | 231 | * @param name - Dialog name to look for. | ||
164 | * @return Pointer to widget or NULL if it does not exist. | 232 | * @return Pointer to widget or NULL if it does not exist. | ||
165 | */ | 233 | */ | ||
166 | static KConfigDialog *exists(const QString &name); | 234 | static KConfigDialog *exists(const QString &name); | ||
167 | 235 | | |||
168 | /** | 236 | /** | ||
▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Line(s) | 332 | private: | |||
268 | KConfigDialogPrivate *const d; | 336 | KConfigDialogPrivate *const d; | ||
269 | 337 | | |||
270 | Q_PRIVATE_SLOT(d, void _k_updateButtons()) | 338 | Q_PRIVATE_SLOT(d, void _k_updateButtons()) | ||
271 | Q_PRIVATE_SLOT(d, void _k_settingsChangedSlot()) | 339 | Q_PRIVATE_SLOT(d, void _k_settingsChangedSlot()) | ||
272 | 340 | | |||
273 | Q_DISABLE_COPY(KConfigDialog) | 341 | Q_DISABLE_COPY(KConfigDialog) | ||
274 | }; | 342 | }; | ||
275 | 343 | | |||
276 | #endif //KCONFIGDIALOG_H | 344 | Q_DECLARE_OPERATORS_FOR_FLAGS(KConfigDialog::PageContentAlignments) | ||
277 | 345 | | |||
346 | #endif //KCONFIGDIALOG_H |