summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/orkey.h
authorpohly <pohly>2004-08-24 20:52:45 (UTC)
committer pohly <pohly>2004-08-24 20:52:45 (UTC)
commit73253e93327cf4ef0932de1b4afb56af22a0f37e (patch) (side-by-side diff)
tree1c9a7a6dd3341e036a894d348a3372525d29acec /noncore/apps/opie-reader/orkey.h
parente90847c784c48bd21bf8768cb38edb853b832697 (diff)
downloadopie-73253e93327cf4ef0932de1b4afb56af22a0f37e.zip
opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.gz
opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.bz2
updated source to opie-reader 0.7g
Diffstat (limited to 'noncore/apps/opie-reader/orkey.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/orkey.h68
1 files changed, 68 insertions, 0 deletions
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