KVIrc  4.9.2
DeveloperAPIs
KviCustomToolBarDescriptor.h
Go to the documentation of this file.
1 #ifndef _KVI_CUSTOMTOOLBARDESCRIPTOR_H_
2 #define _KVI_CUSTOMTOOLBARDESCRIPTOR_H_
3 //=============================================================================
4 //
5 // File : KviCustomToolBarDescriptor.h
6 // Creation date : Sun 05 Dec 2004 18:20:58 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 "KviQString.h"
29 #include "KviPointerList.h"
30 
31 class KviCustomToolBar;
33 class KviKvsScript;
34 
36 {
37  friend class KviCustomToolBar;
39 
40 protected:
41  KviCustomToolBarDescriptor(const QString & szId, const QString & szLabelCode);
42 
43 public:
45 
46 protected:
47  QString m_szId;
48  QString m_szIconId;
49  QString m_szParsedLabel;
55 
56 public:
57  const QString & iconId() { return m_szIconId; };
58  const QString & label();
59  const QString & labelCode();
60  const QString & id() { return m_szId; };
61  int internalId() { return m_iInternalId; }; // useful only for KviMainWindow
62  KviCustomToolBar * toolBar() { return m_pToolBar; };
63  KviCustomToolBar * createToolBar();
64  void setIconId(const QString & szIconId) { m_szIconId = szIconId; };
65  bool addAction(const QString & szAction);
66  bool removeAction(const QString & szAction);
67  bool removeAction(unsigned int iAction);
68  void clear();
69  void rename(const QString & szNewName);
70  KviPointerList<QString> * actions() { return m_pActions; };
71  void updateToolBar();
72 
73 protected:
74  void createLabelScript(const QString & szNewLabelCode);
75  void fillToolBar();
76  bool load(KviConfigurationFile * cfg);
77  void save(KviConfigurationFile * cfg);
78  void registerToolBar(KviCustomToolBar * t);
79  void unregisterToolBar(KviCustomToolBar * t);
80 };
81 
82 #endif //_KVI_CUSTOMTOOLBARDESCRIPTOR_H_
Definition: KviCustomToolBar.h:37
#define KVIRC_API
Definition: kvi_settings.h:128
The KVIrc Script class.
Definition: KviKvsScript.h:59
Definition: KviConfigurationFile.h:48
void load(const QString &szFileName)
Definition: KviCustomToolBarManager.cpp:192
static void removeAction(int idx)
Definition: KvsObject_popupMenu.cpp:190
const QString & id()
Definition: KviCustomToolBarDescriptor.h:60
int internalId()
Definition: KviCustomToolBarDescriptor.h:61
btnDict clear()
QString m_szIconId
Definition: KviCustomToolBarDescriptor.h:48
QString m_szParsedLabel
Definition: KviCustomToolBarDescriptor.h:49
KviPointerList< QString > * actions()
Definition: KviCustomToolBarDescriptor.h:70
bool save(KviThemeInfo &options, bool bSaveIcons)
Definition: KviOptions.cpp:986
int m_iInternalId
Definition: KviCustomToolBarDescriptor.h:52
KviCustomToolBar * m_pToolBar
Definition: KviCustomToolBarDescriptor.h:51
Definition: KviCustomToolBarManager.h:38
QHashIterator< int, QFile * > t(getDict)
C++ Template based double linked pointer list class.
Definition: KviCustomToolBarDescriptor.h:35
KviCustomToolBar * toolBar()
Definition: KviCustomToolBarDescriptor.h:62
KviPointerList< QString > * m_pActions
Definition: KviCustomToolBarDescriptor.h:50
KviKvsScript * m_pLabelScript
Definition: KviCustomToolBarDescriptor.h:54
QString m_szId
Definition: KviCustomToolBarDescriptor.h:47
This file contains compile time settings.
bool m_bVisibleAtStartup
Definition: KviCustomToolBarDescriptor.h:53
const QString & iconId()
Definition: KviCustomToolBarDescriptor.h:57
Helper functions for the QString class.
void setIconId(const QString &szIconId)
Definition: KviCustomToolBarDescriptor.h:64