summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/orkey.h
Unidiff
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 @@
1#ifndef __ORKEY_H
2#define __ORKEY_H
3
4const uint KEYMAPVERSION = 0;
5
6enum ActionTypes
7{
8 cesOpenFile = 0,
9 cesAutoScroll,
10 cesActionMark,
11 cesActionAnno,
12 cesFullScreen,
13 cesZoomIn,
14 cesZoomOut,
15 cesBack,
16 cesForward,
17 cesHome,
18 cesPageUp,
19 cesPageDown,
20 cesLineUp,
21 cesLineDown,
22 cesStartDoc,
23 cesEndDoc,
24 cesRotate,
25 cesScrollMore,
26 cesScrollLess,
27 cesInvertColours,
28 cesToggleBars,
29 cesToggleScrollBar,
30 cesToggleStatusBar,
31 cesNextLink,
32 cesGotoLink
33};
34
35class orKey
36{
37 friend bool operator<(const orKey& lhs, const orKey& rhs);
38 Qt::ButtonState m_st;
39 int m_ky;
40 bool m_scroll;
41 public:
42 orKey(Qt::ButtonState _s = Qt::NoButton, int _k = 0, bool _sc = false) : m_st(_s), m_ky(_k), m_scroll(_sc) {}
43 QString text() const;
44 bool isScroll() const { return m_scroll; }
45 void toggleScroll() { m_scroll = !m_scroll; }
46};
47
48inline bool operator<(const orKey& lhs, const orKey& rhs)
49{
50 if (lhs.m_ky < rhs.m_ky)
51 {
52 return true;
53 }
54 if (lhs.m_ky > rhs.m_ky)
55 {
56 return false;
57 }
58 if (lhs.m_st < rhs.m_st)
59 {
60 return true;
61 }
62 if (lhs.m_st > rhs.m_st)
63 {
64 return false;
65 }
66 return (lhs.m_scroll < rhs.m_scroll);
67}
68#endif