summaryrefslogtreecommitdiff
path: root/libopie/odevicebutton.h
Unidiff
Diffstat (limited to 'libopie/odevicebutton.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie/odevicebutton.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/libopie/odevicebutton.h b/libopie/odevicebutton.h
new file mode 100644
index 0000000..5281ab2
--- a/dev/null
+++ b/libopie/odevicebutton.h
@@ -0,0 +1,97 @@
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 {
32public:
33 OQCopMessage ( );
34 OQCopMessage ( const OQCopMessage &copy );
35 OQCopMessage ( const QCString &m_channel, const QCString &message, const QByteArray &args = QByteArray ( ));
36
37 OQCopMessage &operator = ( const OQCopMessage &assign );
38
39 void setChannel ( const QCString &channel );
40 void setMessage ( const QCString &message );
41 void setData ( const QByteArray &ba );
42
43 QCString channel ( ) const;
44 QCString message ( ) const;
45 QByteArray data ( ) const;
46
47 bool send ( );
48
49private:
50 void init ( const QCString &m_channel, const QCString &message, const QByteArray &args );
51
52 OQCopMessageData *d;
53};
54
55
56/**
57 * This class represents a physical button on a Qtopia device. A device may
58 * have n "user programmable" buttons, which are number 1..n. The location
59 * and number of buttons will vary from device to device. userText() and pixmap()
60 * may be used to describe this button to the user in help documentation.
61 */
62
63class ODeviceButton
64{
65public:
66 ODeviceButton();
67 virtual ~ODeviceButton();
68
69 ushort keycode ( ) const;
70 QString userText ( ) const;
71 QPixmap pixmap ( ) const;
72 OQCopMessage factoryPresetPressedAction ( ) const;
73 OQCopMessage pressedAction ( ) const;
74 OQCopMessage factoryPresetHeldAction ( ) const;
75 OQCopMessage heldAction ( ) const;
76
77 void setKeycode ( ushort keycode );
78 void setUserText ( const QString& text );
79 void setPixmap ( const QPixmap& picture );
80 void setFactoryPresetPressedAction ( const OQCopMessage& qcopMessage );
81 void setPressedAction ( const OQCopMessage& qcopMessage );
82 void setFactoryPresetHeldAction ( const OQCopMessage& qcopMessage );
83 void setHeldAction ( const OQCopMessage& qcopMessage );
84
85private:
86 ushort m_Keycode;
87 QString m_UserText;
88 QPixmap m_Pixmap;
89 OQCopMessage m_FactoryPresetPressedAction;
90 OQCopMessage m_PressedAction;
91 OQCopMessage m_FactoryPresetHeldAction;
92 OQCopMessage m_HeldAction;
93};
94
95}
96
97#endif