/usr/include/systemsettingsview/ModuleView.h is in kde-workspace-dev 4:4.11.8-0ubuntu6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | /*****************************************************************************
* Copyright (C) 2009 Ben Cooksley <bcooksley@kde.org> *
* Copyright (C) 2009 by Mathias Soeken <msoeken@informatik.uni-bremen.de> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
*****************************************************************************/
#ifndef MODULE_VIEW_H
#define MODULE_VIEW_H
#include <QtGui/QWidget>
#include <QtCore/QModelIndex>
#include "systemsettingsview_export.h"
class MenuItem;
class KAboutData;
class KCModuleInfo;
class KCModuleProxy;
class KPageWidgetItem;
/**
* @brief Provides a convienent way to display modules
*
* Provides a standardised interface for displaying multiple modules simultaneously
* and provides facilities to access the current module, and to load its help, restore
* default settings, save new settings and revert changes to settings
*
* It also provides checking for when a module has changed its configuration, and will prompt
* if the user tries to change module or view if BaseMode is reimplemented correctly
*
* It also provides signals for active module changes, configuration changes and for when it has
* been requested to close by button press
*
* @author Mathias Soeken <msoeken@informatik.uni-bremen.de>
* @author Ben Cooksley <bcooksley@kde.org>
*/
class SYSTEMSETTINGSVIEW_EXPORT ModuleView : public QWidget
{
Q_OBJECT
public:
/**
* Constructs a ModuleView, with the parent specified.
*/
explicit ModuleView(QWidget * parent = 0);
/**
* Destroys the module view, along with all modules loaded, and any changes present in them.
*
* @warning The user will not be prompted to save changes if any exist.\n
*/
~ModuleView();
/**
* Provides the module information, which is used to set the caption of the window when either the
* active module or configuration changes.
*/
KCModuleInfo * activeModule() const;
/**
* Provides the about data of the active module, used for the about dialog.
*/
const KAboutData * aboutData() const;
/**
* Resolves any changes in the currently active module by prompting the user if they exist.
*
* @returns true if the user saved or discarded changes, or there were no changes at all.
* @returns false if the user canceled the module change.
*/
bool resolveChanges();
/**
* Closes all active modules, after checking there are no active changes.
*
* @warning This forces all modules to be destroyed regardless of if changes exist or not
* If possible, always check with resolveChanges() first.
*/
void closeModules();
public Q_SLOTS:
/**
* Loads the module specified by menuItem.\n
* If the module has children, they will all be loaded instead of the module.
*
* @param menuItem the QModelIndex that you want to load. Must be sourced from either MenuModel or MenuProxyModel
*/
void loadModule( QModelIndex menuItem );
/**
* Will open KHelpCenter, and load the help for the active module.
*/
void moduleHelp();
/**
* Causes the active module to reload its configuration, reverting all changes.
*/
void moduleLoad();
/**
* Causes the active module to save its configuration, applying all changes.
*/
bool moduleSave();
/**
* Causes the active module to revert all changes to the configuration, and return to defaults.
*/
void moduleDefaults();
/**
* Reimplemented for internal reasons.\n
*/
void keyPressEvent( QKeyEvent * event );
private:
bool resolveChanges( KCModuleProxy *currentProxy );
void addModule( KCModuleInfo *module );
bool moduleSave( KCModuleProxy *module );
void updatePageIconHeader( KPageWidgetItem * page, bool light = false );
private Q_SLOTS:
void activeModuleChanged( KPageWidgetItem* current, KPageWidgetItem* previous);
void updateButtons();
void stateChanged();
Q_SIGNALS:
/**
* Emitted when the currently active module is changed. This occurs whenever the active module or
* its configuration changes. This causes the window caption to update.
*/
void moduleChanged( bool state );
/**
* Emitted when the ModuleView is asked to close.\n
*/
void closeRequest();
private:
class Private;
Private *const d;
};
#endif
|