KVIrc  4.9.2
DeveloperAPIs
KviKvsUserAction.h
Go to the documentation of this file.
1 #ifndef _KVI_KVS_USERACTION_H_
2 #define _KVI_KVS_USERACTION_H_
3 //=============================================================================
4 //
5 // File : KviKvsUserAction.h
6 // Creation date : Tue 07 Dec 2004 02:00:24 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 "KviKvsAction.h"
29 
31 class KviKvsScript;
32 
34 {
35  friend class KviActionManager;
36  Q_OBJECT
37 public:
39  QObject * pParent,
40  const QString & szName,
41  const QString & szScriptCode,
42  const QString & szVisibleNameCode,
43  const QString & szDescriptionCode,
44  const QString & szCategory,
45  const QString & szBigIconId,
46  const QString & szSmallIconId,
47  unsigned int uFlags,
48  const QString & szKeySequence = QString());
49  KviKvsUserAction(QObject * pParent);
51 
52  // Static allocator function.
53  // This MUST be used by the modules to allocate action structures
54  // instead of the new operator.
55  // See KviHeapObject.cpp for an explanation.
56  static KviKvsUserAction * createInstance(
57  QObject * pParent,
58  const QString & szName,
59  const QString & szScriptCode,
60  const QString & szVisibleNameCode,
61  const QString & szDescriptionCode,
62  const QString & szCategory,
63  const QString & szBigIconId,
64  const QString & szSmallIcon,
65  unsigned int uFlags,
66  const QString & szKeySequence = QString());
67  void suicide() { delete this; };
68 protected:
69  QString m_szCategory;
72 
73 protected:
74  virtual bool isKviUserActionNeverOverrideThis();
75  bool load(KviConfigurationFile * pCfg);
76  void save(KviConfigurationFile * pCfg);
77 
78 public:
79  virtual const QString & visibleName();
80  virtual const QString & description();
81  const QString & visibleNameCode();
82  const QString & descriptionCode();
83  const QString & category() { return m_szCategory; };
84  static void exportToKvs(
85  QString & szBuffer,
86  const QString & szName,
87  const QString & szScriptCode,
88  const QString & szVisibleName,
89  const QString & szDescription,
90  const QString & szCategory,
91  const QString & szBigIcon,
92  const QString & szSmallIcon,
93  unsigned int uFlags,
94  const QString & szKeySequence);
95  void exportToKvs(QString & szBuffer);
96 };
97 
98 #endif // _KVI_KVS_USERACTION_H_
Definition: KviKvsUserAction.h:33
KviKvsScript * m_pVisibleNameScript
Definition: KviKvsUserAction.h:71
void load(const QString &szFileName)
Definition: KviActionManager.cpp:92
#define KVIRC_API
Definition: kvi_settings.h:128
The KVIrc Script class.
Definition: KviKvsScript.h:59
Definition: KviConfigurationFile.h:48
virtual bool isKviUserActionNeverOverrideThis()
Returns true if the action is user-defined.
Definition: KviAction.cpp:103
virtual const QString & visibleName()
Returns the visible name of the action.
Definition: KviAction.cpp:93
KviKvsScript * m_pDescriptionScript
Definition: KviKvsUserAction.h:70
Definition: KviActionManager.h:36
const QString & category()
Definition: KviKvsUserAction.h:83
bool save(KviThemeInfo &options, bool bSaveIcons)
Definition: KviOptions.cpp:986
virtual const QString & description()
Returns the description of the action.
Definition: KviAction.cpp:98
void suicide()
Definition: KviKvsUserAction.h:67
char szBuffer[4096]
Definition: winamp.cpp:77
This file contains compile time settings.
Actions handling.
This class handles the actions.
Definition: KviKvsAction.h:43