Changeset View
Changeset View
Standalone View
Standalone View
core/BaseMode.h
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 50 | { | |||
---|---|---|---|---|---|
51 | Q_OBJECT | 51 | Q_OBJECT | ||
52 | 52 | | |||
53 | /** | 53 | /** | ||
54 | * System Settings main application is allowed priviledged access to handle tooltips | 54 | * System Settings main application is allowed priviledged access to handle tooltips | ||
55 | */ | 55 | */ | ||
56 | friend class SettingsBase; | 56 | friend class SettingsBase; | ||
57 | 57 | | |||
58 | public: | 58 | public: | ||
59 | // Main mode of the app. | ||||
60 | // At the moment SystemSettings and InfoCenter are supported: | ||||
61 | // Changes mainly the set of module listed on the left menu | ||||
62 | enum ApplicationMode { | ||||
63 | SystemSettings = 0, | ||||
64 | InfoCenter | ||||
65 | }; | ||||
66 | Q_ENUM(ApplicationMode); | ||||
67 | | ||||
59 | /** | 68 | /** | ||
60 | * Constructs a BaseMode for use in System Settings.\n | 69 | * Constructs a BaseMode for use in System Settings.\n | ||
61 | * Plugin developers should perform all initialisation in initEvent() not here. | 70 | * Plugin developers should perform all initialisation in initEvent() not here. | ||
62 | * | 71 | * | ||
63 | * @param parent The parent of this BaseMode. | 72 | * @param parent The parent of this BaseMode. | ||
64 | */ | 73 | */ | ||
65 | explicit BaseMode( QObject * parent ); | 74 | explicit BaseMode( QObject * parent, const QVariantList &args ); | ||
66 | /** | 75 | /** | ||
67 | * Normal destructor. Plugin developers only need destroy what they created | 76 | * Normal destructor. Plugin developers only need destroy what they created | ||
68 | * not what is provided by BaseMode itself. | 77 | * not what is provided by BaseMode itself. | ||
69 | */ | 78 | */ | ||
70 | ~BaseMode() override; | 79 | ~BaseMode() override; | ||
71 | 80 | | |||
72 | /** | 81 | /** | ||
73 | * These flags are used to control the presence of the Search and Configure actions on the toolbar | 82 | * These flags are used to control the presence of the Search and Configure actions on the toolbar | ||
Show All 35 Lines | |||||
109 | * This does not need to be implemented, and need only be implemented if the author | 118 | * This does not need to be implemented, and need only be implemented if the author | ||
110 | * wants information about the view displayed in the About dialog. | 119 | * wants information about the view displayed in the About dialog. | ||
111 | * | 120 | * | ||
112 | * @returns The about data of the plugin. | 121 | * @returns The about data of the plugin. | ||
113 | */ | 122 | */ | ||
114 | virtual KAboutData * aboutData(); | 123 | virtual KAboutData * aboutData(); | ||
115 | 124 | | |||
116 | /** | 125 | /** | ||
126 | * @returns the application mode of this systemsettings process: SystemSettings or InfoCenter | ||||
127 | */ | ||||
128 | ApplicationMode applicationMode() const; | ||||
129 | | ||||
130 | /** | ||||
117 | * The state of the plugin ( position of the splitter for instance ) should be saved | 131 | * The state of the plugin ( position of the splitter for instance ) should be saved | ||
118 | * to the configuration object when this is called. | 132 | * to the configuration object when this is called. | ||
119 | */ | 133 | */ | ||
120 | virtual void saveState(); | 134 | virtual void saveState(); | ||
121 | 135 | | |||
122 | /** | 136 | /** | ||
123 | * Causes the view to unload all modules in the module view, and return to their module selection state | 137 | * Causes the view to unload all modules in the module view, and return to their module selection state | ||
124 | * | 138 | * | ||
▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Line(s) | 238 | protected: | |||
227 | * This is usually passed to the constructor of MenuModel. | 241 | * This is usually passed to the constructor of MenuModel. | ||
228 | * | 242 | * | ||
229 | * @warning This is shared between all views, and should not be deleted manually. | 243 | * @warning This is shared between all views, and should not be deleted manually. | ||
230 | * @returns The root menu item as provided by System Settings. | 244 | * @returns The root menu item as provided by System Settings. | ||
231 | */ | 245 | */ | ||
232 | MenuItem * rootItem() const; | 246 | MenuItem * rootItem() const; | ||
233 | 247 | | |||
234 | /** | 248 | /** | ||
249 | * Returns (if present) an item that corresponds to a KCM which should be used as startup page. | ||||
250 | * | ||||
251 | * @warning This is shared between all views, and should not be deleted manually. | ||||
252 | * @returns The item to load as startup page. It may be nullptr | ||||
253 | */ | ||||
254 | MenuItem * homeItem() const; | ||||
255 | | ||||
256 | /** | ||||
235 | * Provides access to the configuration for the plugin. | 257 | * Provides access to the configuration for the plugin. | ||
236 | * | 258 | * | ||
237 | * @returns The configuration group for the plugin. | 259 | * @returns The configuration group for the plugin. | ||
238 | */ | 260 | */ | ||
239 | KConfigGroup& config() const; | 261 | KConfigGroup& config() const; | ||
240 | 262 | | |||
241 | /** | 263 | /** | ||
242 | * Provides access to item views used by the plugin. | 264 | * Provides access to item views used by the plugin. | ||
Show All 15 Lines |