1
/* vim:set et ts=4 sts=4:
3
* ibus-pinyin - The Chinese PinYin engine for IBus
5
* Copyright (c) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2, or (at your option)
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
#ifndef __PY_PROPERTY_H_
22
#define __PY_PROPERTY_H_
30
class Property : public Object {
32
Property (const gchar *key,
33
IBusPropType type = PROP_TYPE_NORMAL,
34
IBusText *label = NULL,
35
const gchar *icon = NULL,
36
IBusText *tooltip = NULL,
37
gboolean sensitive = TRUE,
38
gboolean visible = TRUE,
39
IBusPropState state = PROP_STATE_UNCHECKED,
40
IBusPropList *props = NULL)
41
: Object (ibus_property_new (key, type, label, icon, tooltip, sensitive, visible, state, props)) { }
43
void setLabel (IBusText *text)
45
ibus_property_set_label (get<IBusProperty> (), text);
48
void setLabel (const gchar *text)
50
setLabel (Text (text));
53
void setIcon (const gchar *icon)
55
ibus_property_set_icon (get<IBusProperty> (), icon);
58
void setSensitive (gboolean sensitive)
60
ibus_property_set_sensitive (get<IBusProperty> (), sensitive);
63
operator IBusProperty * (void) const
65
return get<IBusProperty> ();
70
class PropList : Object {
72
PropList (void) : Object (ibus_prop_list_new ()) { }
74
void append (Property &prop)
76
ibus_prop_list_append (get<IBusPropList> (), prop);
79
operator IBusPropList * (void) const
81
return get<IBusPropList> ();