• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdeutils
  • Sitemap
  • Contact Us
 

ktimer

ktimer.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2001 Stefan Schimanski <1Stein@gmx.de>
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00017  */
00018 
00019 #ifndef KTIMER_H_INCLUDED
00020 #define KTIMER_H_INCLUDED
00021 
00022 #include <QDialog>
00023 #include <QWidget>
00024 #include <QProcess>
00025 #include "ui_prefwidget.h"
00026 
00027 class QTreeWidgetItem;
00028 class KConfig;
00029 
00030 class KTimerJob : public QObject {
00031  Q_OBJECT
00032 
00033  public:
00034     KTimerJob( QObject *parent=0);
00035     virtual ~KTimerJob();
00036 
00037     enum States { Stopped, Paused, Started };
00038 
00039     unsigned delay() const;
00040     QString command() const;
00041     bool loop() const;
00042     bool oneInstance() const;
00043     unsigned value() const;
00044     States state() const;
00045     void *user();
00046     void setUser( void *user );
00047 
00048     void load( KConfig *cfg, const QString& grp );
00049     void save( KConfig *cfg, const QString& grp );
00050 
00051  public slots:
00052     void setDelay( unsigned int sec );
00053     void setDelay( int sec );
00054     void setCommand( const QString &cmd );
00055     void setLoop( bool loop );
00056     void setOneInstance( bool one );
00057     void setValue( unsigned int value );
00058     void setValue( int value );
00059     void setState( States state );
00060 
00061     void pause();
00062     void stop();
00063     void start();
00064 
00065  signals:
00066     void stateChanged( KTimerJob *job, States state );
00067     void delayChanged( KTimerJob *job, unsigned int sec );
00068     void commandChanged( KTimerJob *job, const QString &cmd );
00069     void loopChanged( KTimerJob *job, bool loop );
00070     void oneInstanceChanged( KTimerJob *job, bool one );
00071     void valueChanged( KTimerJob *job, unsigned int value );
00072 
00073     void changed( KTimerJob *job );
00074     void fired( KTimerJob *job );
00075     void finished( KTimerJob *job, bool error );
00076     void error( KTimerJob *job );
00077 
00078  protected slots:
00079     virtual void fire();
00080 
00081  private slots:
00082     void timeout();
00083     void processExited(int, QProcess::ExitStatus);
00084 
00085  private:
00086     struct KTimerJobPrivate *d;
00087 };
00088 
00089 
00090 class KTimerPref : public QDialog, public Ui::PrefWidget
00091 {
00092     Q_OBJECT
00093  public:
00094     KTimerPref( QWidget *parent=0);
00095     virtual ~KTimerPref();
00096 
00097  protected slots:
00098     void add();
00099     void remove();
00100     void currentChanged( QTreeWidgetItem * , QTreeWidgetItem *);
00101 
00102     void saveJobs( KConfig *cfg );
00103     void loadJobs( KConfig *cfg );
00104 
00105  private slots:
00106     void jobChanged( KTimerJob *job );
00107     void jobFinished( KTimerJob *job, bool error );
00108 
00109  private:
00110     struct KTimerPrefPrivate *d;
00111 };
00112 
00113 #endif

ktimer

Skip menu "ktimer"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdelirc
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • kjots
  • klaptopdaemon
  • kmilo
  • ksim
  • ktimer
  • kwallet
  • superkaramba
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal