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.
191 lines
5.8 KiB
191 lines
5.8 KiB
15 years ago
|
/***************************************************************************
|
||
|
docking.h - description
|
||
|
-------------------
|
||
|
begin : Mon Jan 14 2002
|
||
|
copyright : (C) 2001, 2002 by Frank Schwanz, Ernst Martin Witte
|
||
|
email : schwanz@fh-brandenburg.de, witte@kawo1.rwth-aachen.de
|
||
|
***************************************************************************/
|
||
|
|
||
|
/***************************************************************************
|
||
|
* *
|
||
|
* This program is free software; you can redistribute it and/or modify *
|
||
|
* it under the terms of the GNU General Public License as published by *
|
||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||
|
* (at your option) any later version. *
|
||
|
* *
|
||
|
***************************************************************************/
|
||
|
|
||
|
#ifndef KRADIO_DOCKING_H
|
||
|
#define KRADIO_DOCKING_H
|
||
|
|
||
|
#ifdef HAVE_CONFIG_H
|
||
|
#include <config.h>
|
||
|
#endif
|
||
|
|
||
|
#include <ksystemtray.h>
|
||
14 years ago
|
#include <tqpixmap.h>
|
||
|
#include <tqptrdict.h>
|
||
15 years ago
|
|
||
|
#include "../../src/include/timecontrol_interfaces.h"
|
||
|
#include "../../src/include/radio_interfaces.h"
|
||
|
#include "../../src/include/radiodevicepool_interfaces.h"
|
||
|
#include "../../src/include/stationselection_interfaces.h"
|
||
|
#include "../../src/include/plugins.h"
|
||
|
#include "../../src/include/soundstreamclient_interfaces.h"
|
||
|
|
||
|
enum LeftClickAction { lcaShowHide = 0, lcaPowerOnOff = 1 };
|
||
|
|
||
|
class RadioDocking : public KSystemTray,
|
||
|
public PluginBase,
|
||
|
public IRadioClient,
|
||
|
public ITimeControlClient,
|
||
|
public IRadioDevicePoolClient,
|
||
|
public IStationSelection,
|
||
|
public ISoundStreamClient
|
||
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
14 years ago
|
RadioDocking (const TQString &name);
|
||
15 years ago
|
virtual ~RadioDocking();
|
||
|
|
||
|
virtual bool connectI (Interface *);
|
||
|
virtual bool disconnectI (Interface *);
|
||
|
|
||
14 years ago
|
virtual TQString pluginClassName() const { return "RadioDocking"; }
|
||
15 years ago
|
|
||
14 years ago
|
virtual const TQString &name() const { return PluginBase::name(); }
|
||
|
virtual TQString &name() { return PluginBase::name(); }
|
||
15 years ago
|
|
||
|
|
||
|
// PluginBase
|
||
|
|
||
|
public:
|
||
12 years ago
|
virtual void saveState (TDEConfig *) const;
|
||
|
virtual void restoreState (TDEConfig *);
|
||
15 years ago
|
|
||
|
virtual ConfigPageInfo createConfigurationPage();
|
||
|
virtual AboutPageInfo createAboutPage();
|
||
|
|
||
|
|
||
|
// IStationSelection
|
||
|
|
||
|
RECEIVERS:
|
||
14 years ago
|
bool setStationSelection(const TQStringList &sl);
|
||
15 years ago
|
|
||
|
ANSWERS:
|
||
14 years ago
|
const TQStringList & getStationSelection () const { return m_stationIDs; }
|
||
15 years ago
|
|
||
|
|
||
|
// IRadioDevicePoolClient
|
||
|
|
||
|
RECEIVERS:
|
||
|
bool noticeActiveDeviceChanged(IRadioDevice *) { return false; }
|
||
14 years ago
|
bool noticeDevicesChanged(const TQPtrList<IRadioDevice> &) { return false; }
|
||
|
bool noticeDeviceDescriptionChanged(const TQString &) { return false; }
|
||
15 years ago
|
|
||
|
// ITimeControlClient
|
||
|
|
||
|
RECEIVERS:
|
||
|
bool noticeAlarmsChanged(const AlarmVector &) { return false; }
|
||
|
bool noticeAlarm(const Alarm &) { return false; }
|
||
|
bool noticeNextAlarmChanged(const Alarm *);
|
||
14 years ago
|
bool noticeCountdownStarted(const TQDateTime &/*end*/);
|
||
15 years ago
|
bool noticeCountdownStopped();
|
||
|
bool noticeCountdownZero();
|
||
|
bool noticeCountdownSecondsChanged(int n);
|
||
|
|
||
|
|
||
|
// IRadioClient
|
||
|
|
||
|
RECEIVERS:
|
||
|
bool noticePowerChanged(bool on);
|
||
|
bool noticeStationChanged (const RadioStation &, int idx);
|
||
|
bool noticeStationsChanged(const StationList &sl);
|
||
14 years ago
|
bool noticePresetFileChanged(const TQString &/*f*/) { return false; }
|
||
15 years ago
|
|
||
|
bool noticeCurrentSoundStreamIDChanged(SoundStreamID /*id*/) { return false; }
|
||
|
|
||
|
// ISoundStreamClient
|
||
|
|
||
|
RECEIVERS:
|
||
|
void noticeConnectedI (ISoundStreamServer *s, bool pointer_valid);
|
||
|
|
||
|
bool startRecordingWithFormat(SoundStreamID /*id*/,
|
||
|
const SoundFormat &/*proposed_format*/,
|
||
|
SoundFormat &/*real_format*/);
|
||
|
bool stopRecording(SoundStreamID /*id*/);
|
||
|
|
||
|
bool noticeSoundStreamChanged(SoundStreamID id);
|
||
|
|
||
|
|
||
|
protected slots:
|
||
|
|
||
|
void slotSeekFwd();
|
||
|
void slotSeekBkwd();
|
||
|
|
||
|
void slotPower();
|
||
|
void slotPause();
|
||
|
void slotSleepCountdown();
|
||
|
void slotShowAbout();
|
||
|
|
||
|
void slotMenuItemActivated(int id);
|
||
|
void slotRecordingMenu(int i);
|
||
|
|
||
|
protected:
|
||
14 years ago
|
void mousePressEvent( TQMouseEvent *e );
|
||
15 years ago
|
|
||
|
void buildContextMenu();
|
||
|
void buildRecordingMenu();
|
||
|
void buildStationList();
|
||
|
|
||
|
void noticeWidgetPluginShown(WidgetPluginBase *, bool shown);
|
||
|
void noticePluginsChanged(const PluginList &);
|
||
|
|
||
14 years ago
|
void showEvent(TQShowEvent *) {} // do nothing, original implementation adds "Quit" menu item
|
||
15 years ago
|
|
||
|
void ShowHideWidgetPlugins();
|
||
|
|
||
14 years ago
|
void dragEnterEvent(TQDragEnterEvent* event);
|
||
|
void dropEvent(TQDropEvent* event);
|
||
15 years ago
|
|
||
|
public:
|
||
|
|
||
|
LeftClickAction getLeftClickAction() const { return m_leftClickAction; }
|
||
|
void setLeftClickAction(LeftClickAction action);
|
||
|
|
||
|
signals:
|
||
|
void sigLeftClickActionChanged(LeftClickAction action);
|
||
|
|
||
|
protected:
|
||
|
|
||
12 years ago
|
TDEPopupMenu *m_menu;
|
||
|
TDEPopupMenu *m_pluginMenu;
|
||
|
TDEPopupMenu *m_recordingMenu;
|
||
14 years ago
|
TQStringList m_stationIDs;
|
||
15 years ago
|
|
||
|
// menu Item IDs
|
||
|
int m_titleID;
|
||
|
int m_alarmID;
|
||
|
int m_recordingID;
|
||
|
int m_powerID;
|
||
|
int m_pauseID;
|
||
|
int m_sleepID;
|
||
|
int m_seekfwID;
|
||
|
int m_seekbwID;
|
||
14 years ago
|
TQValueList<int> m_stationMenuIDs;
|
||
15 years ago
|
|
||
14 years ago
|
TQMap<WidgetPluginBase *, int> m_widgetPluginIDs;
|
||
15 years ago
|
|
||
|
int m_NextRecordingMenuID;
|
||
14 years ago
|
TQMap<int, SoundStreamID> m_MenuID2StreamID;
|
||
|
TQMap<SoundStreamID, int> m_StreamID2MenuID;
|
||
15 years ago
|
|
||
|
LeftClickAction m_leftClickAction;
|
||
|
|
||
14 years ago
|
TQMap<TQString, bool> m_widgetsShownCache;
|
||
15 years ago
|
};
|
||
|
|
||
|
|
||
|
#endif
|