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

« back to all changes in this revision

Viewing changes to systemsettings/core/BaseMode.cpp

  • 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 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
#include "BaseMode.h"
 
21
 
 
22
#include <QList>
 
23
#include <QAction>
 
24
#include <QAbstractItemView>
 
25
 
 
26
#include <KConfigGroup>
 
27
#include <KConfigDialog>
 
28
#include <KServiceTypeTrader>
 
29
 
 
30
#include "MenuItem.h"
 
31
#include "BaseData.h"
 
32
#include "ModuleView.h"
 
33
 
 
34
class BaseMode::Private {
 
35
public:
 
36
    Private() {}
 
37
 
 
38
    QList<QAction*> actionsList;
 
39
    KService::Ptr service;
 
40
    MenuItem *rootItem;
 
41
    KConfigGroup config;
 
42
};
 
43
 
 
44
BaseMode::BaseMode( QObject* parent )
 
45
    : QObject( parent )
 
46
    , d( new Private() )
 
47
{
 
48
}
 
49
 
 
50
BaseMode::~BaseMode()
 
51
{
 
52
    delete d;
 
53
}
 
54
 
 
55
void BaseMode::init( const KService::Ptr modeService )
 
56
{
 
57
    d->rootItem = BaseData::instance()->menuItem();
 
58
    d->service = modeService;
 
59
    d->config = BaseData::instance()->configGroup( modeService->library() );
 
60
    initEvent();
 
61
    connect( moduleView(), SIGNAL( moduleChanged( bool ) ), this, SIGNAL( viewChanged( bool ) ) );
 
62
}
 
63
 
 
64
void BaseMode::initEvent()
 
65
{
 
66
}
 
67
 
 
68
QWidget * BaseMode::mainWidget()
 
69
{
 
70
    return 0;
 
71
}
 
72
 
 
73
KAboutData * BaseMode::aboutData()
 
74
{
 
75
    return 0;
 
76
}
 
77
 
 
78
ModuleView * BaseMode::moduleView() const
 
79
{
 
80
    return 0;
 
81
}
 
82
 
 
83
QList<QAction*>& BaseMode::actionsList() const
 
84
{
 
85
    return d->actionsList;
 
86
}
 
87
 
 
88
const KService::Ptr& BaseMode::service() const
 
89
{
 
90
    return d->service;
 
91
}
 
92
 
 
93
void BaseMode::searchChanged( const QString& text )
 
94
{
 
95
    Q_UNUSED( text );
 
96
}
 
97
 
 
98
void BaseMode::saveState()
 
99
{
 
100
}
 
101
 
 
102
void BaseMode::leaveModuleView()
 
103
{
 
104
}
 
105
 
 
106
void BaseMode::giveFocus()
 
107
{
 
108
}
 
109
 
 
110
void BaseMode::addConfiguration( KConfigDialog * config )
 
111
{
 
112
    Q_UNUSED( config );
 
113
}
 
114
 
 
115
void BaseMode::loadConfiguration()
 
116
{
 
117
}
 
118
 
 
119
void BaseMode::saveConfiguration()
 
120
{
 
121
}
 
122
 
 
123
MenuItem * BaseMode::rootItem() const
 
124
{
 
125
    return d->rootItem;
 
126
}
 
127
 
 
128
KConfigGroup& BaseMode::config() const
 
129
{
 
130
    return d->config;
 
131
}
 
132
 
 
133
QList<QAbstractItemView*> BaseMode::views() const
 
134
{
 
135
    return QList<QAbstractItemView*>();
 
136
}
 
137
 
 
138
#include "BaseMode.moc"