~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to systemsettings/app/SettingsBase.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2009 by Ben Cooksley <bcooksley@kde.org>                *
 
3
 *                                                                         *
 
4
 *   This program is free software; you can redistribute it and/or modify  *
 
5
 *   it under the terms of the GNU General Public License as published by  *
 
6
 *   the Free Software Foundation; either version 2 of the License, or     *
 
7
 *   (at your option) 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                         *
 
16
 *   Free Software Foundation, Inc.,                                       *
 
17
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA          *
 
18
 ***************************************************************************/
 
19
 
 
20
#ifndef SETTINGS_BASE_H
 
21
#define SETTINGS_BASE_H
 
22
 
 
23
#include "MenuItem.h"
 
24
#include "BaseMode.h"
 
25
#include "tooltipmanager.h"
 
26
#include "ui_configDialog.h"
 
27
 
 
28
#include <QMap>
 
29
#include <QStackedWidget>
 
30
 
 
31
#include <KService>
 
32
#include <KLineEdit>
 
33
#include <KActionMenu>
 
34
#include <KConfigDialog>
 
35
#include <KXmlGuiWindow>
 
36
#include <KAboutApplicationDialog>
 
37
 
 
38
class SettingsBase : public KXmlGuiWindow
 
39
{
 
40
    Q_OBJECT
 
41
 
 
42
public:
 
43
    explicit SettingsBase(QWidget * parent = 0);
 
44
    ~SettingsBase();
 
45
    bool queryClose();
 
46
 
 
47
protected:
 
48
    virtual QSize sizeHint() const;
 
49
 
 
50
private slots:
 
51
    void initApplication();
 
52
    void initToolBar();
 
53
    void initHelpMenu();
 
54
    void initConfig();
 
55
    void initMenuList(MenuItem * parent);
 
56
    void configUpdated();
 
57
    void configShow();
 
58
    void about();
 
59
    void changePlugin();
 
60
    void viewChange(bool state);
 
61
    void updateViewActions();
 
62
    void changeToolBar( BaseMode::ToolBarItems toolbar );
 
63
    void changeAboutMenu( const KAboutData * menuAbout, KAction * menuItem, QString fallback );
 
64
 
 
65
private:
 
66
    // The plugins
 
67
    QMap<QString, BaseMode *> possibleViews;
 
68
    QList<ToolTipManager*> tooltipManagers;
 
69
    BaseMode * activeView;
 
70
    // The search bar
 
71
    KLineEdit * searchText;
 
72
    QWidget * spacerWidget;
 
73
    // The toolbar
 
74
    KAction * searchAction;
 
75
    KAction * spacerAction;
 
76
    KAction * configureAction;
 
77
    KAction * quitAction;
 
78
    // The help menu
 
79
    KAction * aboutViewAction;
 
80
    KAction * aboutModuleAction;
 
81
    KActionMenu * helpActionMenu;
 
82
    // The configuration
 
83
    KConfigDialog * configDialog;
 
84
    Ui::ConfigDialog configWidget;
 
85
    QButtonGroup viewSelection;
 
86
    // The control module
 
87
    QStackedWidget * stackedWidget;
 
88
    // The module list
 
89
    MenuItem * rootModule;
 
90
    MenuItem * lostFound;
 
91
    KService::List categories;
 
92
    KService::List modules;
 
93
    // The about dialog
 
94
    KAboutApplicationDialog * aboutDialog;
 
95
};
 
96
#endif