Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

odevice_zaurus.h

Go to the documentation of this file.
00001 /*
00002                              This file is part of the Opie Project
00003                              Copyright (C) 2002-2005 The Opie Team <opie-devel@handhelds.org>
00004               =.             Copyright (C) 2002-2005 Michael 'Mickey' Lauer <mickey@Vanille.de>
00005             .=l.
00006            .>+-=
00007  _;:,     .>    :=|.         This program is free software; you can
00008 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00009 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00010 .="- .-=="i,     .._         License as published by the Free Software
00011  - .   .-<_>     .<>         Foundation; version 2 of the License.
00012      ._= =}       :
00013     .%`+i>       _;_.
00014     .i_,=:_.      -<s.       This program is distributed in the hope that
00015      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00016     : ..    .:,     . . .    without even the implied warranty of
00017     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00018   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00019 ..}^=.=       =       ;      Library General Public License for more
00020 ++=   -.     .`     .:       details.
00021  :     =  ...= . :.=-
00022  -.   .:....=;==+<;          You should have received a copy of the GNU
00023   -_. . .   )=.  =           Library General Public License along with
00024     --        :-=`           this library; see the file COPYING.LIB.
00025                              If not, write to the Free Software Foundation,
00026                              Inc., 59 Temple Place - Suite 330,
00027                              Boston, MA 02111-1307, USA.
00028 */
00029 
00030 #ifndef ODEVICE_ZAURUS
00031 #define ODEVICE_ZAURUS
00032 
00033 #include "odevice_abstractmobiledevice.h"
00034 
00035 /* QT */
00036 #include <qfile.h>
00037 #include <qwindowsystem_qws.h>
00038 
00039 #ifndef ARRAY_SIZE
00040 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
00041 #endif
00042 
00043 // _IO and friends are only defined in kernel headers ...
00044 #define OD_IOC(dir,type,number,size)    (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 ))
00045 #define OD_IO(type,number)              OD_IOC(0,type,number,0)
00046 #define OD_IOW(type,number,size)        OD_IOC(1,type,number,sizeof(size))
00047 #define OD_IOR(type,number,size)        OD_IOC(2,type,number,sizeof(size))
00048 #define OD_IORW(type,number,size)       OD_IOC(3,type,number,sizeof(size))
00049 
00050 // Audio
00051 #define SHARP_DEV_IOCTL_COMMAND_START 0x5680
00052 
00053 #define SHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START)
00054 #define SHARP_BUZZER_MAKESOUND   (SHARP_BUZZER_IOCTL_START)
00055 
00056 #define SHARP_BUZ_TOUCHSOUND       1  /* touch panel sound */
00057 #define SHARP_BUZ_KEYSOUND         2  /* key sound */
00058 #define SHARP_BUZ_SCHEDULE_ALARM  11  /* schedule alarm */
00059 
00060 #define SHARP_BUZZER_SETVOLUME   (SHARP_BUZZER_IOCTL_START+1)
00061 #define SHARP_BUZZER_GETVOLUME   (SHARP_BUZZER_IOCTL_START+2)
00062 #define SHARP_BUZZER_ISSUPPORTED (SHARP_BUZZER_IOCTL_START+3)
00063 #define SHARP_BUZZER_SETMUTE     (SHARP_BUZZER_IOCTL_START+4)
00064 #define SHARP_BUZZER_STOPSOUND   (SHARP_BUZZER_IOCTL_START+5)
00065 
00066 // LED
00067 #define SHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START)
00068 #define SHARP_LED_SETSTATUS   (SHARP_LED_IOCTL_START+1)
00069 #define SHARP_LED_MAIL_EXISTS  9     /* mail status (exists or not) */
00070 
00071 #define LED_MAIL_NO_UNREAD_MAIL  0   /* for SHARP_LED_MAIL_EXISTS */
00072 #define LED_MAIL_NEWMAIL_EXISTS  1   /* for SHARP_LED_MAIL_EXISTS */
00073 #define LED_MAIL_UNREAD_MAIL_EX  2   /* for SHARP_LED_MAIL_EXISTS */
00074 
00075 // Rotation and Power Management
00076 #define SHARP_IOCTL_GET_ROTATION 0x413c
00077 
00078 #define APM_IOCGEVTSRC          OD_IOR( 'A', 203, int )
00079 #define APM_IOCSEVTSRC          OD_IORW( 'A', 204, int )
00080 #define APM_EVT_POWER_BUTTON    (1 << 0)
00081 
00082 // Brightness Embedix
00083 #define SHARP_FL_IOCTL_DEVICE   "/dev/sharp_fl"
00084 #define SHARP_FL_IOCTL_ON                  1
00085 #define SHARP_FL_IOCTL_OFF                 2
00086 #define SHARP_FL_IOCTL_STEP_CONTRAST     100
00087 #define SHARP_FL_IOCTL_GET_STEP_CONTRAST 101
00088 #define SHARP_FL_IOCTL_GET_STEP          102
00089 
00090 // Vesa Standard
00091 #define FB_BLANK_UNBLANK            0
00092 #define FB_BLANK_POWERDOWN          4
00093 
00094 namespace Opie {
00095 namespace Core {
00096 namespace Internal {
00097 
00098 class Zaurus : public OAbstractMobileDevice, public QWSServer::KeyboardFilter
00099 {
00100   Q_OBJECT
00101 
00102   protected:
00103     virtual void init(const QString&);
00104     virtual void initButtons();
00105     void initHingeSensor();
00106 
00107   protected slots:
00108     void hingeSensorTriggered();
00109     void systemMessage( const QCString &msg, const QByteArray & );
00110 
00111   public:
00112     virtual bool setDisplayBrightness( int b );
00113     virtual bool setDisplayStatus( bool on );
00114     virtual int displayBrightnessResolution() const;
00115 
00116     virtual void playAlarmSound();
00117     virtual void playKeySound();
00118     virtual void playTouchSound();
00119 
00120     virtual QValueList <OLed> ledList() const;
00121     virtual QValueList <OLedState> ledStateList ( OLed led ) const;
00122     virtual OLedState ledState( OLed led ) const;
00123     virtual bool setLedState( OLed led, OLedState st );
00124 
00125     virtual bool hasHingeSensor() const;
00126     virtual OHingeStatus readHingeSensor() const;
00127 
00128     virtual Transformation rotation() const;
00129     virtual ODirection direction() const;
00130     virtual bool suspend();
00131 
00132   protected:
00133     virtual void buzzer( int snd );
00134     virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat );
00135 
00136     QString m_backlightdev;
00137     OLedState m_leds[1];
00138     bool m_embedix;
00139     QFile m_hinge;
00140 };
00141 
00142 struct z_button {
00143     Qt::Key code;
00144     char *utext;
00145     char *pix;
00146     char *fpressedservice;
00147     char *fpressedaction;
00148     char *fheldservice;
00149     char *fheldaction;
00150 };
00151 }
00152 }
00153 }
00154 #endif

Generated on Sat Nov 5 16:16:06 2005 for OPIE by  doxygen 1.4.2