1 /*
2  * action-button: A button representing an action to execute when clicked
3  *
4  * Copyright 2012-2020 Stephan Haller <nomad@froevel.de>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  * MA 02110-1301, USA.
20  *
21  *
22  */
23 
24 #ifndef __LIBXFDASHBOARD_ACTION_BUTTON__
25 #define __LIBXFDASHBOARD_ACTION_BUTTON__
26 
27 #if !defined(__LIBXFDASHBOARD_H_INSIDE__) && !defined(LIBXFDASHBOARD_COMPILATION)
28 #error "Only <libxfdashboard/libxfdashboard.h> can be included directly."
29 #endif
30 
31 #include <libxfdashboard/button.h>
32 
33 G_BEGIN_DECLS
34 
35 #define XFDASHBOARD_TYPE_ACTION_BUTTON				(xfdashboard_action_button_get_type())
36 #define XFDASHBOARD_ACTION_BUTTON(obj)				(G_TYPE_CHECK_INSTANCE_CAST((obj), XFDASHBOARD_TYPE_ACTION_BUTTON, XfdashboardActionButton))
37 #define XFDASHBOARD_IS_ACTION_BUTTON(obj)			(G_TYPE_CHECK_INSTANCE_TYPE((obj), XFDASHBOARD_TYPE_ACTION_BUTTON))
38 #define XFDASHBOARD_ACTION_BUTTON_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST((klass), XFDASHBOARD_TYPE_ACTION_BUTTON, XfdashboardActionButtonClass))
39 #define XFDASHBOARD_IS_ACTION_BUTTON_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((klass), XFDASHBOARD_TYPE_ACTION_BUTTON))
40 #define XFDASHBOARD_ACTION_BUTTON_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS((obj), XFDASHBOARD_TYPE_ACTION_BUTTON, XfdashboardActionButtonClass))
41 
42 typedef struct _XfdashboardActionButton				XfdashboardActionButton;
43 typedef struct _XfdashboardActionButtonClass		XfdashboardActionButtonClass;
44 typedef struct _XfdashboardActionButtonPrivate		XfdashboardActionButtonPrivate;
45 
46 /**
47  * XfdashboardActionButton:
48  *
49  * The #XfdashboardActionButton structure contains only private data and
50  * should be accessed using the provided API
51  */
52 struct _XfdashboardActionButton
53 {
54 	/*< private >*/
55 	/* Parent instance */
56 	XfdashboardButton						parent_instance;
57 
58 	/* Private structure */
59 	XfdashboardActionButtonPrivate			*priv;
60 };
61 
62 /**
63  * XfdashboardActionButtonClass:
64  *
65  * The #XfdashboardActionButtonClass structure contains only private data
66  */
67 struct _XfdashboardActionButtonClass
68 {
69 	/*< private >*/
70 	/* Parent class */
71 	XfdashboardButtonClass					parent_class;
72 
73 	/*< public >*/
74 	/* Virtual functions */
75 };
76 
77 /* Public API */
78 GType xfdashboard_action_button_get_type(void) G_GNUC_CONST;
79 
80 ClutterActor* xfdashboard_action_button_new(void);
81 
82 const gchar* xfdashboard_action_button_get_target(XfdashboardActionButton *self);
83 void xfdashboard_action_button_set_target(XfdashboardActionButton *self, const gchar *inTarget);
84 
85 const gchar* xfdashboard_action_button_get_action(XfdashboardActionButton *self);
86 void xfdashboard_action_button_set_action(XfdashboardActionButton *self, const gchar *inAction);
87 
88 G_END_DECLS
89 
90 #endif	/* __LIBXFDASHBOARD_ACTION_BUTTON__ */
91