KVIrc 5.2.0
Developer APIs
NotifierWindowTab.h
Go to the documentation of this file.
1#ifndef _KVINOTIFIERWINDOWTAB_H_
2#define _KVINOTIFIERWINDOWTAB_H_
3//=============================================================================
4//
5// File : NotifierWindowTab.h
6// Creation date : Tue 07 Jul 2009 10:28 by Fabio Bas
7//
8// This file is part of the KVIrc distribution
9// Copyright (C) 2009 Fabio Bas < ctrlaltca at gmail dot com >
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
33#include "NotifierMessage.h"
34
35#include "kvi_settings.h"
36
37#include <QScrollArea>
38
39class KviWindow;
40class QPainter;
41class QTabWidget;
42class QVBoxLayout;
43class QWidget;
44
49class NotifierWindowTab : public QScrollArea
50{
51 Q_OBJECT
52public:
59 NotifierWindowTab(KviWindow * pWnd, QTabWidget * pParent);
60
65
66private:
67 QString m_szLabel;
68 KviWindow * m_pWnd = nullptr;
69 QTabWidget * m_pParent = nullptr;
70 QVBoxLayout * m_pVBox = nullptr;
71 QWidget * m_pVWidget = nullptr;
72
73public:
79 void appendMessage(NotifierMessage * pMessage);
80
85 void updateGui();
86
91 QString label() const { return m_szLabel; }
92
97 KviWindow * wnd() const { return m_pWnd; }
98protected:
99 void mouseDoubleClickEvent(QMouseEvent * e) override;
100 void resizeEvent(QResizeEvent * e) override;
101 void paintEvent(QPaintEvent * e) override;
102private slots:
107 void scrollRangeChanged(int, int);
108
113 void labelChanged();
114
119 void closeMe();
120};
121
122#endif
Base class for all windows in KVIrc.
Definition KviWindow.h:75
A single message in a notifier window.
Definition NotifierMessage.h:44
Defines an object for every single tab about the tabs area.
Definition NotifierWindowTab.h:50
QVBoxLayout * m_pVBox
Definition NotifierWindowTab.h:70
void updateGui()
Updates the GUI.
Definition NotifierWindowTab.cpp:112
void resizeEvent(QResizeEvent *e) override
Definition NotifierWindowTab.cpp:173
void mouseDoubleClickEvent(QMouseEvent *e) override
Definition NotifierWindowTab.cpp:141
void paintEvent(QPaintEvent *e) override
Definition NotifierWindowTab.cpp:184
QString label() const
Returns the name of the current window.
Definition NotifierWindowTab.h:91
KviWindow * wnd() const
Returns the pointer of the current window.
Definition NotifierWindowTab.h:97
QString m_szLabel
Definition NotifierWindowTab.h:67
void labelChanged()
Emitted when the window changes its name.
Definition NotifierWindowTab.cpp:130
QWidget * m_pVWidget
Definition NotifierWindowTab.h:71
KviWindow * m_pWnd
Definition NotifierWindowTab.h:68
void appendMessage(NotifierMessage *pMessage)
Appends the given message to the window.
Definition NotifierWindowTab.cpp:98
QTabWidget * m_pParent
Definition NotifierWindowTab.h:69
void scrollRangeChanged(int, int)
Emitted when the scrollbar range is changed.
Definition NotifierWindowTab.cpp:123
~NotifierWindowTab()
Destroys the tab object.
Definition NotifierWindowTab.cpp:90
void closeMe()
Emitted when the window is being destroyed.
Definition NotifierWindowTab.cpp:162
#define e
Definition detector.cpp:70
This file contains compile time settings.