KVIrc  4.9.2
DeveloperAPIs
NotifierWindowBorder.h
Go to the documentation of this file.
1 #ifndef _KVINOTIFIERWINDOWBORDER_H_
2 #define _KVINOTIFIERWINDOWBORDER_H_
3 //=============================================================================
4 //
5 // File : NotifierWindowBorder.h
6 // Creation date : Mon 03 Jan 2005 02:27:22 by Iacopo Palazzi
7 //
8 // This file is part of the KVIrc distribution
9 // Copyright (C) 2005-2008 Iacopo Palazzi < iakko(at)siena(dot)linux(dot)it >
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
27 #include "NotifierSettings.h"
28 
29 #include <QSize>
30 #include <QRect>
31 #include <QPixmap>
32 
33 class QPainter;
34 
36 {
37 public:
40 
41  // ================================
42  // Put members declaration below...
43  // ================================
44 private:
45  QRect m_rct;
46  QPoint m_pnt;
47 
49 
51  QRect m_bodyRect;
52  QRect m_titleRect;
53 
54  // Pictures
55  QPixmap * m_pixSX;
56  QPixmap * m_pixDX;
57  QPixmap * m_pixDWN;
58  QPixmap * m_pixDWNSX;
59  QPixmap * m_pixDWNDX;
60  QPixmap * m_pixCaptionSX;
61  QPixmap * m_pixCaptionDX;
62  QPixmap * m_pixCaptionBKG;
63  QPixmap * m_pixIconClose_out;
66  QPixmap * m_pixIconClose;
67 
68  QPixmap m_pixSX_N;
69  QPixmap m_pixDX_N;
70  QPixmap m_pixDWN_N;
71  QPixmap m_pixDWNSX_N;
72  QPixmap m_pixDWNDX_N;
79 
80  QPixmap m_pixSX_HL;
81  QPixmap m_pixDX_HL;
82  QPixmap m_pixDWN_HL;
83  QPixmap m_pixDWNSX_HL;
84  QPixmap m_pixDWNDX_HL;
91 
95 
96 private:
97  void loadImages();
98  void recalculatePositions();
99 
100 public:
101  // reading methods...
102  void setWidth(int w);
103  void setHeight(int h);
104  void resize(int w, int h)
105  {
106  setWidth(w);
107  setHeight(h);
108  };
109  void resize(QSize r)
110  {
111  setWidth(r.width());
112  setHeight(r.height());
113  };
114  void setGeometry(QRect r)
115  {
116  r.topLeft();
117  r.size(); /*qDebug("x,y: %d,%d", r.x(), r.y()); qDebug("w,h: %d,%d", r.width(), r.height());*/
118  };
119  void setGeometry(QPoint p, QSize s)
120  {
121  setPoint(p.x(), p.y());
122  setWidth(s.width());
123  setHeight(s.height());
124  };
125 
126  void setPoint(int x, int y)
127  {
128  m_pnt.setX(x);
129  m_pnt.setY(y);
130  m_rct.setX(x);
131  m_rct.setY(y);
132  };
133 
134  void setCloseIcon(int state);
135  void resetIcons();
136 
137  // writing methods...
138  inline int x() const { return m_pnt.x(); };
139  inline int y() const { return m_pnt.y(); };
140  inline int width() const { return m_rct.width(); };
141  inline int height() const { return m_rct.height(); };
142  inline int baseLine() const { return (y() + height()); };
143 
144  inline QRect bodyRect() const { return m_bodyRect; };
145  inline QRect captionRect() const { return m_captionRect; };
146  inline QRect rect() const { return m_rct; };
147  inline QRect closeRect() const { return m_closeIconRect; };
148  inline QRect titleRect() const { return m_titleRect; };
149 
150  void draw(QPainter *, bool b = false);
151  void setPics(bool b = false);
152 };
153 
154 #endif
QPixmap * m_pixDWNDX
Definition: NotifierWindowBorder.h:59
Definition: NotifierWindowBorder.h:35
QPixmap m_pixDWNSX_HL
Definition: NotifierWindowBorder.h:83
QRect closeRect() const
Definition: NotifierWindowBorder.h:147
QPixmap m_pixIconClose_clicked_HL
Definition: NotifierWindowBorder.h:90
void setPoint(int x, int y)
Definition: NotifierWindowBorder.h:126
QPixmap m_pixIconClose_over_HL
Definition: NotifierWindowBorder.h:89
QPixmap * m_pixIconClose_over
Definition: NotifierWindowBorder.h:64
#define WDG_MIN_HEIGHT
Definition: NotifierSettings.h:30
QPixmap * m_pixIconClose_out
Definition: NotifierWindowBorder.h:63
QPixmap m_pixDWNDX_HL
Definition: NotifierWindowBorder.h:84
QPixmap m_pixDWN_N
Definition: NotifierWindowBorder.h:70
void setPics(bool b=false)
Definition: NotifierWindowBorder.cpp:104
#define WDG_MIN_WIDTH
Definition: NotifierSettings.h:29
QPixmap m_pixCaptionBKG_HL
Definition: NotifierWindowBorder.h:87
QRect rect() const
Definition: NotifierWindowBorder.h:146
QPoint m_pnt
Definition: NotifierWindowBorder.h:46
QPixmap m_pixSX_N
Definition: NotifierWindowBorder.h:68
QPixmap * m_pixIconClose_clicked
Definition: NotifierWindowBorder.h:65
void setCloseIcon(int state)
Definition: NotifierWindowBorder.cpp:169
void setWidth(int w)
Definition: NotifierWindowBorder.cpp:136
void resize(int w, int h)
Definition: NotifierWindowBorder.h:104
QPixmap m_pixIconClose_over_N
Definition: NotifierWindowBorder.h:77
QRect captionRect() const
Definition: NotifierWindowBorder.h:145
QPixmap * m_pixDWNSX
Definition: NotifierWindowBorder.h:58
QPixmap * m_pixDX
Definition: NotifierWindowBorder.h:56
QPixmap m_pixDX_N
Definition: NotifierWindowBorder.h:69
QPixmap m_pixCaptionDX_HL
Definition: NotifierWindowBorder.h:86
QRect m_closeIconRect
Definition: NotifierWindowBorder.h:48
#define h
Definition: detector.cpp:72
char s char s s
Definition: KviIrcNumericCodes.h:391
QPixmap m_pixSX_HL
Definition: NotifierWindowBorder.h:80
QPixmap * m_pixCaptionDX
Definition: NotifierWindowBorder.h:61
int width() const
Definition: NotifierWindowBorder.h:140
QPixmap m_pixCaptionSX_HL
Definition: NotifierWindowBorder.h:85
void draw(QPainter *, bool b=false)
Definition: NotifierWindowBorder.cpp:191
int height() const
Definition: NotifierWindowBorder.h:141
QPixmap m_pixDWN_HL
Definition: NotifierWindowBorder.h:82
QPixmap m_pixIconClose_out_N
Definition: NotifierWindowBorder.h:76
QPixmap * m_pixIconClose
Definition: NotifierWindowBorder.h:66
int baseLine() const
Definition: NotifierWindowBorder.h:142
void resetIcons()
Definition: NotifierWindowBorder.cpp:186
QRect m_titleRect
Definition: NotifierWindowBorder.h:52
int y() const
Definition: NotifierWindowBorder.h:139
QRect m_rct
Definition: NotifierWindowBorder.h:45
#define r
Definition: detector.cpp:82
QPixmap m_pixDWNDX_N
Definition: NotifierWindowBorder.h:72
int m_iRctWidth
Definition: NotifierWindowBorder.h:93
QPixmap * m_pixDWN
Definition: NotifierWindowBorder.h:57
QPixmap m_pixCaptionBKG_N
Definition: NotifierWindowBorder.h:75
void setHeight(int h)
Definition: NotifierWindowBorder.cpp:142
#define w
Definition: detector.cpp:87
int m_eIconState
Definition: NotifierWindowBorder.h:92
QPixmap m_pixDWNSX_N
Definition: NotifierWindowBorder.h:71
QRect titleRect() const
Definition: NotifierWindowBorder.h:148
QPixmap m_pixCaptionDX_N
Definition: NotifierWindowBorder.h:74
QPixmap * m_pixSX
Definition: NotifierWindowBorder.h:55
void resize(QSize r)
Definition: NotifierWindowBorder.h:109
int x() const
Definition: NotifierWindowBorder.h:138
QRect m_captionRect
Definition: NotifierWindowBorder.h:50
QPixmap * m_pixCaptionBKG
Definition: NotifierWindowBorder.h:62
void setGeometry(QPoint p, QSize s)
Definition: NotifierWindowBorder.h:119
QPixmap m_pixCaptionSX_N
Definition: NotifierWindowBorder.h:73
void setGeometry(QRect r)
Definition: NotifierWindowBorder.h:114
QPixmap m_pixIconClose_out_HL
Definition: NotifierWindowBorder.h:88
QRect m_bodyRect
Definition: NotifierWindowBorder.h:51
void loadImages()
Definition: NotifierWindowBorder.cpp:41
QPixmap m_pixIconClose_clicked_N
Definition: NotifierWindowBorder.h:78
int m_iRctHeight
Definition: NotifierWindowBorder.h:94
QPixmap * m_pixCaptionSX
Definition: NotifierWindowBorder.h:60
NotifierWindowBorder(QSize=QSize(WDG_MIN_WIDTH, WDG_MIN_HEIGHT))
Definition: NotifierWindowBorder.cpp:32
void recalculatePositions()
Definition: NotifierWindowBorder.cpp:148
#define p
Definition: detector.cpp:80
QPixmap m_pixDX_HL
Definition: NotifierWindowBorder.h:81
QRect bodyRect() const
Definition: NotifierWindowBorder.h:144