You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
134 lines
3.0 KiB
134 lines
3.0 KiB
15 years ago
|
/***************************************************************************
|
||
|
irkick.h - Interface of the main window
|
||
|
copyright : (C) 2002 by Gav Wood
|
||
|
email : gav@kde.org
|
||
|
|
||
|
***************************************************************************/
|
||
|
|
||
|
// This program is free software.
|
||
|
|
||
|
#ifdef HAVE_CONFIG_H
|
||
|
#include "config.h"
|
||
|
#endif
|
||
|
|
||
|
#ifndef __IRKICK_H
|
||
|
#define __IRKICK_H
|
||
|
|
||
14 years ago
|
#include <tqstring.h>
|
||
15 years ago
|
|
||
|
#include <ksystemtray.h>
|
||
|
#include <kdedmodule.h>
|
||
12 years ago
|
#include <tdeaboutdata.h>
|
||
15 years ago
|
|
||
|
#include <dcopobject.h>
|
||
|
|
||
|
#include "modes.h"
|
||
|
#include "iractions.h"
|
||
|
#include "klircclient.h"
|
||
|
|
||
14 years ago
|
class TQMouseEvent;
|
||
15 years ago
|
|
||
|
class IRKTrayIcon: public KSystemTray
|
||
|
{
|
||
14 years ago
|
void mousePressEvent(TQMouseEvent *e);
|
||
15 years ago
|
|
||
|
public:
|
||
12 years ago
|
TDEPopupMenu* contextMenu() const { return KSystemTray::contextMenu(); }
|
||
|
TDEActionCollection* actionCollection() { return KSystemTray::actionCollection(); }
|
||
15 years ago
|
|
||
13 years ago
|
IRKTrayIcon(TQWidget *parent = 0, const char *name = 0): KSystemTray(parent, name) {}
|
||
15 years ago
|
};
|
||
|
|
||
14 years ago
|
class IRKick: public TQObject, public DCOPObject
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
//
|
||
15 years ago
|
K_DCOP
|
||
|
|
||
14 years ago
|
TQString npApp, npModule, npMethod;
|
||
|
TQMap<TQString, TQString> currentModes;
|
||
|
TQMap<TQString, IRKTrayIcon *> currentModeIcons;
|
||
15 years ago
|
IRActions allActions;
|
||
|
int theResetCount;
|
||
|
Modes allModes;
|
||
|
|
||
|
IRKTrayIcon *theTrayIcon;
|
||
12 years ago
|
TDEAboutData *aboutData;
|
||
14 years ago
|
TQTimer *theFlashOff;
|
||
15 years ago
|
|
||
|
void updateModeIcons();
|
||
|
|
||
|
protected:
|
||
|
KLircClient *theClient;
|
||
|
|
||
|
k_dcop:
|
||
|
/**
|
||
|
* Query status of connection.
|
||
|
*
|
||
|
* @returns true if connected to lircd.
|
||
|
*/
|
||
|
virtual bool isConnected() { return theClient->isConnected(); }
|
||
|
|
||
|
/**
|
||
|
* Query status of remote list.
|
||
|
*
|
||
|
* Make sure this is true before calling remotes()/buttons(...).
|
||
|
*
|
||
|
* @returns true if up to date.
|
||
|
*/
|
||
|
virtual bool haveFullList() { return theClient->haveFullList(); }
|
||
|
|
||
|
/**
|
||
|
* Retrieve list of remote controls.
|
||
|
*
|
||
|
* @returns said list.
|
||
|
*/
|
||
14 years ago
|
virtual const TQStringList remotes() { return theClient->remotes(); }
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Retrieve list of buttons of a praticular remote control.
|
||
|
*
|
||
|
* @returns said list.
|
||
|
*/
|
||
14 years ago
|
virtual const TQStringList buttons(TQString theRemote) { return theClient->buttons(theRemote); }
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Sends next keypress to given application by DCOP.
|
||
|
*
|
||
|
* @param The receiving application.
|
||
|
* @param The receiving application module.
|
||
14 years ago
|
* @param The method name. Must have two TQString parameters.
|
||
15 years ago
|
*/
|
||
14 years ago
|
virtual void stealNextPress(TQString app, TQString module, TQString method);
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Cancels the proceedings of the previous stealNextPress call, if any.
|
||
|
*/
|
||
|
virtual void dontStealNextPress();
|
||
|
|
||
|
/**
|
||
|
* Reloads configuration from file(s)
|
||
|
*/
|
||
|
virtual void reloadConfiguration() { slotReloadConfiguration(); }
|
||
|
|
||
|
private slots:
|
||
14 years ago
|
void gotMessage(const TQString &theRemote, const TQString &theButton, int theRepeatCounter);
|
||
15 years ago
|
void resetModes();
|
||
|
void doQuit();
|
||
|
void flashOff();
|
||
|
void checkLirc();
|
||
|
|
||
|
void slotConfigure();
|
||
|
void slotReloadConfiguration();
|
||
|
void slotClosed();
|
||
|
private:
|
||
|
void executeAction(const IRAction &action);
|
||
14 years ago
|
bool getPrograms(const IRAction &action, TQStringList &populous);
|
||
15 years ago
|
|
||
|
public:
|
||
14 years ago
|
IRKick(const TQCString &obj);
|
||
15 years ago
|
virtual ~IRKick();
|
||
|
};
|
||
|
|
||
|
#endif
|