summaryrefslogtreecommitdiff
path: root/libopie/odevicebutton.cpp
Unidiff
Diffstat (limited to 'libopie/odevicebutton.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevicebutton.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/libopie/odevicebutton.cpp b/libopie/odevicebutton.cpp
index 314eb51..647ac4b 100644
--- a/libopie/odevicebutton.cpp
+++ b/libopie/odevicebutton.cpp
@@ -1,150 +1,148 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include <qpixmap.h>
22#include <qstring.h>
23 21
24#include <qpe/qcopenvelope_qws.h> 22#include <qpe/qcopenvelope_qws.h>
25#include <opie/odevicebutton.h> 23#include <opie/odevicebutton.h>
26 24
27using namespace Opie; 25using namespace Opie;
28 26
29 27
30class OQCopMessageData { 28class OQCopMessageData {
31public: 29public:
32 QCString m_channel; 30 QCString m_channel;
33 QCString m_message; 31 QCString m_message;
34 QByteArray m_data; 32 QByteArray m_data;
35}; 33};
36 34
37 35
38OQCopMessage::OQCopMessage ( ) 36OQCopMessage::OQCopMessage ( )
39 : d ( 0 ) 37 : d ( 0 )
40{ 38{
41 init ( QCString ( ), QCString ( ), QByteArray ( )); 39 init ( QCString ( ), QCString ( ), QByteArray ( ));
42} 40}
43 41
44OQCopMessage::OQCopMessage ( const OQCopMessage &copy ) 42OQCopMessage::OQCopMessage ( const OQCopMessage &copy )
45 : d ( 0 ) 43 : d ( 0 )
46{ 44{
47 init ( copy. channel ( ), copy. message ( ), copy. data ( )); 45 init ( copy. channel ( ), copy. message ( ), copy. data ( ));
48} 46}
49 47
50OQCopMessage &OQCopMessage::operator = ( const OQCopMessage &assign ) 48OQCopMessage &OQCopMessage::operator = ( const OQCopMessage &assign )
51{ 49{
52 init ( assign. channel ( ), assign. message ( ), assign. data ( )); 50 init ( assign. channel ( ), assign. message ( ), assign. data ( ));
53 return *this; 51 return *this;
54} 52}
55 53
56OQCopMessage::OQCopMessage ( const QCString &ch, const QCString &m, const QByteArray &arg ) 54OQCopMessage::OQCopMessage ( const QCString &ch, const QCString &m, const QByteArray &arg )
57 : d ( 0 ) 55 : d ( 0 )
58{ 56{
59 init ( ch, m, arg ); 57 init ( ch, m, arg );
60} 58}
61 59
62void OQCopMessage::init ( const QCString &ch, const QCString &m, const QByteArray &arg ) 60void OQCopMessage::init ( const QCString &ch, const QCString &m, const QByteArray &arg )
63{ 61{
64 if ( !d ) 62 if ( !d )
65 d = new OQCopMessageData ( ); 63 d = new OQCopMessageData ( );
66 d-> m_channel = ch; 64 d-> m_channel = ch;
67 d-> m_message = m; 65 d-> m_message = m;
68 d-> m_data = arg; 66 d-> m_data = arg;
69} 67}
70 68
71bool OQCopMessage::send ( ) 69bool OQCopMessage::send ( )
72{ 70{
73 if ( d-> m_channel. isEmpty ( ) || d-> m_message. isEmpty ( ) ) 71 if ( d-> m_channel. isEmpty ( ) || d-> m_message. isEmpty ( ) )
74 return false; 72 return false;
75 73
76 QCopEnvelope e ( d-> m_channel, d-> m_message ); 74 QCopEnvelope e ( d-> m_channel, d-> m_message );
77 75
78 if ( d-> m_data. size ( )) 76 if ( d-> m_data. size ( ))
79 e. writeRawBytes ( d-> m_data. data ( ), d-> m_data. size ( )); 77 e. writeRawBytes ( d-> m_data. data ( ), d-> m_data. size ( ));
80 78
81 return true; 79 return true;
82} 80}
83 81
84QCString OQCopMessage::channel ( ) const 82QCString OQCopMessage::channel ( ) const
85{ 83{
86 return d-> m_channel; 84 return d-> m_channel;
87} 85}
88 86
89QCString OQCopMessage::message ( ) const 87QCString OQCopMessage::message ( ) const
90{ 88{
91 return d-> m_message; 89 return d-> m_message;
92} 90}
93 91
94QByteArray OQCopMessage::data ( ) const 92QByteArray OQCopMessage::data ( ) const
95{ 93{
96 return d-> m_data; 94 return d-> m_data;
97} 95}
98 96
99bool OQCopMessage::isNull() const 97bool OQCopMessage::isNull() const
100{ 98{
101 return d-> m_message.isNull() || d-> m_channel.isNull(); 99 return d-> m_message.isNull() || d-> m_channel.isNull();
102} 100}
103void OQCopMessage::setChannel ( const QCString &ch ) 101void OQCopMessage::setChannel ( const QCString &ch )
104{ 102{
105 d-> m_channel = ch; 103 d-> m_channel = ch;
106} 104}
107 105
108void OQCopMessage::setMessage ( const QCString &m ) 106void OQCopMessage::setMessage ( const QCString &m )
109{ 107{
110 d-> m_message = m; 108 d-> m_message = m;
111} 109}
112 110
113void OQCopMessage::setData ( const QByteArray &data ) 111void OQCopMessage::setData ( const QByteArray &data )
114{ 112{
115 d-> m_data = data; 113 d-> m_data = data;
116} 114}
117 115
118/*! \class Opie::ODeviceButton 116/*! \class Opie::ODeviceButton
119 \brief The Opie::ODeviceButton class represents a physical user mappable button on a Qtopia device. 117 \brief The Opie::ODeviceButton class represents a physical user mappable button on a Qtopia device.
120 118
121 This class represents a physical button on a Qtopia device. A 119 This class represents a physical button on a Qtopia device. A
122 device may have "user programmable" buttons. 120 device may have "user programmable" buttons.
123 The location and number of buttons will vary from device to 121 The location and number of buttons will vary from device to
124 device. userText() and pixmap() may be used to describe this button 122 device. userText() and pixmap() may be used to describe this button
125 to the user in help documentation. 123 to the user in help documentation.
126 124
127 \ingroup qtopiaemb 125 \ingroup qtopiaemb
128 \internal 126 \internal
129*/ 127*/
130 128
131ODeviceButton::ODeviceButton() 129ODeviceButton::ODeviceButton()
132{ 130{
133} 131}
134 132
135ODeviceButton::~ODeviceButton() 133ODeviceButton::~ODeviceButton()
136{ 134{
137} 135}
138 136
139/*! 137/*!
140 Returns the button's keycode. 138 Returns the button's keycode.
141 */ 139 */
142ushort ODeviceButton::keycode() const 140ushort ODeviceButton::keycode() const
143{ 141{
144 return m_Keycode; 142 return m_Keycode;
145} 143}
146 144
147 145
148/*! 146/*!
149 This function returns a human readable, translated description of the button. 147 This function returns a human readable, translated description of the button.
150 */ 148 */