00001 /*************************************************************************** 00002 radio_interfaces.h - description 00003 ------------------- 00004 begin : Mon Mär 10 2003 00005 copyright : (C) 2003 by Martin Witte 00006 email : witte@kawo1.rwth-aachen.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 /*************************************************************************** 00019 * * 00020 * Interfaces in this header: * 00021 * * 00022 * IRadio(Client) * 00023 * * 00024 ***************************************************************************/ 00025 00026 #ifndef KRADIO_RADIO_INTERFACES_H 00027 #define KRADIO_RADIO_INTERFACES_H 00028 00029 #ifdef HAVE_CONFIG_H 00030 #include <config.h> 00031 #endif 00032 00033 #include "interfaces.h" 00034 #include "soundstreamid.h" 00035 00036 class RadioStation; 00037 class StationList; 00038 00039 00041 00042 00043 INTERFACE(IRadio, IRadioClient) 00044 { 00045 public : 00046 IF_CON_DESTRUCTOR(IRadio, -1) 00047 00048 RECEIVERS: 00049 IF_RECEIVER( powerOn() ) 00050 IF_RECEIVER( powerOff() ) 00051 IF_RECEIVER( activateStation(const RadioStation &rs) ) 00052 IF_RECEIVER( activateStation(int index) ) 00053 IF_RECEIVER( setStations(const StationList &sl) ) 00054 IF_RECEIVER( setPresetFile(const QString &f) ) 00055 00056 SENDERS: 00057 IF_SENDER ( notifyPowerChanged(bool on) ) 00058 IF_SENDER ( notifyStationChanged (const RadioStation &, int idx) ) 00059 IF_SENDER ( notifyStationsChanged(const StationList &sl) ) 00060 IF_SENDER ( notifyPresetFileChanged(const QString &sl) ) 00061 IF_SENDER ( notifyCurrentSoundStreamIDChanged(SoundStreamID id) ) 00062 00063 ANSWERS: 00064 IF_ANSWER ( bool isPowerOn() const ) 00065 IF_ANSWER ( bool isPowerOff() const ) 00066 IF_ANSWER ( const RadioStation & getCurrentStation() const ) 00067 IF_ANSWER ( int getStationIdx(const RadioStation &rs) const ) 00068 IF_ANSWER ( int getCurrentStationIdx() const ) 00069 IF_ANSWER ( const StationList & getStations() const ) 00070 IF_ANSWER ( const QString & getPresetFile() const ); 00071 00072 IF_ANSWER ( SoundStreamID getCurrentSoundStreamID() const ); 00073 00074 }; 00075 00076 00077 INTERFACE(IRadioClient, IRadio) 00078 { 00079 friend class IRadio; 00080 00081 public : 00082 IF_CON_DESTRUCTOR(IRadioClient, 1) 00083 00084 SENDERS: 00085 IF_SENDER ( sendPowerOn() ) 00086 IF_SENDER ( sendPowerOff() ) 00087 IF_SENDER ( sendActivateStation(const RadioStation &rs) ) 00088 IF_SENDER ( sendActivateStation(int index) ) 00089 IF_SENDER ( sendStations(const StationList &sl) ) 00090 IF_SENDER ( sendPresetFile(const QString &f) ) 00091 00092 RECEIVERS: 00093 IF_RECEIVER( noticePowerChanged(bool on) ) 00094 IF_RECEIVER( noticeStationChanged (const RadioStation &, int idx) ) 00095 IF_RECEIVER( noticeStationsChanged(const StationList &sl) ) 00096 IF_RECEIVER( noticePresetFileChanged(const QString &f) ) 00097 IF_RECEIVER( noticeCurrentSoundStreamIDChanged(SoundStreamID id)) 00098 00099 QUERIES: 00100 IF_QUERY ( bool queryIsPowerOn() ) 00101 IF_QUERY ( bool queryIsPowerOff() ) 00102 IF_QUERY ( const RadioStation & queryCurrentStation() ) 00103 IF_QUERY ( int queryStationIdx(const RadioStation &rs) ) 00104 IF_QUERY ( int queryCurrentStationIdx() ) 00105 IF_QUERY ( const StationList & queryStations() ) 00106 IF_QUERY ( const QString & queryPresetFile() ) 00107 00108 IF_QUERY ( SoundStreamID queryCurrentSoundStreamID() ); 00109 00110 RECEIVERS: 00111 virtual void noticeConnectedI (cmplInterface *, bool pointer_valid); 00112 virtual void noticeDisconnectedI (cmplInterface *, bool pointer_valid); 00113 }; 00114 00115 00116 00117 #endif