1/*
2 Copyright (c) 2001 Waldo Bastian <bastian@kde.org>
3 Copyright (c) 2004 Frans Englich <frans.englich@telia.com>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19
20*/
21
22#ifndef MAIN_H
23#define MAIN_H
24
25#include <KApplication>
26#include <KCMultiDialog>
27#include <KPageDialog>
28
29/**
30 * The KApplication instance for kcmshell.
31 */
32class KCMShell : public KApplication
33{
34 Q_OBJECT
35
36public:
37
38 /**
39 * Sets m_serviceName basically to @p serviceName,
40 * and then registers with D-BUS.
41 *
42 * @param serviceName name to set the D-BUS name to
43 */
44 void setServiceName(const QString &serviceName );
45
46 /**
47 * Waits until the last instance of kcmshell with the same
48 * module as this one exits, and then exits.
49 */
50 void waitForExit();
51
52 /**
53 * @return true if the shell is running
54 */
55 bool isRunning();
56
57private Q_SLOTS:
58
59 /**
60 */
61 void appExit( const QString &appId, const QString &, const QString & );
62
63private:
64
65 /**
66 * The D-Bus name which actually is registered.
67 * For example "kcmshell_mouse".
68 */
69 QString m_serviceName;
70
71};
72
73
74/**
75 * Essentially a plain KCMultiDialog, but has the additional functionality
76 * of allowing it to be told to request windows focus.
77 *
78 * @author Waldo Bastian <bastian@kde.org>
79 */
80class KCMShellMultiDialog : public KCMultiDialog
81{
82 Q_OBJECT
83 Q_CLASSINFO("D-Bus Interface", "org.kde.KCMShellMultiDialog")
84
85public:
86
87 /**
88 * Constructor. Parameter @p dialogFace is passed to KCMultiDialog
89 * unchanged.
90 */
91 explicit KCMShellMultiDialog(KPageDialog::FaceType dialogFace, QWidget *parent = 0);
92
93public Q_SLOTS:
94
95 /**
96 * Activate a module with id @p asn_id . This is used when
97 * black helicopters are spotted overhead.
98 */
99 virtual Q_SCRIPTABLE void activate( const QByteArray& asn_id );
100
101};
102
103// vim: sw=4 et sts=4
104#endif // MAIN_H
105