00001 #ifndef __ORKEY_H
00002 #define __ORKEY_H
00003
00004 const uint KEYMAPVERSION = 0;
00005
00006 enum ActionTypes
00007 {
00008 cesOpenFile = 0,
00009 cesAutoScroll,
00010 cesActionMark,
00011 cesActionAnno,
00012 cesFullScreen,
00013 cesZoomIn,
00014 cesZoomOut,
00015 cesBack,
00016 cesForward,
00017 cesHome,
00018 cesPageUp,
00019 cesPageDown,
00020 cesLineUp,
00021 cesLineDown,
00022 cesStartDoc,
00023 cesEndDoc,
00024 cesRotate,
00025 cesScrollMore,
00026 cesScrollLess,
00027 cesInvertColours,
00028 cesToggleBars,
00029 cesToggleScrollBar,
00030 cesToggleStatusBar,
00031 cesNextLink,
00032 cesGotoLink
00033 };
00034
00035 class orKey
00036 {
00037 friend bool operator<(const orKey& lhs, const orKey& rhs);
00038 Qt::ButtonState m_st;
00039 int m_ky;
00040 bool m_scroll;
00041 public:
00042 orKey(Qt::ButtonState _s = Qt::NoButton, int _k = 0, bool _sc = false) : m_st(_s), m_ky(_k), m_scroll(_sc) {}
00043 QString text() const;
00044 bool isScroll() const { return m_scroll; }
00045 void toggleScroll() { m_scroll = !m_scroll; }
00046 };
00047
00048 inline bool operator<(const orKey& lhs, const orKey& rhs)
00049 {
00050 if (lhs.m_ky < rhs.m_ky)
00051 {
00052 return true;
00053 }
00054 if (lhs.m_ky > rhs.m_ky)
00055 {
00056 return false;
00057 }
00058 if (lhs.m_st < rhs.m_st)
00059 {
00060 return true;
00061 }
00062 if (lhs.m_st > rhs.m_st)
00063 {
00064 return false;
00065 }
00066 return (lhs.m_scroll < rhs.m_scroll);
00067 }
00068 #endif