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