1 /*
2  * Nautilus-Actions
3  * A Nautilus extension which offers configurable context menu actions.
4  *
5  * Copyright (C) 2005 The GNOME Foundation
6  * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS)
7  * Copyright (C) 2009-2014 Pierre Wieser and others (see AUTHORS)
8  *
9  * Nautilus-Actions is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 2 of
12  * the License, or (at your option) any later version.
13  *
14  * Nautilus-Actions is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with Nautilus-Actions; see the file COPYING. If not, see
21  * <http://www.gnu.org/licenses/>.
22  *
23  * Authors:
24  *   Frederic Ruaudel <grumz@grumz.net>
25  *   Rodrigo Moya <rodrigo@gnome-db.org>
26  *   Pierre Wieser <pwieser@trychlos.org>
27  *   ... and many others (see AUTHORS)
28  */
29 
30 #ifndef __BASE_ASSISTANT_H__
31 #define __BASE_ASSISTANT_H__
32 
33 /**
34  * SECTION: base_assistant
35  * @short_description: #BaseAssistant class definition.
36  * @include: nact/base-assistant.h
37  *
38  * This class is derived from BaseWindow class, and serves as a base
39  * class for all Nautilus-Actions assistants.
40  */
41 
42 #include "base-window.h"
43 
44 G_BEGIN_DECLS
45 
46 #define BASE_TYPE_ASSISTANT                ( base_assistant_get_type())
47 #define BASE_ASSISTANT( object )           ( G_TYPE_CHECK_INSTANCE_CAST( object, BASE_TYPE_ASSISTANT, BaseAssistant ))
48 #define BASE_ASSISTANT_CLASS( klass )      ( G_TYPE_CHECK_CLASS_CAST( klass, BASE_TYPE_ASSISTANT, BaseAssistantClass ))
49 #define BASE_IS_ASSISTANT( object )        ( G_TYPE_CHECK_INSTANCE_TYPE( object, BASE_TYPE_ASSISTANT ))
50 #define BASE_IS_ASSISTANT_CLASS( klass )   ( G_TYPE_CHECK_CLASS_TYPE(( klass ), BASE_TYPE_ASSISTANT ))
51 #define BASE_ASSISTANT_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), BASE_TYPE_ASSISTANT, BaseAssistantClass ))
52 
53 typedef struct _BaseAssistantPrivate       BaseAssistantPrivate;
54 
55 typedef struct {
56 	/*< private >*/
57 	BaseWindow            parent;
58 	BaseAssistantPrivate *private;
59 }
60 	BaseAssistant;
61 
62 typedef struct _BaseAssistantClassPrivate  BaseAssistantClassPrivate;
63 
64 /**
65  * BaseAssistantClass:
66  * @apply:   apply the result of the assistant.
67  * @prepare: prepare a page to be displayed.
68  *
69  * This defines the virtual method a derived class may, should or must implement.
70  */
71 typedef struct {
72 	/*< private >*/
73 	BaseWindowClass            parent;
74 	BaseAssistantClassPrivate *private;
75 
76 	/*< public >*/
77 	/**
78 	 * apply:
79 	 * @window: this #BaseAssistant instance.
80 	 * @assistant: the #GtkAssistant toplevel.
81 	 *
82 	 * Invoked when the user has clicked on the 'Apply' button.
83 	 */
84 	void ( *apply )  ( BaseAssistant *window, GtkAssistant *assistant );
85 
86 	/**
87 	 * prepare:
88 	 * @window: this #BaseAssistance instance.
89 	 * @assistant: the #GtkAssistant toplevel.
90 	 *
91 	 * Invoked when the Gtk+ runtime is preparing a page.
92 	 */
93 	void ( *prepare )( BaseAssistant *window, GtkAssistant *assistant, GtkWidget *page );
94 }
95 	BaseAssistantClass;
96 
97 /**
98  * Properties defined by the BaseAssistant class.
99  * They should be provided at object instanciation time.
100  */
101 #define BASE_PROP_QUIT_ON_ESCAPE				"base-assistant-quit-on-escape"
102 #define BASE_PROP_WARN_ON_ESCAPE				"base-assistant-warn-on-escape"
103 
104 GType base_assistant_get_type( void );
105 
106 G_END_DECLS
107 
108 #endif /* __BASE_ASSISTANT_H__ */
109