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

« back to all changes in this revision

Viewing changes to krunner/krunnerapp.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) 2006 Aaron Seigo <aseigo@kde.org>
 
3
 *
 
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
 
7
 *
 
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
 
12
 *
 
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.
 
17
 */
 
18
 
 
19
#ifndef KRUNNERAPP_H
 
20
#define KRUNNERAPP_H
 
21
 
 
22
#include <kworkspace.h>
 
23
 
 
24
#include <kuniqueapplication.h>
 
25
#ifdef Q_WS_X11
 
26
#include "saverengine.h"
 
27
#endif
 
28
 
 
29
class KActionCollection;
 
30
class KDialog;
 
31
 
 
32
namespace Plasma
 
33
{
 
34
    class RunnerManager;
 
35
}
 
36
 
 
37
class KRunnerDialog;
 
38
class KSystemActivityDialog;
 
39
class StartupId;
 
40
class PanelShadows;
 
41
 
 
42
class KRunnerApp : public KUniqueApplication
 
43
{
 
44
    Q_OBJECT
 
45
    Q_CLASSINFO("D-Bus Interface", "org.kde.krunner.App")
 
46
 
 
47
public:
 
48
    static KRunnerApp* self();
 
49
    ~KRunnerApp();
 
50
 
 
51
    void logout( KWorkSpace::ShutdownConfirm confirm, KWorkSpace::ShutdownType sdtype );
 
52
    // The action collection of the active widget
 
53
    KActionCollection* actionCollection();
 
54
 
 
55
    virtual int newInstance();
 
56
#ifdef Q_WS_X11
 
57
    SaverEngine& screensaver() { return m_saver; }
 
58
#endif
 
59
 
 
60
    bool hasCompositeManager() const;
 
61
 
 
62
public Q_SLOTS:
 
63
    // DBUS interface. if you change these methods, you MUST run:
 
64
    // qdbuscpp2xml -m krunnerapp.h -o dbus/org.kde.krunner.App.xml
 
65
    Q_SCRIPTABLE void initializeStartupNotification();
 
66
 
 
67
    /** Show taskmanager */
 
68
    Q_SCRIPTABLE void showTaskManager();
 
69
    /** Show taskmanager, filtering by the given string */
 
70
    Q_SCRIPTABLE void showTaskManagerWithFilter(const QString &filterText);
 
71
 
 
72
    /** Display the interface */
 
73
    Q_SCRIPTABLE void display();
 
74
 
 
75
    /** Enter single runner query mode **/
 
76
    Q_SCRIPTABLE void displaySingleRunner(const QString& runnerName);
 
77
 
 
78
    /** Display the interface, using clipboard contents */
 
79
    Q_SCRIPTABLE void displayWithClipboardContents();
 
80
 
 
81
    /** Display the interface */
 
82
    Q_SCRIPTABLE void query(const QString& term);
 
83
 
 
84
    /** Enter single runner query mode **/
 
85
    Q_SCRIPTABLE void querySingleRunner(const QString& runnerName, const QString &term);
 
86
 
 
87
    /** Switch user */
 
88
    Q_SCRIPTABLE void switchUser();
 
89
 
 
90
    /** Clear the search history */
 
91
    Q_SCRIPTABLE void clearHistory();
 
92
 
 
93
    Q_SCRIPTABLE QStringList singleModeAdvertisedRunnerIds() const;
 
94
 
 
95
private slots:
 
96
    /**
 
97
     * Called when the task dialog emits its finished() signal
 
98
     */
 
99
    void taskDialogFinished();
 
100
    void reloadConfig();
 
101
    void cleanUp();
 
102
    void displayOrHide();
 
103
    void singleRunnerModeActionTriggered();
 
104
 
 
105
private:
 
106
    KRunnerApp();
 
107
    void initialize();
 
108
 
 
109
    Plasma::RunnerManager *m_runnerManager;
 
110
    KActionCollection *m_actionCollection;
 
111
#ifdef Q_WS_X11
 
112
    SaverEngine m_saver;
 
113
#endif
 
114
    KRunnerDialog *m_interface;
 
115
    PanelShadows *m_shadows;
 
116
    KSystemActivityDialog *m_tasks;
 
117
    StartupId *m_startupId;
 
118
    bool m_firstTime;
 
119
};
 
120
 
 
121
#endif /* KRUNNERAPP_H */
 
122