author | kergoth <kergoth> | 2003-04-18 21:54:43 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-04-18 21:54:43 (UTC) |
commit | d0852e67c15c5a973b7bc7f7bee238a6fd00dee6 (patch) (side-by-side diff) | |
tree | 68acc72ac204045b2492693ca668ece78e5f3a2c /libopie | |
parent | 1cdd9c974e621f6992ddc6dfccbc815baebd19ee (diff) | |
download | opie-d0852e67c15c5a973b7bc7f7bee238a6fd00dee6.zip opie-d0852e67c15c5a973b7bc7f7bee238a6fd00dee6.tar.gz opie-d0852e67c15c5a973b7bc7f7bee238a6fd00dee6.tar.bz2 |
Add rotation direction to ODevice, to ensure the default is appropriate for the hardware in question.
-rw-r--r-- | libopie/odevice.cpp | 10 | ||||
-rw-r--r-- | libopie/odevice.h | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 0e1c0dd..29c8ad2 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp @@ -64,12 +64,13 @@ public: QString m_systemstr; OSystem m_system; QString m_sysverstr; Transformation m_rotation; + ODirection m_direction; QValueList <ODeviceButton> *m_buttons; uint m_holdtime; }; @@ -251,12 +252,13 @@ ODevice::ODevice ( ) d-> m_vendorstr = "Unknown"; d-> m_vendor = Vendor_Unknown; d-> m_systemstr = "Unknown"; d-> m_system = System_Unknown; d-> m_sysverstr = "0.0"; d-> m_rotation = Rot0; + d-> m_direction = CW; d-> m_holdtime = 1000; // 1000ms d-> m_buttons = 0; } void ODevice::systemMessage ( const QCString &msg, const QByteArray & ) @@ -467,12 +469,20 @@ QString ODevice::systemVersionString ( ) const Transformation ODevice::rotation ( ) const { return d-> m_rotation; } /** + * @return the current rotation direction + */ +ODirection ODevice::direction ( ) const +{ + return d-> m_direction; +} + +/** * This plays an alarmSound */ void ODevice::alarmSound ( ) { #ifndef QT_NO_SOUND static Sound snd ( "alarm" ); diff --git a/libopie/odevice.h b/libopie/odevice.h index 45a790b..0c55ea0 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h @@ -100,12 +100,18 @@ enum OHardKey { HardKey_Mail = Qt::Key_F13, HardKey_Record = Qt::Key_F24, HardKey_Suspend = Qt::Key_F34, HardKey_Backlight = Qt::Key_F35, }; +enum ODirection { + CW = 0, + CCW = 1, + Flip = 2, +}; + /** * A singleton which gives informations about device specefic option * like the Hardware used, LEDs, the Base Distribution and * hardware key mappings. * * @@ -147,12 +153,13 @@ public: QString systemString ( ) const; OSystem system ( ) const; QString systemVersionString ( ) const; Transformation rotation ( ) const; + ODirection direction ( ) const; // system virtual bool setSoftSuspend ( bool on ); virtual bool suspend ( ); |