README: add deprecation notice
[nautilus-actions.git] / src / api / fma-icontext.h
blob579d0825d22dd97a5313cc938db49f4f014be90c
1 /*
2 * FileManager-Actions
3 * A file-manager extension which offers configurable context menu actions.
5 * Copyright (C) 2005 The GNOME Foundation
6 * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS)
7 * Copyright (C) 2009-2015 Pierre Wieser and others (see AUTHORS)
9 * FileManager-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.
14 * FileManager-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.
19 * You should have received a copy of the GNU General Public License
20 * along with FileManager-Actions; see the file COPYING. If not, see
21 * <http://www.gnu.org/licenses/>.
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)
30 #ifndef __FILEMANAGER_ACTIONS_API_ICONTEXT_H__
31 #define __FILEMANAGER_ACTIONS_API_ICONTEXT_H__
33 /**
34 * SECTION: icontext
35 * @title: FMAIContext
36 * @short_description: The Contextual Interface
37 * @include: filemanager-actions/fma-icontext.h
39 * This interface is implemented by all #FMAObject -derived objects
40 * whose the display in the file manager context menu is subject to
41 * some conditions.
43 * Implementors, typically #FMAObjectAction, #FMAObjectProfile and
44 * #FMAObjectMenu, host the required data as #FMADataBoxed in a dedicated
45 * FMA_FACTORY_CONDITIONS_GROUP data group.
48 #include <glib-object.h>
50 G_BEGIN_DECLS
52 #define FMA_TYPE_ICONTEXT ( fma_icontext_get_type())
53 #define FMA_ICONTEXT( instance ) ( G_TYPE_CHECK_INSTANCE_CAST( instance, FMA_TYPE_ICONTEXT, FMAIContext ))
54 #define FMA_IS_ICONTEXT( instance ) ( G_TYPE_CHECK_INSTANCE_TYPE( instance, FMA_TYPE_ICONTEXT ))
55 #define FMA_ICONTEXT_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), FMA_TYPE_ICONTEXT, FMAIContextInterface ))
57 typedef struct _FMAIContext FMAIContext;
58 typedef struct _FMAIContextInterfacePrivate FMAIContextInterfacePrivate;
60 /**
61 * FMAIContextInterface:
62 * @is_candidate: determines if the given FMAObject-derived object is
63 * candidate to display in the file manager.
65 * This interface manages all conditions relevant to a displayable status
66 * in the file manager.
68 typedef struct {
69 /*< private >*/
70 GTypeInterface parent;
71 FMAIContextInterfacePrivate *private;
73 /*< public >*/
74 /**
75 * is_candidate:
76 * @object: this FMAIContext object.
77 * @target: the initial target which triggered this function's stack.
78 * This target is defined in fma-object-item.h.
79 * @selection: the current selection as a GList of FileManagerFileInfo
80 * (see fma-fm-defines.h for these definitions).
82 * The FMAIContext implementor may take advantage of this
83 * virtual function to check for its own specific data. Only if the
84 * implementor does return %TRUE (or just doesn't implement this
85 * virtual), the conditions themselves will be checked.
87 * Returns: %TRUE if the @object may be a potential candidate, %FALSE
88 * else.
90 * Since: 2.30
92 gboolean ( *is_candidate )( FMAIContext *object, guint target, GList *selection );
94 FMAIContextInterface;
96 GType fma_icontext_get_type ( void );
98 gboolean fma_icontext_are_equal ( const FMAIContext *a, const FMAIContext *b );
99 gboolean fma_icontext_is_candidate ( const FMAIContext *context, guint target, GList *selection );
100 gboolean fma_icontext_is_valid ( const FMAIContext *context );
102 void fma_icontext_check_mimetypes ( const FMAIContext *context );
104 void fma_icontext_copy ( FMAIContext *context, const FMAIContext *source );
105 void fma_icontext_read_done ( FMAIContext *context );
106 void fma_icontext_set_scheme ( FMAIContext *context, const gchar *scheme, gboolean selected );
107 void fma_icontext_set_only_desktop( FMAIContext *context, const gchar *desktop, gboolean selected );
108 void fma_icontext_set_not_desktop ( FMAIContext *context, const gchar *desktop, gboolean selected );
109 void fma_icontext_replace_folder ( FMAIContext *context, const gchar *old, const gchar *new );
111 G_END_DECLS
113 #endif /* __FILEMANAGER_ACTIONS_API_ICONTEXT_H__ */