KVIrc  4.9.2
DeveloperAPIs
OptionsWidget_textIcons.h
Go to the documentation of this file.
1 #ifndef _OPTW_TEXTICONS_H_
2 #define _OPTW_TEXTICONS_H_
3 //=============================================================================
4 //
5 // File : OptionsWidget_textIcons.h
6 // Creation date : Fri May 24 2002 00:14:02 CEST by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2002-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 "KviOptionsWidget.h"
28 #include "KviTextIconManager.h"
29 
30 #include <QTableWidget>
31 #include <QToolButton>
32 #include <QTableWidgetItem>
33 
34 class TextIconTableItem;
35 
36 #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_textIcons KviIconManager::BigGrin
37 #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_textIcons __tr2qs_no_lookup("Text Icons")
38 #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_textIcons OptionsWidget_tools
39 #define KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_textIcons __tr2qs_no_lookup("smileys,emoticons")
40 
41 class TextIconTableItem : public QTableWidgetItem
42 {
44 
45 public:
46  TextIconTableItem(QTableWidget * t, KviTextIcon * icon);
48 
49 protected:
51 
52 public:
54  {
55  return m_pIcon;
56  };
57  void setId(int id);
58 };
59 
61 {
62  Q_OBJECT
63 public:
64  OptionsWidget_textIcons(QWidget * parent);
66 
67 protected:
68  QTableWidget * m_pTable;
71  QPushButton * m_pAdd;
72  QPushButton * m_pDel;
73  QPushButton * m_pRestore;
74  QToolButton * m_pCurrentIconButton;
75  QMenu * m_pPopup;
76 
77 private:
78  void fillTable();
79 
80 public:
81  virtual void commit();
82 protected slots:
83  void itemSelectionChanged();
84  void currentItemChanged(QTableWidgetItem * cur, QTableWidgetItem * prev);
85  void addClicked();
86  void delClicked();
87  void restoreClicked();
88 
90  void doPopup();
91  void chooseFromFile();
92 };
93 
94 #endif
Definition: OptionsWidget_textIcons.h:60
KviTextIcon * icon()
Definition: OptionsWidget_textIcons.h:53
QTableWidget * m_pTable
Definition: OptionsWidget_textIcons.h:68
void restoreClicked()
Definition: OptionsWidget_textIcons.cpp:273
void doPopup()
Definition: OptionsWidget_textIcons.cpp:151
~TextIconTableItem()
Definition: OptionsWidget_textIcons.cpp:57
QToolButton * m_pCurrentIconButton
Definition: OptionsWidget_textIcons.h:74
virtual void commit()
Definition: OptionsWidget_textIcons.cpp:291
void fillTable()
Definition: OptionsWidget_textIcons.cpp:116
void addClicked()
Definition: OptionsWidget_textIcons.cpp:264
void chooseFromFile()
Definition: OptionsWidget_textIcons.cpp:187
void setId(int id)
Definition: OptionsWidget_textIcons.cpp:62
QPushButton * m_pRestore
Definition: OptionsWidget_textIcons.h:73
TextIconTableItem * m_pCurrentItem
Definition: OptionsWidget_textIcons.h:70
void delClicked()
Definition: OptionsWidget_textIcons.cpp:279
TextIconTableItem(QTableWidget *t, KviTextIcon *icon)
Definition: OptionsWidget_textIcons.cpp:45
Definition: KviOptionsWidget.h:40
void iconSelected(KviIconManager::SmallIcon)
Definition: OptionsWidget_textIcons.cpp:165
SmallIcon
Contains all KVIrc's small icons.
Definition: KviIconManager.h:168
void currentItemChanged(QTableWidgetItem *cur, QTableWidgetItem *prev)
Definition: OptionsWidget_textIcons.cpp:226
QPushButton * m_pAdd
Definition: OptionsWidget_textIcons.h:71
int m_iLastEditedRow
Definition: OptionsWidget_textIcons.h:69
QMenu * m_pPopup
Definition: OptionsWidget_textIcons.h:75
The class that holds the icons.
Definition: KviTextIconManager.h:60
QHashIterator< int, QFile * > t(getDict)
KviTextIcon * m_pIcon
Definition: OptionsWidget_textIcons.h:50
OptionsWidget_textIcons(QWidget *parent)
Definition: OptionsWidget_textIcons.cpp:70
QPushButton * m_pDel
Definition: OptionsWidget_textIcons.h:72
void itemSelectionChanged()
Definition: OptionsWidget_textIcons.cpp:220
Definition: OptionsWidget_textIcons.h:41