1 /* gtktoolitem.c
2  *
3  * Copyright (C) 2002 Anders Carlsson <andersca@gnome.org>
4  * Copyright (C) 2002 James Henstridge <james@daa.com.au>
5  * Copyright (C) 2003 Soeren Sandmann <sandmann@daimi.au.dk>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library 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 GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __GTK_TOOL_ITEM_H__
22 #define __GTK_TOOL_ITEM_H__
23 
24 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
25 #error "Only <gtk/gtk.h> can be included directly."
26 #endif
27 
28 #include <gtk/gtkbin.h>
29 #include <gtk/gtkmenuitem.h>
30 #include <gtk/gtksizegroup.h>
31 
32 G_BEGIN_DECLS
33 
34 #define GTK_TYPE_TOOL_ITEM            (gtk_tool_item_get_type ())
35 #define GTK_TOOL_ITEM(o)              (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_TOOL_ITEM, GtkToolItem))
36 #define GTK_TOOL_ITEM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOL_ITEM, GtkToolItemClass))
37 #define GTK_IS_TOOL_ITEM(o)           (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_TOOL_ITEM))
38 #define GTK_IS_TOOL_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOL_ITEM))
39 #define GTK_TOOL_ITEM_GET_CLASS(o)    (G_TYPE_INSTANCE_GET_CLASS((o), GTK_TYPE_TOOL_ITEM, GtkToolItemClass))
40 
41 typedef struct _GtkToolItem        GtkToolItem;
42 typedef struct _GtkToolItemClass   GtkToolItemClass;
43 typedef struct _GtkToolItemPrivate GtkToolItemPrivate;
44 
45 struct _GtkToolItem
46 {
47   GtkBin parent;
48 
49   /*< private >*/
50   GtkToolItemPrivate *priv;
51 };
52 
53 /**
54  * GtkToolItemClass:
55  * @parent_class: The parent class.
56  * @create_menu_proxy: Signal emitted when the toolbar needs
57  *    information from tool_item about whether the item should appear in
58  *    the toolbar overflow menu.
59  * @toolbar_reconfigured: Signal emitted when some property of the
60  *    toolbar that the item is a child of changes.
61  */
62 struct _GtkToolItemClass
63 {
64   GtkBinClass parent_class;
65 
66   /* signals */
67   gboolean   (* create_menu_proxy)    (GtkToolItem *tool_item);
68   void       (* toolbar_reconfigured) (GtkToolItem *tool_item);
69 
70   /*< private >*/
71 
72   /* Padding for future expansion */
73   void (* _gtk_reserved1) (void);
74   void (* _gtk_reserved2) (void);
75   void (* _gtk_reserved3) (void);
76   void (* _gtk_reserved4) (void);
77 };
78 
79 
80 GDK_AVAILABLE_IN_ALL
81 GType        gtk_tool_item_get_type (void) G_GNUC_CONST;
82 GDK_AVAILABLE_IN_ALL
83 GtkToolItem *gtk_tool_item_new      (void);
84 
85 GDK_AVAILABLE_IN_ALL
86 void            gtk_tool_item_set_homogeneous          (GtkToolItem *tool_item,
87 							gboolean     homogeneous);
88 GDK_AVAILABLE_IN_ALL
89 gboolean        gtk_tool_item_get_homogeneous          (GtkToolItem *tool_item);
90 
91 GDK_AVAILABLE_IN_ALL
92 void            gtk_tool_item_set_expand               (GtkToolItem *tool_item,
93 							gboolean     expand);
94 GDK_AVAILABLE_IN_ALL
95 gboolean        gtk_tool_item_get_expand               (GtkToolItem *tool_item);
96 GDK_AVAILABLE_IN_ALL
97 void            gtk_tool_item_set_tooltip_text         (GtkToolItem *tool_item,
98 							const gchar *text);
99 GDK_AVAILABLE_IN_ALL
100 void            gtk_tool_item_set_tooltip_markup       (GtkToolItem *tool_item,
101 							const gchar *markup);
102 
103 GDK_AVAILABLE_IN_ALL
104 void            gtk_tool_item_set_use_drag_window      (GtkToolItem *tool_item,
105 							gboolean     use_drag_window);
106 GDK_AVAILABLE_IN_ALL
107 gboolean        gtk_tool_item_get_use_drag_window      (GtkToolItem *tool_item);
108 
109 GDK_AVAILABLE_IN_ALL
110 void            gtk_tool_item_set_visible_horizontal   (GtkToolItem *tool_item,
111 							gboolean     visible_horizontal);
112 GDK_AVAILABLE_IN_ALL
113 gboolean        gtk_tool_item_get_visible_horizontal   (GtkToolItem *tool_item);
114 
115 GDK_AVAILABLE_IN_ALL
116 void            gtk_tool_item_set_visible_vertical     (GtkToolItem *tool_item,
117 							gboolean     visible_vertical);
118 GDK_AVAILABLE_IN_ALL
119 gboolean        gtk_tool_item_get_visible_vertical     (GtkToolItem *tool_item);
120 
121 GDK_AVAILABLE_IN_ALL
122 gboolean        gtk_tool_item_get_is_important         (GtkToolItem *tool_item);
123 GDK_AVAILABLE_IN_ALL
124 void            gtk_tool_item_set_is_important         (GtkToolItem *tool_item,
125 							gboolean     is_important);
126 
127 GDK_AVAILABLE_IN_ALL
128 PangoEllipsizeMode gtk_tool_item_get_ellipsize_mode    (GtkToolItem *tool_item);
129 GDK_AVAILABLE_IN_ALL
130 GtkIconSize     gtk_tool_item_get_icon_size            (GtkToolItem *tool_item);
131 GDK_AVAILABLE_IN_ALL
132 GtkOrientation  gtk_tool_item_get_orientation          (GtkToolItem *tool_item);
133 GDK_AVAILABLE_IN_ALL
134 GtkToolbarStyle gtk_tool_item_get_toolbar_style        (GtkToolItem *tool_item);
135 GDK_AVAILABLE_IN_ALL
136 GtkReliefStyle  gtk_tool_item_get_relief_style         (GtkToolItem *tool_item);
137 GDK_AVAILABLE_IN_ALL
138 gfloat          gtk_tool_item_get_text_alignment       (GtkToolItem *tool_item);
139 GDK_AVAILABLE_IN_ALL
140 GtkOrientation  gtk_tool_item_get_text_orientation     (GtkToolItem *tool_item);
141 GDK_AVAILABLE_IN_ALL
142 GtkSizeGroup *  gtk_tool_item_get_text_size_group      (GtkToolItem *tool_item);
143 
144 GDK_AVAILABLE_IN_ALL
145 GtkWidget *     gtk_tool_item_retrieve_proxy_menu_item (GtkToolItem *tool_item);
146 GDK_AVAILABLE_IN_ALL
147 GtkWidget *     gtk_tool_item_get_proxy_menu_item      (GtkToolItem *tool_item,
148 							const gchar *menu_item_id);
149 GDK_AVAILABLE_IN_ALL
150 void            gtk_tool_item_set_proxy_menu_item      (GtkToolItem *tool_item,
151 							const gchar *menu_item_id,
152 							GtkWidget   *menu_item);
153 GDK_AVAILABLE_IN_ALL
154 void		gtk_tool_item_rebuild_menu	       (GtkToolItem *tool_item);
155 
156 GDK_AVAILABLE_IN_ALL
157 void            gtk_tool_item_toolbar_reconfigured     (GtkToolItem *tool_item);
158 
159 /* private */
160 
161 gboolean       _gtk_tool_item_create_menu_proxy        (GtkToolItem *tool_item);
162 
163 G_END_DECLS
164 
165 #endif /* __GTK_TOOL_ITEM_H__ */
166