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 | * Options for handling and displaying pages. | ||||
96 | */ | ||||
97 | enum PageOption { | ||||
98 | /** | ||||
99 | * Page should not adapt to the content widget in any way. | ||||
100 | * This means scrolling may be required to view the entire content. | ||||
101 | * | ||||
102 | * Page will also not be managed by KConfigDialogManager. | ||||
103 | */ | ||||
104 | NoPageOptions = 0, | ||||
105 | | ||||
106 | /** | ||||
107 | * KConfigDialogManager should manage the page. | ||||
108 | * @see KConfigDialogManager | ||||
109 | */ | ||||
110 | ManagePage = 1, | ||||
111 | | ||||
112 | /** | ||||
113 | * Page should be resized by default to show the entire content. | ||||
114 | * Scrolling may still be required on displays that cannot fit the | ||||
115 | * entire content. | ||||
116 | */ | ||||
117 | FitPageSize = 2 | ||||
118 | }; | ||||
119 | Q_DECLARE_FLAGS(PageOptions, PageOption) | ||||
120 | | ||||
121 | /** | ||||
95 | * @param parent - The parent of this object. Even though the class | 122 | * @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 | 123 | * deletes itself the parent should be set so the dialog can be centered | ||
97 | * with the application on the screen. | 124 | * with the application on the screen. | ||
98 | * | 125 | * | ||
99 | * @param name - The name of this object. The name is used in determining if | 126 | * @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: | 127 | * 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 | 128 | * "Font Settings" or "Color Settings" and not just "Settings" in | ||
102 | * applications where there is more than one dialog. | 129 | * applications where there is more than one dialog. | ||
Show All 27 Lines | |||||
130 | * @returns The KPageWidgetItem associated with the page. | 157 | * @returns The KPageWidgetItem associated with the page. | ||
131 | */ | 158 | */ | ||
132 | KPageWidgetItem *addPage(QWidget *page, const QString &itemName, | 159 | KPageWidgetItem *addPage(QWidget *page, const QString &itemName, | ||
133 | const QString &pixmapName = QString(), | 160 | const QString &pixmapName = QString(), | ||
134 | const QString &header = QString(), | 161 | const QString &header = QString(), | ||
135 | bool manage = true); | 162 | bool manage = true); | ||
136 | 163 | | |||
137 | /** | 164 | /** | ||
165 | * Adds page to the dialog and to KConfigDialogManager. When an | ||||
166 | * application is done adding pages show() should be called to | ||||
167 | * display the dialog. | ||||
168 | * @param page - Pointer to the page that is to be added to the dialog. | ||||
169 | * This object is reparented. | ||||
170 | * @param itemName - Name of the page. | ||||
171 | * @param options - Options to apply to the added page. | ||||
172 | * @param pixmapName - Name of the icon that should be used, if needed, when | ||||
173 | * displaying the page. The string may either be the name of a themed | ||||
174 | * icon (e.g. "document-save"), which the internal icon loader will be | ||||
175 | * used to retrieve, or an absolute path to the pixmap on disk. | ||||
176 | * @param header - Header text use in the list modes. Ignored in Tabbed | ||||
177 | * mode. If empty, the itemName text is used when needed. | ||||
178 | * @returns The KPageWidgetItem associated with the page. | ||||
179 | */ | ||||
180 | KPageWidgetItem *addPage(QWidget *page, const QString &itemName, | ||||
181 | PageOptions options, | ||||
182 | const QString &pixmapName = QString(), | ||||
183 | const QString &header = QString()); | ||||
184 | | ||||
185 | /** | ||||
186 | * Adds page to the dialog that is managed by a custom KConfigDialogManager. | ||||
187 | * This is useful for dialogs that contain settings spread over more than | ||||
188 | * one configuration file and thus have/need more than one KConfigSkeleton. | ||||
189 | * When an application is done adding pages show() should be called to | ||||
190 | * display the dialog. | ||||
191 | * @param page - Pointer to the page that is to be added to the dialog. | ||||
192 | * This object is reparented. | ||||
193 | * @param config - Config object containing corresponding settings. | ||||
194 | * @param itemName - Name of the page. | ||||
195 | * @param pixmapName - Name of the icon that should be used, if needed, when | ||||
196 | * displaying the page. The string may either be the name of a themed | ||||
197 | * icon (e.g. "document-save"), which the internal icon loader will be | ||||
198 | * used to retrieve, or an absolute path to the pixmap on disk. | ||||
199 | * @param header - Header text use in the list modes. Ignored in Tabbed | ||||
200 | * mode. If empty, the itemName text is used when needed. | ||||
201 | * @returns The KPageWidgetItem associated with the page. | ||||
202 | */ | ||||
203 | KPageWidgetItem *addPage(QWidget *page, KCoreConfigSkeleton *config, | ||||
204 | const QString &itemName, | ||||
205 | const QString &pixmapName = QString(), | ||||
206 | const QString &header = QString()); | ||||
207 | | ||||
208 | /** | ||||
138 | * Adds page to the dialog that is managed by a custom KConfigDialogManager. | 209 | * 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 | 210 | * This is useful for dialogs that contain settings spread over more than | ||
140 | * one configuration file and thus have/need more than one KConfigSkeleton. | 211 | * one configuration file and thus have/need more than one KConfigSkeleton. | ||
141 | * When an application is done adding pages show() should be called to | 212 | * When an application is done adding pages show() should be called to | ||
142 | * display the dialog. | 213 | * display the dialog. | ||
143 | * @param page - Pointer to the page that is to be added to the dialog. | 214 | * @param page - Pointer to the page that is to be added to the dialog. | ||
144 | * This object is reparented. | 215 | * This object is reparented. | ||
145 | * @param config - Config object containing corresponding settings. | 216 | * @param config - Config object containing corresponding settings. | ||
146 | * @param itemName - Name of the page. | 217 | * @param itemName - Name of the page. | ||
218 | * @param options - Options to apply to the added page. | ||||
147 | * @param pixmapName - Name of the icon that should be used, if needed, when | 219 | * @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 | 220 | * 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 | 221 | * 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. | 222 | * 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 | 223 | * @param header - Header text use in the list modes. Ignored in Tabbed | ||
152 | * mode. If empty, the itemName text is used when needed. | 224 | * mode. If empty, the itemName text is used when needed. | ||
153 | * @returns The KPageWidgetItem associated with the page. | 225 | * @returns The KPageWidgetItem associated with the page. | ||
154 | */ | 226 | */ | ||
155 | KPageWidgetItem *addPage(QWidget *page, KCoreConfigSkeleton *config, | 227 | KPageWidgetItem *addPage(QWidget *page, KCoreConfigSkeleton *config, | ||
156 | const QString &itemName, | 228 | const QString &itemName, | ||
229 | PageOptions options, | ||||
157 | const QString &pixmapName = QString(), | 230 | const QString &pixmapName = QString(), | ||
158 | const QString &header = QString()); | 231 | const QString &header = QString()); | ||
159 | 232 | | |||
160 | /** | 233 | /** | ||
161 | * See if a dialog with the name 'name' already exists. | 234 | * See if a dialog with the name 'name' already exists. | ||
162 | * @see showDialog() | 235 | * @see showDialog() | ||
163 | * @param name - Dialog name to look for. | 236 | * @param name - Dialog name to look for. | ||
164 | * @return Pointer to widget or NULL if it does not exist. | 237 | * @return Pointer to widget or NULL if it does not exist. | ||
▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | 337 | private: | |||
268 | KConfigDialogPrivate *const d; | 341 | KConfigDialogPrivate *const d; | ||
269 | 342 | | |||
270 | Q_PRIVATE_SLOT(d, void _k_updateButtons()) | 343 | Q_PRIVATE_SLOT(d, void _k_updateButtons()) | ||
271 | Q_PRIVATE_SLOT(d, void _k_settingsChangedSlot()) | 344 | Q_PRIVATE_SLOT(d, void _k_settingsChangedSlot()) | ||
272 | 345 | | |||
273 | Q_DISABLE_COPY(KConfigDialog) | 346 | Q_DISABLE_COPY(KConfigDialog) | ||
274 | }; | 347 | }; | ||
275 | 348 | | |||
276 | #endif //KCONFIGDIALOG_H | 349 | Q_DECLARE_OPERATORS_FOR_FLAGS(KConfigDialog::PageOptions) | ||
277 | 350 | | |||
351 | #endif //KCONFIGDIALOG_H |