ibus-qt  1.3.2
 All Classes Namespaces Functions Enumerations Enumerator
qibuslookuptable.h
1 #ifndef __Q_IBUS_LOOKUP_TABLE_H_
2 #define __Q_IBUS_LOOKUP_TABLE_H_
3 
4 #include "qibusserializable.h"
5 #include "qibustext.h"
6 #include "qibustypes.h"
7 
8 namespace IBus {
9 
10 class LookupTable;
11 typedef Pointer<LookupTable> LookupTablePointer;
12 
14 {
15  Q_OBJECT;
16 
17 public:
18  LookupTable (uint pageSize = 5,
19  uint cursorPos = 0,
20  bool cursorVisible = true,
21  bool round = true,
22  int orientation = OrientationSystem
23  ):
24  m_pageSize (pageSize),
25  m_cursorPos (cursorPos),
26  m_cursorVisible (cursorVisible),
27  m_round (round),
28  m_orientation (orientation) {}
29 
30  ~LookupTable() {}
31 
32 public:
33  virtual bool serialize (QDBusArgument & argument);
34  virtual bool deserialize (const QDBusArgument & argument);
35  void appendCandidate (const TextPointer & e);
36  void appendLabel (const TextPointer & e);
37 
38  TextPointer candidate (uint index) const;
39  TextPointer label (const uint index) const;
40  const QVector<TextPointer> & candidates () const { return m_candidates; }
41  const QVector<TextPointer> & labels () const { return m_labels; }
42  uint cursorPos () const { return m_cursorPos; }
43  uint pageSize () const {return m_pageSize; }
44  bool isCursorVisible () const { return m_cursorVisible; }
45  bool isRound () const { return m_round; }
46  int orientation () const { return m_orientation; }
47 
48  void setCursorPos (const uint cursorPos);
49  void setCursorVisible (bool visible);
50  void setPageSize (uint pageSize);
51  void setOrientation (int orientation);
52  uint cursorPosInPage () const;
53  void clean (void);
54 
55  bool pageUp();
56  bool pageDown();
57  bool cursorUp();
58  bool cursorDown();
59 
60 private:
61  uint m_pageSize;
62  uint m_cursorPos;
63  bool m_cursorVisible;
64  bool m_round;
65  int m_orientation;
66 
67  QVector<TextPointer> m_candidates;
68  QVector<TextPointer> m_labels;
69 
70  IBUS_SERIALIZABLE
71 };
72 
73 };
74 
75 #endif
Definition: qibusserializable.h:40
Definition: qibuslookuptable.h:13
Definition: qibuspointer.h:10