1 | /* This file is part of the KDE project |
2 | |
3 | Copyright (C) 2008 Omat Holding B.V. <info@omat.nl> |
4 | |
5 | This program is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU 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 program 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 | General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
18 | */ |
19 | |
20 | |
21 | #ifndef DOCK_H |
22 | #define DOCK_H |
23 | |
24 | #include <QWidget> |
25 | |
26 | #include <KStatusNotifierItem> |
27 | |
28 | #include <akonadi/agentinstance.h> |
29 | |
30 | class QLabel; |
31 | class QAction; |
32 | |
33 | class Tray : public QWidget |
34 | { |
35 | public: |
36 | Tray(); |
37 | |
38 | protected: |
39 | void setVisible( bool ); |
40 | }; |
41 | |
42 | class Dock : public KStatusNotifierItem |
43 | { |
44 | Q_OBJECT |
45 | Q_CLASSINFO( "D-Bus Interface" , "org.kde.akonaditray" ) |
46 | |
47 | public: |
48 | /** |
49 | * Contructor |
50 | * @param parent Parent Widget |
51 | */ |
52 | Dock( QWidget *parent ); |
53 | |
54 | /** |
55 | * Destructor |
56 | */ |
57 | ~Dock(); |
58 | |
59 | public Q_SLOTS: |
60 | void infoMessage( const QString&, const QString& = QString() ); |
61 | void errorMessage( const QString&, const QString& = QString() ); |
62 | qlonglong getWinId(); |
63 | |
64 | private Q_SLOTS: |
65 | void slotInstanceWarning( const Akonadi::AgentInstance&, const QString& ); |
66 | void slotInstanceError( const Akonadi::AgentInstance&, const QString& ); |
67 | void slotServerStarted(); |
68 | void slotServerStopped(); |
69 | void slotActivated(); |
70 | void slotStopAkonadi(); |
71 | void slotStartAkonadi(); |
72 | void slotStartBackup(); |
73 | void slotStartRestore(); |
74 | void slotConfigure(); |
75 | |
76 | private: |
77 | void ( bool ); |
78 | QWidget *m_parentWidget; |
79 | QAction *m_title; |
80 | QAction *m_stopAction; |
81 | QAction *m_startAction; |
82 | QAction *m_backupAction; |
83 | QAction *m_restoreAction; |
84 | bool m_explicitStart; |
85 | }; |
86 | |
87 | #endif // DOCK_H |
88 | |
89 | |