Diffstat (limited to 'noncore/apps/opie-reader/orkey.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/orkey.h | 68 |
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 |