not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / krunner / krunnerapp.h
blob0efbdb4d26183bde24518dcc1dcb39303e450ab5
1 /*
2 * Copyright (C) 2006 Aaron Seigo <aseigo@kde.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License version 2 as
6 * published by the Free Software Foundation
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details
13 * You should have received a copy of the GNU Library General Public
14 * License along with this program; if not, write to the
15 * Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef KRUNNERAPP_H
20 #define KRUNNERAPP_H
22 #include <kworkspace.h>
24 #include <kuniqueapplication.h>
25 #ifdef Q_WS_X11
26 #include "saverengine.h"
27 #endif
29 class KActionCollection;
30 class KDialog;
32 namespace Plasma
34 class RunnerManager;
37 class KRunnerDialog;
38 class StartupId;
40 class KRunnerApp : public KUniqueApplication
42 Q_OBJECT
43 Q_CLASSINFO("D-Bus Interface", "org.kde.krunner.App")
45 public:
46 static KRunnerApp* self();
47 ~KRunnerApp();
49 void logout( KWorkSpace::ShutdownConfirm confirm, KWorkSpace::ShutdownType sdtype );
50 // The action collection of the active widget
51 KActionCollection* actionCollection();
53 virtual int newInstance();
54 #ifdef Q_WS_X11
55 SaverEngine& screensaver() { return m_saver; }
56 #endif
58 bool hasCompositeManager() const;
60 public Q_SLOTS:
61 //void showWindowList();
63 void logout();
64 void logoutWithoutConfirmation();
65 void haltWithoutConfirmation();
66 void rebootWithoutConfirmation();
68 // DBUS interface. if you change these methods, you MUST run:
69 // qdbuscpp2xml -m krunnerapp.h -o org.kde.krunner.App.xml
70 Q_SCRIPTABLE void initializeStartupNotification();
72 /** Show taskmanager */
73 Q_SCRIPTABLE void showTaskManager();
75 /** Display the interface */
76 Q_SCRIPTABLE void display();
78 /** Display the interface */
79 Q_SCRIPTABLE void query(const QString& term);
81 /** Display the interface, using clipboard contents */
82 Q_SCRIPTABLE void displayWithClipboardContents();
84 /** Switch user */
85 Q_SCRIPTABLE void switchUser();
87 /** Clear the search history */
88 Q_SCRIPTABLE void clearHistory();
90 private slots:
91 /**
92 * Called when the task dialog emits its finished() signal
94 void taskDialogFinished();
95 void reloadConfig();
96 void cleanUp();
98 private:
99 KRunnerApp(Display *display, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
100 void initialize();
102 Plasma::RunnerManager *m_runnerManager;
103 KActionCollection *m_actionCollection;
104 #ifdef Q_WS_X11
105 SaverEngine m_saver;
106 #endif
107 KRunnerDialog *m_interface;
108 KDialog *m_tasks;
109 StartupId *m_startupId;
112 #endif /* KRUNNERAPP_H */