source: psi/vendor/affinix/current/src/mainwin_p.h@ 2

Last change on this file since 2 was 2, checked in by dmik, 19 years ago

Imported original Psi 0.10 sources from Affinix

File size: 3.9 KB
Line 
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
36class SeparatorAction : public IconAction
37{
38 Q_OBJECT
39public:
40 SeparatorAction(QObject *parent, const char *name = 0);
41 ~SeparatorAction();
42
43 virtual bool addTo (QWidget *w);
44
45 virtual IconAction *copy() const;
46
47private:
48 class Private;
49 Private *d;
50};
51
52class SpacerAction : public IconAction
53{
54 Q_OBJECT
55public:
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
64class EventNotifierAction : public IconAction
65{
66 Q_OBJECT
67public:
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
80signals:
81 void clicked(int);
82
83private slots:
84 void objectDestroyed ();
85
86private:
87 class Private;
88 Private *d;
89};
90
91class PopupAction : public IconAction
92{
93 Q_OBJECT
94private:
95 class Private;
96 Private *d;
97
98private slots:
99 void objectDestroyed ();
100
101public slots:
102 void setEnabled (bool);
103
104public:
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
116class MLabel : public QLabel
117{
118 Q_OBJECT
119public:
120 MLabel(QWidget *parent=0, const char *name=0);
121
122protected:
123 // reimplemented
124 void mouseReleaseEvent(QMouseEvent *);
125 void mouseDoubleClickEvent(QMouseEvent *);
126
127signals:
128 void clicked(int);
129 void doubleClicked();
130};
131
132class MTray : public QObject
133{
134 Q_OBJECT
135public:
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
146signals:
147 void clicked(const QPoint &, int);
148 void doubleClicked(const QPoint &);
149 void closed();
150
151public slots:
152 void show();
153 void hide();
154
155private slots:
156 void animate();
157
158private:
159 class Private;
160 Private *d;
161};
162
163class MAction : public IconAction
164{
165 Q_OBJECT
166
167public:
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
176signals:
177 void activated(PsiAccount *, int);
178
179private slots:
180 void numAccountsChanged();
181 void itemActivated(int n);
182
183protected:
184 void addingToolButton(IconToolButton *);
185
186private:
187 class Private;
188 Private *d;
189
190 void init (Icon, int id, PsiCon *psi);
191};
192
193#endif
194
Note: See TracBrowser for help on using the repository browser.