summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevicebutton.h
authormickeyl <mickeyl>2004-01-13 15:21:40 (UTC)
committer mickeyl <mickeyl>2004-01-13 15:21:40 (UTC)
commitaf79bda4c7e51f46abe67124f9c06126eaebb59d (patch) (unidiff)
tree4e9ad77ec4b2bb3d66ac6553d0a225b0b18f2140 /libopie2/opiecore/device/odevicebutton.h
parent24eb97ec5cda3d72c3541fd120568b8d937025f8 (diff)
downloadopie-af79bda4c7e51f46abe67124f9c06126eaebb59d.zip
opie-af79bda4c7e51f46abe67124f9c06126eaebb59d.tar.gz
opie-af79bda4c7e51f46abe67124f9c06126eaebb59d.tar.bz2
- split odevice into dedicated files and classes, it has getting much too large
- merge odevice into libopie2 - merge oprocctrl and oprocess into libopie2
Diffstat (limited to 'libopie2/opiecore/device/odevicebutton.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevicebutton.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/libopie2/opiecore/device/odevicebutton.h b/libopie2/opiecore/device/odevicebutton.h
new file mode 100644
index 0000000..a66b88f
--- a/dev/null
+++ b/libopie2/opiecore/device/odevicebutton.h
@@ -0,0 +1,108 @@
1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3**
4** This file is part of the Qtopia Environment.
5**
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
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
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.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#ifndef DEVICE_BUTTON_H
21#define DEVICE_BUTTON_H
22
23#include <qpixmap.h>
24#include <qstring.h>
25
26class OQCopMessageData;
27
28namespace Opie
29{
30
31class OQCopMessage
32{
33public:
34 OQCopMessage ( );
35 OQCopMessage ( const OQCopMessage &copy );
36 OQCopMessage ( const QCString &m_channel, const QCString &message, const QByteArray &args = QByteArray ( ));
37
38 OQCopMessage &operator = ( const OQCopMessage &assign );
39
40 void setChannel ( const QCString &channel );
41 void setMessage ( const QCString &message );
42 void setData ( const QByteArray &ba );
43
44 QCString channel ( ) const;
45 QCString message ( ) const;
46 QByteArray data ( ) const;
47
48 bool isNull()const;
49
50 bool send ( );
51
52private:
53 void init ( const QCString &m_channel, const QCString &message, const QByteArray &args );
54
55 OQCopMessageData *d;
56 class Private;
57 Private* m_data;
58};
59
60
61/**
62 * This class represents a physical button on a Qtopia device. A device may
63 * have n "user programmable" buttons, which are number 1..n. The location
64 * and number of buttons will vary from device to device. userText() and pixmap()
65 * may be used to describe this button to the user in help documentation.
66 *
67 * @version 1.0
68 * @author Trolltech
69 * @short A representation of buttons
70 */
71
72class ODeviceButton
73{
74 public:
75 ODeviceButton();
76 virtual ~ODeviceButton();
77
78 ushort keycode ( ) const;
79 QString userText ( ) const;
80 QPixmap pixmap ( ) const;
81 OQCopMessage factoryPresetPressedAction ( ) const;
82 OQCopMessage pressedAction ( ) const;
83 OQCopMessage factoryPresetHeldAction ( ) const;
84 OQCopMessage heldAction ( ) const;
85
86 void setKeycode ( ushort keycode );
87 void setUserText ( const QString& text );
88 void setPixmap ( const QPixmap& picture );
89 void setFactoryPresetPressedAction ( const OQCopMessage& qcopMessage );
90 void setPressedAction ( const OQCopMessage& qcopMessage );
91 void setFactoryPresetHeldAction ( const OQCopMessage& qcopMessage );
92 void setHeldAction ( const OQCopMessage& qcopMessage );
93
94 private:
95 ushort m_Keycode;
96 QString m_UserText;
97 QPixmap m_Pixmap;
98 OQCopMessage m_FactoryPresetPressedAction;
99 OQCopMessage m_PressedAction;
100 OQCopMessage m_FactoryPresetHeldAction;
101 OQCopMessage m_HeldAction;
102 class Private;
103 Private *d;
104};
105
106}
107
108#endif