00001 /********************************************************************** 00002 ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 00003 ** 00004 ** This file is part of the Qtopia Environment. 00005 ** 00006 ** This file may be distributed and/or modified under the terms of the 00007 ** GNU General Public License version 2 as published by the Free Software 00008 ** Foundation and appearing in the file LICENSE.GPL included in the 00009 ** packaging of this file. 00010 ** 00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 ** 00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00015 ** 00016 ** Contact info@trolltech.com if any conditions of this licensing are 00017 ** not clear to you. 00018 ** 00019 **********************************************************************/ 00020 #ifndef DEVICE_BUTTON_H 00021 #define DEVICE_BUTTON_H 00022 00023 #include <qpixmap.h> 00024 #include <qstring.h> 00025 00026 class OQCopMessageData; 00027 00028 namespace Opie 00029 { 00030 00031 class OQCopMessage { 00032 public: 00033 OQCopMessage ( ); 00034 OQCopMessage ( const OQCopMessage © ); 00035 OQCopMessage ( const QCString &m_channel, const QCString &message, const QByteArray &args = QByteArray ( )); 00036 00037 OQCopMessage &operator = ( const OQCopMessage &assign ); 00038 00039 void setChannel ( const QCString &channel ); 00040 void setMessage ( const QCString &message ); 00041 void setData ( const QByteArray &ba ); 00042 00043 QCString channel ( ) const; 00044 QCString message ( ) const; 00045 QByteArray data ( ) const; 00046 00047 bool isNull()const; 00048 00049 bool send ( ); 00050 00051 private: 00052 void init ( const QCString &m_channel, const QCString &message, const QByteArray &args ); 00053 00054 OQCopMessageData *d; 00055 class Private; 00056 Private* m_data; 00057 }; 00058 00059 00071 class ODeviceButton 00072 { 00073 public: 00074 ODeviceButton(); 00075 virtual ~ODeviceButton(); 00076 00077 ushort keycode ( ) const; 00078 QString userText ( ) const; 00079 QPixmap pixmap ( ) const; 00080 OQCopMessage factoryPresetPressedAction ( ) const; 00081 OQCopMessage pressedAction ( ) const; 00082 OQCopMessage factoryPresetHeldAction ( ) const; 00083 OQCopMessage heldAction ( ) const; 00084 00085 void setKeycode ( ushort keycode ); 00086 void setUserText ( const QString& text ); 00087 void setPixmap ( const QPixmap& picture ); 00088 void setFactoryPresetPressedAction ( const OQCopMessage& qcopMessage ); 00089 void setPressedAction ( const OQCopMessage& qcopMessage ); 00090 void setFactoryPresetHeldAction ( const OQCopMessage& qcopMessage ); 00091 void setHeldAction ( const OQCopMessage& qcopMessage ); 00092 00093 private: 00094 ushort m_Keycode; 00095 QString m_UserText; 00096 QPixmap m_Pixmap; 00097 OQCopMessage m_FactoryPresetPressedAction; 00098 OQCopMessage m_PressedAction; 00099 OQCopMessage m_FactoryPresetHeldAction; 00100 OQCopMessage m_HeldAction; 00101 class Private; 00102 Private *d; 00103 }; 00104 00105 } 00106 00107 #endif
1.4.2