~ubuntu-branches/ubuntu/precise/nautilus-actions/precise

« back to all changes in this revision

Viewing changes to libnautilus-actions/nautilus-actions-config.h

  • Committer: Bazaar Package Importer
  • Author(s): Christine Spang
  • Date: 2009-08-12 14:04:00 UTC
  • mfrom: (1.1.6 upstream) (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090812140400-ufe3o3jvr62lf0sf
Tags: 1.12.0-1
* New upstream stable release.
  - Actions can now be enabled/disabled: disabled actions will
    never show up in the nautilus context menu
  - Gnome Bugzilla bugs fixed:
    - #325519 asked by Frederic Ruaudel (enabled property)
    - #590398 reported by Pierre Wieser (install doc)
    - #590399 reported by Pierre Wieser (gtk_image_menu_item_set_image)
    - #590709 reported by Claude Paroz (markup in translatable strings)
    - #590711 reported by Claude Paroz (pipe char is ambiguous to translate)
 - Do not install GConf schemas if --disable-schemas-install option has
   been specified
 - New/updated es and fr translations

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Nautilus Actions
3
 
 *
4
 
 * Copyright (C) 2005 The GNOME Foundation
5
 
 * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
6
 
 * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
7
 
 *
8
 
 * This Program is free software; you can redistribute it and/or
9
 
 * modify it under the terms of the GNU General Public License as
10
 
 * published by the Free Software Foundation; either version 2 of
11
 
 * the License, or (at your option) any later version.
12
 
 *
13
 
 * This Program is distributed in the hope that it will be useful,
14
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
 * GNU General Public License for more details.
17
 
 *
18
 
 * You should have received a copy of the GNU General Public
19
 
 * License along with this Library; see the file COPYING.  If not,
20
 
 * write to the Free Software Foundation, Inc., 59 Temple Place,
21
 
 * Suite 330, Boston, MA 02111-1307, USA.
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 __NAUTILUS_ACTIONS_CONFIG_H__
31
 
#define __NAUTILUS_ACTIONS_CONFIG_H__
32
 
 
33
 
#include <glib/glist.h>
34
 
#include <glib-object.h>
35
 
#include <glib.h>
36
 
#include <stdio.h>
37
 
#include <string.h>
38
 
 
39
 
G_BEGIN_DECLS
40
 
 
41
 
/* Error data */
42
 
#define NAUTILUS_ACTIONS_CONFIG_ERROR g_quark_from_string ("nautilus_actions_config")
43
 
 
44
 
typedef enum
45
 
{
46
 
        NAUTILUS_ACTIONS_CONFIG_ERROR_FAILED
47
 
} NautilusActionsConfigError;
48
 
 
49
 
#define NAUTILUS_ACTIONS_TYPE_CONFIG            (nautilus_actions_config_get_type())
50
 
#define NAUTILUS_ACTIONS_CONFIG(obj)            (G_TYPE_CHECK_INSTANCE_CAST (obj, NAUTILUS_ACTIONS_TYPE_CONFIG, NautilusActionsConfig))
51
 
#define NAUTILUS_ACTIONS_CONFIG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST (klass, NAUTILUS_ACTIONS_TYPE_CONFIG, NautilusActionsConfigClass))
52
 
#define NAUTILUS_ACTIONS_IS_CONFIG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE(obj, NAUTILUS_ACTIONS_TYPE_CONFIG))
53
 
#define NAUTILUS_ACTIONS_IS_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NAUTILUS_ACTIONS_TYPE_CONFIG))
54
 
#define NAUTILUS_ACTIONS_CONFIG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), NAUTILUS_ACTIONS_TYPE_CONFIG, NautilusActionsConfigClass))
55
 
 
56
 
/* i18n notes : default profile name displayed in the profile list in
57
 
 * the action edition dialog
58
 
 */
59
 
#define NAUTILUS_ACTIONS_DEFAULT_PROFILE_DESC_NAME _("Main")
60
 
#define NAUTILUS_ACTIONS_DEFAULT_PROFILE_NAME "main"
61
 
 
62
 
/* i18n notes : default profile name displayed in the profile list in
63
 
 * the action edition dialog when more than one profile is created
64
 
 * (incremented each time) (please keep the string lowercase if possible)
65
 
 */
66
 
#define NAUTILUS_ACTIONS_DEFAULT_OTHER_PROFILE_DESC_NAME _("Profile %d")
67
 
#define NAUTILUS_ACTIONS_DEFAULT_OTHER_PROFILE_NAME "profile%d"
68
 
 
69
 
typedef struct {
70
 
        gchar *desc_name;
71
 
        gchar *path;
72
 
        gchar *parameters;
73
 
        gboolean match_case;
74
 
        GSList *basenames;
75
 
        GSList *mimetypes;
76
 
        gboolean is_dir;
77
 
        gboolean is_file;
78
 
        gboolean accept_multiple_files;
79
 
        GSList *schemes;
80
 
} NautilusActionsConfigActionProfile;
81
 
 
82
 
typedef struct {
83
 
        gchar *conf_section;
84
 
        gchar *uuid;
85
 
        gchar *label;
86
 
        gchar *tooltip;
87
 
        gchar *icon;
88
 
        GHashTable *profiles; /* Hash of NautilusActionsConfigActionProfile* */
89
 
        gchar *version;
90
 
} NautilusActionsConfigAction;
91
 
 
92
 
typedef struct _NautilusActionsConfig NautilusActionsConfig;
93
 
typedef struct _NautilusActionsConfigClass NautilusActionsConfigClass;
94
 
 
95
 
struct _NautilusActionsConfig {
96
 
        GObject parent;
97
 
 
98
 
        /* Private data, don't access */
99
 
        GHashTable *actions;
100
 
};
101
 
 
102
 
struct _NautilusActionsConfigClass {
103
 
        GObjectClass parent_class;
104
 
 
105
 
        /* Virtual private function */
106
 
        gboolean (* save_action) (NautilusActionsConfig *config, NautilusActionsConfigAction *action);
107
 
        gboolean (* remove_action) (NautilusActionsConfig *config, NautilusActionsConfigAction *action);
108
 
 
109
 
        /* Signals handler signature */
110
 
        void (* action_added) (NautilusActionsConfig *config, NautilusActionsConfigAction *action, gpointer user_data);
111
 
        void (* action_changed) (NautilusActionsConfig *config, NautilusActionsConfigAction *action, gpointer user_data);
112
 
        void (* action_removed) (NautilusActionsConfig *config, NautilusActionsConfigAction *action, gpointer user_data);
113
 
};
114
 
 
115
 
GType                        nautilus_actions_config_get_type (void);
116
 
 
117
 
NautilusActionsConfigAction *nautilus_actions_config_get_action (NautilusActionsConfig *config, const gchar *uuid);
118
 
GSList                      *nautilus_actions_config_get_actions (NautilusActionsConfig *config);
119
 
 
120
 
/* function to free a list returned by nautilus_actions_config_get_actions () */
121
 
void                         nautilus_actions_config_free_actions_list (GSList *list);
122
 
gboolean                     nautilus_actions_config_add_action (NautilusActionsConfig *config,
123
 
                                                                 NautilusActionsConfigAction *action, GError** error);
124
 
gboolean                     nautilus_actions_config_update_action (NautilusActionsConfig *config,
125
 
                                                                    NautilusActionsConfigAction *action);
126
 
gboolean                     nautilus_actions_config_remove_action (NautilusActionsConfig *config,
127
 
                                                                    const gchar *label);
128
 
 
129
 
/* function to clear the actions list stored in the nautilus_actions_config object */
130
 
gboolean                     nautilus_actions_config_clear (NautilusActionsConfig *config);
131
 
 
132
 
NautilusActionsConfigActionProfile *nautilus_actions_config_action_profile_new (void);
133
 
NautilusActionsConfigActionProfile *nautilus_actions_config_action_profile_new_default (void);
134
 
gboolean                     nautilus_actions_config_action_profile_exists (NautilusActionsConfigAction *action,
135
 
                                                                         const gchar* profile_name);
136
 
GSList                          *nautilus_actions_config_action_get_all_profile_names (NautilusActionsConfigAction *action);
137
 
void                 nautilus_actions_config_action_free_all_profile_names( GSList *list );
138
 
gchar               *nautilus_actions_config_action_get_first_profile_name( const NautilusActionsConfigAction *action );
139
 
void                             nautilus_actions_config_action_get_new_default_profile_name (NautilusActionsConfigAction *action,
140
 
                                                                        gchar** new_profile_name,
141
 
                                                                        gchar** new_profile_desc_name);
142
 
NautilusActionsConfigActionProfile *nautilus_actions_config_action_get_profile (NautilusActionsConfigAction *action,
143
 
                                                                         const gchar* profile_name);
144
 
NautilusActionsConfigActionProfile *nautilus_actions_config_action_get_or_create_profile (NautilusActionsConfigAction *action,
145
 
                                                                         const gchar* profile_name);
146
 
gboolean                     nautilus_actions_config_action_add_profile (NautilusActionsConfigAction *action,
147
 
                                                                         const gchar* profile_name,
148
 
                                                                         NautilusActionsConfigActionProfile* profile,
149
 
                                                                         GError** error);
150
 
void                         nautilus_actions_config_action_replace_profile (NautilusActionsConfigAction *action,
151
 
                                                                         const gchar* profile_name,
152
 
                                                                         NautilusActionsConfigActionProfile* profile);
153
 
gboolean                     nautilus_actions_config_action_remove_profile (NautilusActionsConfigAction *action,
154
 
                                                                         const gchar* profile_name);
155
 
gboolean                     nautilus_actions_config_action_rename_profile (NautilusActionsConfigAction *action,
156
 
                                                                         const gchar* old_profile_name,
157
 
                                                                         const gchar* new_profile_name,
158
 
                                                                         GError** error);
159
 
guint                        nautilus_actions_config_action_get_profiles_count( const NautilusActionsConfigAction *action );
160
 
 
161
 
 
162
 
NautilusActionsConfigAction *nautilus_actions_config_action_new (void);
163
 
NautilusActionsConfigAction *nautilus_actions_config_action_new_default (void);
164
 
 
165
 
void                         nautilus_actions_config_action_set_uuid (NautilusActionsConfigAction *action,
166
 
                                                                       const gchar *uuid);
167
 
void                         nautilus_actions_config_action_set_label (NautilusActionsConfigAction *action,
168
 
                                                                       const gchar *label);
169
 
void                         nautilus_actions_config_action_set_tooltip (NautilusActionsConfigAction *action,
170
 
                                                                         const gchar *tooltip);
171
 
void                         nautilus_actions_config_action_set_icon (NautilusActionsConfigAction *action,
172
 
                                                                         const gchar *icon);
173
 
void                         nautilus_actions_config_action_profile_set_desc_name (NautilusActionsConfigActionProfile *action_profile,
174
 
                                                                      const gchar *desc_name);
175
 
void                         nautilus_actions_config_action_profile_set_path (NautilusActionsConfigActionProfile *action_profile,
176
 
                                                                      const gchar *path);
177
 
void                         nautilus_actions_config_action_profile_set_parameters (NautilusActionsConfigActionProfile *action_profile,
178
 
                                                                            const gchar *parameters);
179
 
void                         nautilus_actions_config_action_profile_set_basenames (NautilusActionsConfigActionProfile *action_profile,
180
 
                                                                                 GSList *basenames);
181
 
void                         nautilus_actions_config_action_profile_set_mimetypes (NautilusActionsConfigActionProfile *action_profile,
182
 
                                                                                 GSList *mimetypes);
183
 
void                         nautilus_actions_config_action_profile_set_schemes (NautilusActionsConfigActionProfile *action_profile,
184
 
                                                                                 GSList *schemes);
185
 
 
186
 
#define nautilus_actions_config_action_profile_set_match_case(action_profile, b) { if ((action_profile)) (action_profile)->match_case = b; }
187
 
#define nautilus_actions_config_action_profile_set_is_dir(action_profile, b) { if ((action_profile)) (action_profile)->is_dir = b; }
188
 
#define nautilus_actions_config_action_profile_set_is_file(action_profile, b) { if ((action_profile)) (action_profile)->is_file = b; }
189
 
#define nautilus_actions_config_action_profile_set_accept_multiple(action_profile, b) { if ((action_profile)) (action_profile)->accept_multiple_files = b; }
190
 
 
191
 
NautilusActionsConfigActionProfile *nautilus_actions_config_action_profile_dup (NautilusActionsConfigActionProfile *action_profile);
192
 
void                         nautilus_actions_config_action_profile_free (NautilusActionsConfigActionProfile *action_profile);
193
 
 
194
 
NautilusActionsConfigAction *nautilus_actions_config_action_dup (NautilusActionsConfigAction *action);
195
 
NautilusActionsConfigAction *nautilus_actions_config_action_dup_new (NautilusActionsConfigAction *action);
196
 
void                         nautilus_actions_config_action_free (NautilusActionsConfigAction *action);
197
 
void                         nautilus_actions_config_action_dump (NautilusActionsConfigAction *action);
198
 
 
199
 
G_END_DECLS
200
 
 
201
 
#endif /* __NAUTILUS_ACTIONS_CONFIG_H__ */