From 73253e93327cf4ef0932de1b4afb56af22a0f37e Mon Sep 17 00:00:00 2001 From: pohly Date: Tue, 24 Aug 2004 20:52:45 +0000 Subject: updated source to opie-reader 0.7g --- (limited to 'noncore/apps/opie-reader/orkey.h') diff --git a/noncore/apps/opie-reader/orkey.h b/noncore/apps/opie-reader/orkey.h new file mode 100644 index 0000000..8258ef2 --- a/dev/null +++ b/noncore/apps/opie-reader/orkey.h @@ -0,0 +1,68 @@ +#ifndef __ORKEY_H +#define __ORKEY_H + +const uint KEYMAPVERSION = 0; + +enum ActionTypes +{ + cesOpenFile = 0, + cesAutoScroll, + cesActionMark, + cesActionAnno, + cesFullScreen, + cesZoomIn, + cesZoomOut, + cesBack, + cesForward, + cesHome, + cesPageUp, + cesPageDown, + cesLineUp, + cesLineDown, + cesStartDoc, + cesEndDoc, + cesRotate, + cesScrollMore, + cesScrollLess, + cesInvertColours, + cesToggleBars, + cesToggleScrollBar, + cesToggleStatusBar, + cesNextLink, + cesGotoLink +}; + +class orKey +{ + friend bool operator<(const orKey& lhs, const orKey& rhs); + Qt::ButtonState m_st; + int m_ky; + bool m_scroll; + public: + orKey(Qt::ButtonState _s = Qt::NoButton, int _k = 0, bool _sc = false) : m_st(_s), m_ky(_k), m_scroll(_sc) {} + QString text() const; + bool isScroll() const { return m_scroll; } + void toggleScroll() { m_scroll = !m_scroll; } +}; + +inline bool operator<(const orKey& lhs, const orKey& rhs) +{ + if (lhs.m_ky < rhs.m_ky) + { + return true; + } + if (lhs.m_ky > rhs.m_ky) + { + return false; + } + if (lhs.m_st < rhs.m_st) + { + return true; + } + if (lhs.m_st > rhs.m_st) + { + return false; + } + return (lhs.m_scroll < rhs.m_scroll); +} +#endif -- cgit v0.9.0.2