File indexing completed on 2024-12-01 03:47:21

0001 /***************************************************************************
0002                           ctimer.h  -  description
0003                              -------------------
0004     begin                : St maj 8 2003
0005     copyright            : (C) 2003 by Tomas Mecir
0006     email                : kmuddy@kmuddy.com
0007  ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *   This program is free software; you can redistribute it and/or modify  *
0012  *   it under the terms of the GNU General Public License as published by  *
0013  *   the Free Software Foundation; either version 2 of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  ***************************************************************************/
0017 
0018 #ifndef CTIMER_H
0019 #define CTIMER_H
0020 
0021 #include "csaveablefield.h"
0022 
0023 /**
0024 One timer.
0025   *@author Tomas Mecir
0026   */
0027 
0028 class cTimer : public cSaveableField  {
0029 public:
0030   cTimer (int _sess);
0031   ~cTimer () override;
0032 
0033   /** creates a new instance of the class */
0034   cSaveableField *newInstance () override;
0035 
0036   /** load data from a config file*/
0037   void load (KConfig *config, const QString &group) override;
0038 
0039   /** returns type of item (light-weight RTTI) */
0040   int itemType () override { return TYPE_TIMER; };
0041 
0042   void setInterval (int what);
0043   int interval () { return _interval; };
0044   void setSingleShot (bool what) { _singleshot = what; };
0045   bool singleShot () { return _singleshot; };
0046   void setActive (bool what) { _active = what; };
0047   bool active () { return _active; };
0048   void setCommand (const QString &what) { _command = what; };
0049   const QString &command () { return _command; };
0050 protected:
0051   int _interval;
0052  
0053   bool _singleshot, _active;
0054   QString _command;
0055 
0056   int sess;
0057 };
0058 
0059 #endif