ibus-qt 1.3.4
Loading...
Searching...
No Matches
qibusproperty.h
1#ifndef __Q_IBUS_PROPERTY_H_
2#define __Q_IBUS_PROPERTY_H_
3
4#include "qibusserializable.h"
5#include "qibusproplist.h"
6#include "qibustext.h"
7
8namespace IBus {
9
10/* type of QIBusProperty */
11typedef enum
12{
13 TypeNormal = 0,
14 TypeToggle = 1,
15 TypeRadio = 2,
16 TypeMenu = 3,
17 TypeSeparator = 4,
18}PropType;
19
20/*
21 * State of QIBusProperty. The actual effect
22 * depends on #QIBusPropType of the QIBusProperty.
23 */
24typedef enum
25{
26 StateUnchecked = 0,
27 StateChecked = 1,
28 StateInconsistent = 2,
29} PropState;
30
31class Property;
32class PropList;
33typedef Pointer<PropList> PropListPointer;
34typedef Pointer<Property> PropertyPointer;
35
36class Property : public Serializable
37{
38 Q_OBJECT;
39
40
41public:
42 Property () {}
43 Property (const QString key,
44 const QString icon,
45 const TextPointer &label,
46 const TextPointer &tooltip,
47 bool sensitive,
48 bool visible,
49 uint type,
50 uint state,
51 const PropListPointer &subProps):
52 m_key(key),
53 m_icon(icon),
54 m_label(label),
55 m_tooltip(tooltip),
56 m_sensitive(sensitive),
57 m_visible(visible),
58 m_type(type),
59 m_state(state),
60 m_subProps(subProps) {}
61
62 ~Property () {}
63
64public:
65 virtual bool serialize (QDBusArgument &argument);
66 virtual bool deserialize (const QDBusArgument &argument);
67
68public:
69 void setLabel (const TextPointer & lable);
70 void setVisible (bool visible);
71 void setSubProps (const PropListPointer & props);
72 bool update (const PropertyPointer prop);
73
74private:
75
76 QString m_key;
77 QString m_icon;
78 TextPointer m_label;
79 TextPointer m_tooltip;
80 bool m_sensitive;
81 bool m_visible;
82 uint m_type;
83 uint m_state;
84 PropListPointer m_subProps;
85
86 IBUS_SERIALIZABLE
87};
88
89};
90#endif
Definition qibusproperty.h:37
Definition qibusserializable.h:41
Definition qibusattribute.cpp:3