00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _KANYREMOTE_H_
00022 #define _KANYREMOTE_H_
00023
00024 #ifdef HAVE_CONFIG_H
00025 #include <config.h>
00026 #endif
00027
00028 #include <kmainwindow.h>
00029 #include <ksystemtray.h>
00030
00031 #define EXIT_OK 0
00032 #define EXIT_NOK -1
00033 #define EXIT_DISCON 2
00034 #define EXIT_ABORT 3
00035
00042 class KAnyRemoteTrayIcon: public KSystemTray
00043 {
00044 void mousePressEvent(QMouseEvent *e);
00045
00046 public:
00047 KPopupMenu* contextMenu() const { return KSystemTray::contextMenu(); }
00048 KActionCollection* actionCollection() { return KSystemTray::actionCollection(); }
00049
00050 KAnyRemoteTrayIcon(QWidget *parent = 0, const char *name = 0):
00051 KSystemTray(parent, name) {}
00052 };
00053
00054 class KAnyRemote : public KMainWindow
00055 {
00056 Q_OBJECT
00057
00058 public:
00059 QString cfgFileName;
00060 QString autoConnect;
00061
00062 KAnyRemoteTrayIcon *theTrayIcon;
00063 QTimer *theFlashOff;
00064 int theResetCount;
00065
00069 KAnyRemote();
00070
00071 KAnyRemote(bool a, bool b, int c, QString d, QString f);
00072
00076 virtual ~KAnyRemote();
00077
00078 void resetCfg();
00079
00080 void Connect();
00081 void SetCfgFile(QString &theFile);
00082
00083 private slots:
00084 void gotMessage(const QString &theButton);
00085 void resetCfgFromGui();
00086 void doQuit();
00087 void flashOff();
00088 void checkBluetooth();
00089 void checkData();
00090 void checkAlarms();
00091 void slotConfigure();
00092 void slotConnect();
00093
00094 private:
00095 void init(void);
00096 void loadFromConfig(void);
00097 void saveToConfig(void);
00098 void setPixmapsAndTooltips(int mode, QString t = QString::null);
00099 QPixmap* getPixmapByName(QString name, int size);
00100
00101 int menuItemConnectID;
00102 };
00103
00104 #endif // _KANYREMOTE_H_