kanyremote.h

00001 /***************************************************************************
00002  *   Copyright (C) 2006 by M.Fedotov   *
00003  *   mo_fedotov@mail.ru   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
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_

Generated on Sat Apr 29 12:37:08 2006 for kanyremote.kdevelop by  doxygen 1.4.6