1 | /*
|
---|
2 | * mainwin_p.h - classes used privately by the main window.
|
---|
3 | * Copyright (C) 2001-2003 Justin Karneges, Michail Pishchagin
|
---|
4 | *
|
---|
5 | * This program is free software; you can redistribute it and/or
|
---|
6 | * modify it under the terms of the GNU General Public License
|
---|
7 | * as published by the Free Software Foundation; either version 2
|
---|
8 | * 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
|
---|
13 | * GNU General Public License for more details.
|
---|
14 | *
|
---|
15 | * You should have received a copy of the GNU General Public License
|
---|
16 | * along with this library; if not, write to the Free Software
|
---|
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
18 | *
|
---|
19 | */
|
---|
20 |
|
---|
21 | #ifndef MAINWIN_P_H
|
---|
22 |
|
---|
23 | #include<qpushbutton.h>
|
---|
24 | #include<qtoolbutton.h>
|
---|
25 | #include<qpopupmenu.h>
|
---|
26 | #include<qlayout.h>
|
---|
27 | #include<qlabel.h>
|
---|
28 | #include<qptrvector.h>
|
---|
29 | #include<qtooltip.h>
|
---|
30 | #include<qaction.h>
|
---|
31 | #include"trayicon.h"
|
---|
32 | #include"common.h"
|
---|
33 | #include"psicon.h"
|
---|
34 | #include"iconaction.h"
|
---|
35 |
|
---|
36 | class SeparatorAction : public IconAction
|
---|
37 | {
|
---|
38 | Q_OBJECT
|
---|
39 | public:
|
---|
40 | SeparatorAction(QObject *parent, const char *name = 0);
|
---|
41 | ~SeparatorAction();
|
---|
42 |
|
---|
43 | virtual bool addTo (QWidget *w);
|
---|
44 |
|
---|
45 | virtual IconAction *copy() const;
|
---|
46 |
|
---|
47 | private:
|
---|
48 | class Private;
|
---|
49 | Private *d;
|
---|
50 | };
|
---|
51 |
|
---|
52 | class SpacerAction : public IconAction
|
---|
53 | {
|
---|
54 | Q_OBJECT
|
---|
55 | public:
|
---|
56 | SpacerAction(QObject *parent, const char *name = 0);
|
---|
57 | ~SpacerAction();
|
---|
58 |
|
---|
59 | virtual bool addTo (QWidget *w);
|
---|
60 |
|
---|
61 | virtual IconAction *copy() const;
|
---|
62 | };
|
---|
63 |
|
---|
64 | class EventNotifierAction : public IconAction
|
---|
65 | {
|
---|
66 | Q_OBJECT
|
---|
67 | public:
|
---|
68 | EventNotifierAction(QObject *parent, const char *name = 0);
|
---|
69 | ~EventNotifierAction();
|
---|
70 |
|
---|
71 | void setText(const QString &);
|
---|
72 | bool addTo (QWidget *w);
|
---|
73 |
|
---|
74 | void hide();
|
---|
75 | void show();
|
---|
76 |
|
---|
77 | virtual IconAction *copy() const;
|
---|
78 | virtual EventNotifierAction &operator=( const EventNotifierAction & );
|
---|
79 |
|
---|
80 | signals:
|
---|
81 | void clicked(int);
|
---|
82 |
|
---|
83 | private slots:
|
---|
84 | void objectDestroyed ();
|
---|
85 |
|
---|
86 | private:
|
---|
87 | class Private;
|
---|
88 | Private *d;
|
---|
89 | };
|
---|
90 |
|
---|
91 | class PopupAction : public IconAction
|
---|
92 | {
|
---|
93 | Q_OBJECT
|
---|
94 | private:
|
---|
95 | class Private;
|
---|
96 | Private *d;
|
---|
97 |
|
---|
98 | private slots:
|
---|
99 | void objectDestroyed ();
|
---|
100 |
|
---|
101 | public slots:
|
---|
102 | void setEnabled (bool);
|
---|
103 |
|
---|
104 | public:
|
---|
105 | PopupAction (const QString &label, QPopupMenu *_menu, QObject *parent, const char *name);
|
---|
106 | void setSizePolicy (const QSizePolicy &p);
|
---|
107 | void setAlert (const Icon *);
|
---|
108 | void setIcon (const Icon *, bool showText = true, bool alert = false);
|
---|
109 | void setText (const QString &text);
|
---|
110 | bool addTo (QWidget *w);
|
---|
111 |
|
---|
112 | virtual IconAction *copy() const;
|
---|
113 | virtual PopupAction &operator=( const PopupAction & );
|
---|
114 | };
|
---|
115 |
|
---|
116 | class MLabel : public QLabel
|
---|
117 | {
|
---|
118 | Q_OBJECT
|
---|
119 | public:
|
---|
120 | MLabel(QWidget *parent=0, const char *name=0);
|
---|
121 |
|
---|
122 | protected:
|
---|
123 | // reimplemented
|
---|
124 | void mouseReleaseEvent(QMouseEvent *);
|
---|
125 | void mouseDoubleClickEvent(QMouseEvent *);
|
---|
126 |
|
---|
127 | signals:
|
---|
128 | void clicked(int);
|
---|
129 | void doubleClicked();
|
---|
130 | };
|
---|
131 |
|
---|
132 | class MTray : public QObject
|
---|
133 | {
|
---|
134 | Q_OBJECT
|
---|
135 | public:
|
---|
136 | MTray(const QString &tip, QPopupMenu *popup, QObject *parent=0);
|
---|
137 | ~MTray();
|
---|
138 |
|
---|
139 | void setToolTip(const QString &);
|
---|
140 | void setIcon(const Icon *, bool alert = false);
|
---|
141 | void setAlert(const Icon *);
|
---|
142 | bool isAnimating() const;
|
---|
143 |
|
---|
144 | bool isWMDock();
|
---|
145 |
|
---|
146 | signals:
|
---|
147 | void clicked(const QPoint &, int);
|
---|
148 | void doubleClicked(const QPoint &);
|
---|
149 | void closed();
|
---|
150 |
|
---|
151 | public slots:
|
---|
152 | void show();
|
---|
153 | void hide();
|
---|
154 |
|
---|
155 | private slots:
|
---|
156 | void animate();
|
---|
157 |
|
---|
158 | private:
|
---|
159 | class Private;
|
---|
160 | Private *d;
|
---|
161 | };
|
---|
162 |
|
---|
163 | class MAction : public IconAction
|
---|
164 | {
|
---|
165 | Q_OBJECT
|
---|
166 |
|
---|
167 | public:
|
---|
168 | MAction(Icon, const QString &, int id, PsiCon *, QObject *parent);
|
---|
169 | MAction(const QString &, int id, PsiCon *, QObject *parent);
|
---|
170 |
|
---|
171 | bool addTo(QWidget *w);
|
---|
172 |
|
---|
173 | virtual IconAction *copy() const;
|
---|
174 | virtual MAction &operator=( const MAction & );
|
---|
175 |
|
---|
176 | signals:
|
---|
177 | void activated(PsiAccount *, int);
|
---|
178 |
|
---|
179 | private slots:
|
---|
180 | void numAccountsChanged();
|
---|
181 | void itemActivated(int n);
|
---|
182 |
|
---|
183 | protected:
|
---|
184 | void addingToolButton(IconToolButton *);
|
---|
185 |
|
---|
186 | private:
|
---|
187 | class Private;
|
---|
188 | Private *d;
|
---|
189 |
|
---|
190 | void init (Icon, int id, PsiCon *psi);
|
---|
191 | };
|
---|
192 |
|
---|
193 | #endif
|
---|
194 |
|
---|