1 /*
2  * e-selectable.h
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11  * for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program; if not, see <http://www.gnu.org/licenses/>.
15  *
16  *
17  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
18  *
19  */
20 
21 #if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION)
22 #error "Only <e-util/e-util.h> should be included directly."
23 #endif
24 
25 #ifndef E_SELECTABLE_H
26 #define E_SELECTABLE_H
27 
28 #include <gtk/gtk.h>
29 
30 #include <e-util/e-focus-tracker.h>
31 
32 /* Standard GObject macros */
33 #define E_TYPE_SELECTABLE \
34 	(e_selectable_get_type ())
35 #define E_SELECTABLE(obj) \
36 	(G_TYPE_CHECK_INSTANCE_CAST \
37 	((obj), E_TYPE_SELECTABLE, ESelectable))
38 #define E_IS_SELECTABLE(obj) \
39 	(G_TYPE_CHECK_INSTANCE_TYPE \
40 	((obj), E_TYPE_SELECTABLE))
41 #define E_SELECTABLE_GET_INTERFACE(obj) \
42 	(G_TYPE_INSTANCE_GET_INTERFACE \
43 	((obj), E_TYPE_SELECTABLE, ESelectableInterface))
44 
45 G_BEGIN_DECLS
46 
47 typedef struct _ESelectable ESelectable;
48 typedef struct _ESelectableInterface ESelectableInterface;
49 
50 struct _ESelectableInterface {
51 	GTypeInterface parent_iface;
52 
53 	/* Required Methods */
54 	void		(*update_actions)	(ESelectable *selectable,
55 						 EFocusTracker *focus_tracker,
56 						 GdkAtom *clipboard_targets,
57 						 gint n_clipboard_targets);
58 
59 	/* Optional Methods */
60 	void		(*cut_clipboard)	(ESelectable *selectable);
61 	void		(*copy_clipboard)	(ESelectable *selectable);
62 	void		(*paste_clipboard)	(ESelectable *selectable);
63 	void		(*delete_selection)	(ESelectable *selectable);
64 	void		(*select_all)		(ESelectable *selectable);
65 	void		(*undo)			(ESelectable *selectable);
66 	void		(*redo)			(ESelectable *selectable);
67 };
68 
69 GType		e_selectable_get_type		(void) G_GNUC_CONST;
70 void		e_selectable_update_actions	(ESelectable *selectable,
71 						 EFocusTracker *focus_tracker,
72 						 GdkAtom *clipboard_targets,
73 						 gint n_clipboard_targets);
74 void		e_selectable_cut_clipboard	(ESelectable *selectable);
75 void		e_selectable_copy_clipboard	(ESelectable *selectable);
76 void		e_selectable_paste_clipboard	(ESelectable *selectable);
77 void		e_selectable_delete_selection	(ESelectable *selectable);
78 void		e_selectable_select_all		(ESelectable *selectable);
79 void		e_selectable_undo		(ESelectable *selectable);
80 void		e_selectable_redo		(ESelectable *selectable);
81 GtkTargetList *	e_selectable_get_copy_target_list
82 						(ESelectable *selectable);
83 GtkTargetList *	e_selectable_get_paste_target_list
84 						(ESelectable *selectable);
85 
86 G_END_DECLS
87 
88 #endif /* E_SELECTABLE_H */
89