File indexing completed on 2024-04-21 04:03:01

0001 /***************************************************************************
0002                           caction.h  -  action toolbar item
0003     This file is a part of KMuddy distribution.
0004                              -------------------
0005     begin                : Ne nov 3 2002
0006     copyright            : (C) 2002 by Tomas Mecir
0007     email                : kmuddy@kmuddy.com
0008  ***************************************************************************/
0009 
0010 /***************************************************************************
0011  *                                                                         *
0012  *   This program is free software; you can redistribute it and/or modify  *
0013  *   it under the terms of the GNU General Public License as published by  *
0014  *   the Free Software Foundation; either version 2 of the License, or     *
0015  *   (at your option) any later version.                                   *
0016  *                                                                         *
0017  ***************************************************************************/
0018 
0019 #ifndef CACTION_H
0020 #define CACTION_H
0021 
0022 #include "csaveablefield.h"
0023 
0024 #include <qstring.h>
0025 
0026 /**
0027 One action in the action toolbar.
0028 
0029   *@author Tomas Mecir
0030   */
0031 
0032 class cAction : public cSaveableField  {
0033 public: 
0034   cAction (int _sess);
0035   ~cAction () override;
0036   /** creates a new instance of the class; this is needed because I need to
0037   create instances of childclasses from within this class, but I don't know
0038   the exact type of that instance... */
0039   cSaveableField *newInstance () override;
0040 
0041   /** load data from a config file*/
0042   void load (KConfig *config, const QString &group) override;
0043 
0044   /** returns type of item (light-weight RTTI) */
0045   int itemType () override { return TYPE_ACTION; };
0046 
0047   void setCaption (const QString &s);
0048   QString getCaption ();
0049   void setCommand (const QString &s);
0050   QString getCommand ();
0051   void setCommand2 (const QString &s);
0052   QString getCommand2 ();
0053   void setPushDown (bool how);
0054   bool isPushDown ();
0055   void setIconName (const QString &s);
0056   QString getIconName ();
0057 
0058 protected:
0059   int sess;
0060   QString caption, command, command2;
0061   QString iconname;
0062   bool pushdown;
0063 };
0064 
0065 #endif