KVIrc  4.9.2
DeveloperAPIs
KviIrcView_tools.h
Go to the documentation of this file.
1 #ifndef _KVI_IRCVIEWTOOLS_H_
2 #define _KVI_IRCVIEWTOOLS_H_
3 //=============================================================================
4 //
5 // File : KviIrcView_tools.h
6 // Creation date : Sat Oct 9 2004 16:03:01 by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2004-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 
27 #include "kvi_settings.h"
28 #include "KviTalToolTip.h"
29 
30 #include <QFrame>
31 #include <QString>
32 #include <QTreeWidget>
33 #include <QCheckBox>
34 
35 class QLabel;
36 class QLineEdit;
37 class QComboBox;
38 class KviIrcView;
39 class QPushButton;
40 class QMenu;
41 
43 {
44 public:
46  virtual ~KviIrcViewToolTip();
47 
48 protected:
50 
51 protected:
52  virtual void maybeTip(const QPoint & pnt);
53 
54 public:
55  void doTip(const QRect & rct, const QString & str) { tip(rct, str); };
56 };
57 
58 //=========================================================================================================
59 // Item for the filter list view
60 //=========================================================================================================
61 
63 
64 class KviIrcMessageCheckListItem : public QTreeWidgetItem
65 {
66 public:
67  KviIrcMessageCheckListItem(QTreeWidget * par, KviIrcViewToolWidget * w, int id);
69 
70 private:
71  QCheckBox * m_pCbox;
72  int m_iId;
74 
75 public:
76  //void setToolWidget(KviIrcViewToolWidget * w){ m_pToolWidget = w; };
77  void setOn(bool b) { setCheckState(0, b ? Qt::Checked : Qt::Unchecked); };
78  bool isOn()
79  {
80  if(checkState(0) == Qt::Checked)
81  return true;
82  else
83  return false;
84  }
85 };
86 
87 //=========================================================================================================
88 // Search tools widget
89 //=========================================================================================================
90 
91 class KviIrcView;
92 
93 class KviIrcViewToolWidget : public QWidget
94 {
95  friend class KviIrcView;
96  Q_OBJECT
97 protected:
100 
101 protected:
103  QLineEdit * m_pStringToFind;
104  QPoint m_pressPoint;
105 
106  QCheckBox * m_pCaseSensitive;
107  QComboBox * m_pSearchMode;
109  QPushButton * m_pOptionsButton;
110 
111  // QLabel * m_pFindResult;
112 
113  QTreeWidget * m_pFilterView;
114 
116 
117 public:
119  {
123  };
124  void setFindResult(const QString & text);
125  void focusStringToFind();
126  inline bool messageEnabled(int msg_type) { return m_pFilterItems[msg_type]->isOn(); };
127  void forceRepaint();
128 protected slots:
129  void findPrev();
130  void findNext();
131  void findNextHelper(QString unused);
132  void filterEnableAll();
133  void filterEnableNone();
134  void filterSave();
135  void filterLoad();
136  void toggleOptions();
137 };
138 
139 #endif
QLineEdit * m_pStringToFind
Definition: KviIrcView_tools.h:103
Definition: KviIrcView_tools.h:120
int m_iId
Definition: KviIrcView_tools.h:72
KviIrcMessageCheckListItem ** m_pFilterItems
Definition: KviIrcView_tools.h:115
void findNextHelper(QString unused)
Definition: KviIrcView_tools.cpp:281
void filterEnableNone()
Definition: KviIrcView_tools.cpp:196
void findPrev()
Definition: KviIrcView_tools.cpp:275
virtual void tip(const QRect &rect, const QString &text)
Definition: KviTalToolTip.cpp:93
QTreeWidget * m_pFilterView
Definition: KviIrcView_tools.h:113
KviIrcViewToolTip(KviIrcView *pView)
Definition: KviIrcView_tools.cpp:297
void findNext()
Definition: KviIrcView_tools.cpp:287
KviIrcView * m_pView
Definition: KviIrcView_tools.h:49
void setFindResult(const QString &text)
Definition: KviIrcView_tools.cpp:270
bool isOn()
Definition: KviIrcView_tools.h:78
QPoint m_pressPoint
Definition: KviIrcView_tools.h:104
QCheckBox * m_pCaseSensitive
Definition: KviIrcView_tools.h:106
void setOn(bool b)
Definition: KviIrcView_tools.h:77
void filterSave()
Definition: KviIrcView_tools.cpp:230
QPushButton * m_pOptionsButton
Definition: KviIrcView_tools.h:109
KviIrcViewToolWidget(KviIrcView *par)
Definition: KviIrcView_tools.cpp:68
Definition: KviIrcView_tools.h:121
Definition: KviTalToolTip.h:53
void toggleOptions()
Definition: KviIrcView_tools.cpp:174
KviIrcMessageCheckListItem(QTreeWidget *par, KviIrcViewToolWidget *w, int id)
Definition: KviIrcView_tools.cpp:54
QMenu * m_pOptionsWidget
Definition: KviIrcView_tools.h:108
virtual void maybeTip(const QPoint &pnt)
Definition: KviIrcView_tools.cpp:306
virtual ~KviIrcViewToolTip()
bool messageEnabled(int msg_type)
Definition: KviIrcView_tools.h:126
void filterEnableAll()
Definition: KviIrcView_tools.cpp:190
void filterLoad()
Definition: KviIrcView_tools.cpp:202
Definition: KviIrcView_tools.h:42
SearchMode
Definition: KviIrcView_tools.h:118
Definition: KviIrcView.h:57
QCheckBox * m_pCbox
Definition: KviIrcView_tools.h:71
KviIrcViewToolWidget * m_pToolWidget
Definition: KviIrcView_tools.h:73
#define w
Definition: detector.cpp:87
void doTip(const QRect &rct, const QString &str)
Definition: KviIrcView_tools.h:55
QComboBox * m_pSearchMode
Definition: KviIrcView_tools.h:107
KviIrcView * m_pIrcView
Definition: KviIrcView_tools.h:102
Definition: KviIrcView_tools.h:64
void focusStringToFind()
Definition: KviIrcView_tools.cpp:254
~KviIrcViewToolWidget()
Definition: KviIrcView_tools.cpp:166
Definition: KviIrcView_tools.h:122
This file contains compile time settings.
void forceRepaint()
Definition: KviIrcView_tools.cpp:261
Definition: KviIrcView_tools.h:93