summaryrefslogtreecommitdiff
path: root/libopie/odevicebutton.cpp
Unidiff
Diffstat (limited to 'libopie/odevicebutton.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevicebutton.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libopie/odevicebutton.cpp b/libopie/odevicebutton.cpp
index eccb57c..314eb51 100644
--- a/libopie/odevicebutton.cpp
+++ b/libopie/odevicebutton.cpp
@@ -51,96 +51,100 @@ OQCopMessage &OQCopMessage::operator = ( const OQCopMessage &assign )
51{ 51{
52 init ( assign. channel ( ), assign. message ( ), assign. data ( )); 52 init ( assign. channel ( ), assign. message ( ), assign. data ( ));
53 return *this; 53 return *this;
54} 54}
55 55
56OQCopMessage::OQCopMessage ( const QCString &ch, const QCString &m, const QByteArray &arg ) 56OQCopMessage::OQCopMessage ( const QCString &ch, const QCString &m, const QByteArray &arg )
57 : d ( 0 ) 57 : d ( 0 )
58{ 58{
59 init ( ch, m, arg ); 59 init ( ch, m, arg );
60} 60}
61 61
62void OQCopMessage::init ( const QCString &ch, const QCString &m, const QByteArray &arg ) 62void OQCopMessage::init ( const QCString &ch, const QCString &m, const QByteArray &arg )
63{ 63{
64 if ( !d ) 64 if ( !d )
65 d = new OQCopMessageData ( ); 65 d = new OQCopMessageData ( );
66 d-> m_channel = ch; 66 d-> m_channel = ch;
67 d-> m_message = m; 67 d-> m_message = m;
68 d-> m_data = arg; 68 d-> m_data = arg;
69} 69}
70 70
71bool OQCopMessage::send ( ) 71bool OQCopMessage::send ( )
72{ 72{
73 if ( d-> m_channel. isEmpty ( ) || d-> m_message. isEmpty ( ) ) 73 if ( d-> m_channel. isEmpty ( ) || d-> m_message. isEmpty ( ) )
74 return false; 74 return false;
75 75
76 QCopEnvelope e ( d-> m_channel, d-> m_message ); 76 QCopEnvelope e ( d-> m_channel, d-> m_message );
77 77
78 if ( d-> m_data. size ( )) 78 if ( d-> m_data. size ( ))
79 e. writeRawBytes ( d-> m_data. data ( ), d-> m_data. size ( )); 79 e. writeRawBytes ( d-> m_data. data ( ), d-> m_data. size ( ));
80 80
81 return true; 81 return true;
82} 82}
83 83
84QCString OQCopMessage::channel ( ) const 84QCString OQCopMessage::channel ( ) const
85{ 85{
86 return d-> m_channel; 86 return d-> m_channel;
87} 87}
88 88
89QCString OQCopMessage::message ( ) const 89QCString OQCopMessage::message ( ) const
90{ 90{
91 return d-> m_message; 91 return d-> m_message;
92} 92}
93 93
94QByteArray OQCopMessage::data ( ) const 94QByteArray OQCopMessage::data ( ) const
95{ 95{
96 return d-> m_data; 96 return d-> m_data;
97} 97}
98 98
99bool OQCopMessage::isNull() const
100{
101 return d-> m_message.isNull() || d-> m_channel.isNull();
102}
99void OQCopMessage::setChannel ( const QCString &ch ) 103void OQCopMessage::setChannel ( const QCString &ch )
100{ 104{
101 d-> m_channel = ch; 105 d-> m_channel = ch;
102} 106}
103 107
104void OQCopMessage::setMessage ( const QCString &m ) 108void OQCopMessage::setMessage ( const QCString &m )
105{ 109{
106 d-> m_message = m; 110 d-> m_message = m;
107} 111}
108 112
109void OQCopMessage::setData ( const QByteArray &data ) 113void OQCopMessage::setData ( const QByteArray &data )
110{ 114{
111 d-> m_data = data; 115 d-> m_data = data;
112} 116}
113 117
114/*! \class Opie::ODeviceButton 118/*! \class Opie::ODeviceButton
115 \brief The Opie::ODeviceButton class represents a physical user mappable button on a Qtopia device. 119 \brief The Opie::ODeviceButton class represents a physical user mappable button on a Qtopia device.
116 120
117 This class represents a physical button on a Qtopia device. A 121 This class represents a physical button on a Qtopia device. A
118 device may have "user programmable" buttons. 122 device may have "user programmable" buttons.
119 The location and number of buttons will vary from device to 123 The location and number of buttons will vary from device to
120 device. userText() and pixmap() may be used to describe this button 124 device. userText() and pixmap() may be used to describe this button
121 to the user in help documentation. 125 to the user in help documentation.
122 126
123 \ingroup qtopiaemb 127 \ingroup qtopiaemb
124 \internal 128 \internal
125*/ 129*/
126 130
127ODeviceButton::ODeviceButton() 131ODeviceButton::ODeviceButton()
128{ 132{
129} 133}
130 134
131ODeviceButton::~ODeviceButton() 135ODeviceButton::~ODeviceButton()
132{ 136{
133} 137}
134 138
135/*! 139/*!
136 Returns the button's keycode. 140 Returns the button's keycode.
137 */ 141 */
138ushort ODeviceButton::keycode() const 142ushort ODeviceButton::keycode() const
139{ 143{
140 return m_Keycode; 144 return m_Keycode;
141} 145}
142 146
143 147
144/*! 148/*!
145 This function returns a human readable, translated description of the button. 149 This function returns a human readable, translated description of the button.
146 */ 150 */