KVIrc  4.9.2
DeveloperAPIs
ChannelsJoinDialog.h
Go to the documentation of this file.
1 #ifndef _CHANNELSJOIN_H_
2 #define _CHANNELSJOIN_H_
3 //=============================================================================
4 //
5 // File : ChannelsJoinDialog.h
6 // Creation date : Thu Nov 06 2001 12:30:25 CEST by Juan Alvarez
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net)
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 "KviWindow.h"
34 #include "KviCString.h"
35 
36 #include <QTreeWidget>
37 #include <QDialog>
38 #include <QMenu>
39 
40 class QCheckBox;
41 class QPushButton;
42 class QLineEdit;
43 class KviConsoleWindow;
44 class KviTalGroupBox;
45 
50 class ChannelsJoinDialogTreeWidget : public QTreeWidget
51 {
52  Q_OBJECT
53 public:
55  : QTreeWidget(par), m_pJoinPopup(0){};
56 
58  {
59  if(m_pJoinPopup)
60  delete m_pJoinPopup;
61  };
62 
63 protected:
64  QMenu * m_pJoinPopup;
70  virtual void mousePressEvent(QMouseEvent * e);
71  virtual void mouseDoubleClickEvent(QMouseEvent * e);
72 };
73 
78 class ChannelsJoinDialog : public QDialog
79 {
80  Q_OBJECT
82 
83 public:
89  ChannelsJoinDialog(const char * name);
90 
95 
96 protected:
97  enum ItemTypes
98  {
102  };
103  QLineEdit * m_pChannelEdit;
106  QLineEdit * m_pPass;
109  QPushButton * m_pJoinButton;
110  QPushButton * m_pRegButton;
111  QPushButton * m_pClearButton;
113 
114 public:
115  virtual void closeEvent(QCloseEvent * e);
116 
121  void fillListView();
122 
127  void enableJoin();
128 
134  void setConsole(KviConsoleWindow * pConsole);
135 
140  void itemSelected();
141 protected slots:
146  void editTextChanged(const QString &);
147 
154  void editReturnPressed();
155 
162  void cancelClicked();
163 
170  void joinClicked();
171 
178  void deleteClicked();
179 
186  void regClicked();
187 
194  void clearClicked();
195 
196  //void whoClicked();
197  //void namesClicked();
198 };
199 
200 #endif //_CHANNELSJOINSWINDOW_H_
QCheckBox * m_pShowAtStartupCheck
Definition: ChannelsJoinDialog.h:107
~ChannelsJoinDialogTreeWidget()
Definition: ChannelsJoinDialog.h:57
QPushButton * m_pJoinButton
Definition: ChannelsJoinDialog.h:109
KviConsoleWindow * m_pConsole
Definition: ChannelsJoinDialog.h:112
Definition: KviConsoleWindow.h:75
void fillListView()
Fills in the servers' list.
Definition: ChannelsJoinDialog.cpp:150
Definition: ChannelsJoinDialog.h:99
void editReturnPressed()
Called when the return is pressed.
Definition: ChannelsJoinDialog.cpp:456
virtual void mouseDoubleClickEvent(QMouseEvent *e)
Definition: ChannelsJoinDialog.cpp:273
Channels join window tree widget.
Definition: ChannelsJoinDialog.h:50
virtual void mousePressEvent(QMouseEvent *e)
Called when the user clicks on the list.
Definition: ChannelsJoinDialog.cpp:236
QPushButton * m_pRegButton
Definition: ChannelsJoinDialog.h:110
void setConsole(KviConsoleWindow *pConsole)
Sets the console and fills in the servers' list.
Definition: ChannelsJoinDialog.cpp:144
Definition: ChannelsJoinDialog.h:100
ChannelsJoinDialogTreeWidget(QWidget *par)
Definition: ChannelsJoinDialog.h:54
#define e
Definition: detector.cpp:69
QLineEdit * m_pPass
Definition: ChannelsJoinDialog.h:106
QLineEdit * m_pChannelEdit
Definition: ChannelsJoinDialog.h:103
QMenu * m_pJoinPopup
Definition: ChannelsJoinDialog.h:61
Definition: ChannelsJoinDialog.h:101
void editTextChanged(const QString &)
Called when the text changes.
Definition: ChannelsJoinDialog.cpp:301
void joinClicked()
Called when the join button is pressed.
Definition: ChannelsJoinDialog.cpp:379
Channels join window class.
Definition: ChannelsJoinDialog.h:78
Toolkit Abstraction Layer: groupbox class.
Definition: KviTalGroupBox.h:43
KviTalGroupBox * m_pGroupBox
Definition: ChannelsJoinDialog.h:105
virtual void closeEvent(QCloseEvent *e)
Definition: ChannelsJoinDialog.cpp:461
QString name()
Definition: KviRuntimeInfo.cpp:655
ChannelsJoinDialog(const char *name)
Constructs the channels join window.
Definition: ChannelsJoinDialog.cpp:57
Contains the KviWindow class.
void itemSelected()
Called when the user choose an item from the list.
Definition: ChannelsJoinDialog.cpp:288
~ChannelsJoinDialog()
Destroys the channels join window.
Definition: ChannelsJoinDialog.cpp:136
void clearClicked()
Called when the clear button is pressed.
Definition: ChannelsJoinDialog.cpp:440
void regClicked()
Called when the register button is pressed.
Definition: ChannelsJoinDialog.cpp:409
ItemTypes
Definition: ChannelsJoinDialog.h:97
QCheckBox * m_pCloseAfterJoinCheck
Definition: ChannelsJoinDialog.h:108
ChannelsJoinDialogTreeWidget * m_pTreeWidget
Definition: ChannelsJoinDialog.h:104
void cancelClicked()
Called when the cancel button is pressed.
Definition: ChannelsJoinDialog.cpp:331
void enableJoin()
Enables join and register button if channel is found.
Definition: ChannelsJoinDialog.cpp:306
QPushButton * m_pClearButton
Definition: ChannelsJoinDialog.h:111
void deleteClicked()
Called when the delete button is pressed.
Definition: ChannelsJoinDialog.cpp:336