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

« back to all changes in this revision

Viewing changes to src/common/na-iduplicable.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
 * A Nautilus extension which offers configurable context menu actions.
 
4
 *
 
5
 * Copyright (C) 2005 The GNOME Foundation
 
6
 * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
 
7
 * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
 
8
 *
 
9
 * This Program 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
 * This Program 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
 
17
 * GNU General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU General Public
 
20
 * License along with this Library; see the file COPYING.  If not,
 
21
 * write to the Free Software Foundation, Inc., 59 Temple Place,
 
22
 * Suite 330, Boston, MA 02111-1307, USA.
 
23
 *
 
24
 * Authors:
 
25
 *   Frederic Ruaudel <grumz@grumz.net>
 
26
 *   Rodrigo Moya <rodrigo@gnome-db.org>
 
27
 *   Pierre Wieser <pwieser@trychlos.org>
 
28
 *   ... and many others (see AUTHORS)
 
29
 */
 
30
 
 
31
#ifndef __NACT_IDUPLICABLE_H__
 
32
#define __NACT_IDUPLICABLE_H__
 
33
 
 
34
/**
 
35
 * SECTION: na_iduplicable
 
36
 * @short_description: #NAObject IDuplicable interface.
 
37
 * @include: common/na-iduplicable.h
 
38
 *
 
39
 * This interface is implemented by #NAObject in order to let
 
40
 * #NAObject-derived instance duplication be easily tracked. This works
 
41
 * by keeping a pointer on the original object at duplication time, and
 
42
 * then only checking status when explictely required.
 
43
 *
 
44
 * As the reference count of the original object is not incremented
 
45
 * here, the caller has to garantee himself that the original object
 
46
 * will stay in life at least as long as the duplicated one.
 
47
 */
 
48
 
 
49
#include "na-object.h"
 
50
 
 
51
G_BEGIN_DECLS
 
52
 
 
53
#define NA_IDUPLICABLE_TYPE                                                     ( na_iduplicable_get_type())
 
54
#define NA_IDUPLICABLE( object )                                        ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_IDUPLICABLE_TYPE, NAIDuplicable ))
 
55
#define NA_IS_IDUPLICABLE( object )                                     ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_IDUPLICABLE_TYPE ))
 
56
#define NA_IDUPLICABLE_GET_INTERFACE( instance )        ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_IDUPLICABLE_TYPE, NAIDuplicableInterface ))
 
57
 
 
58
typedef struct NAIDuplicable NAIDuplicable;
 
59
 
 
60
typedef struct NAIDuplicableInterfacePrivate NAIDuplicableInterfacePrivate;
 
61
 
 
62
typedef struct {
 
63
        GTypeInterface                 parent;
 
64
        NAIDuplicableInterfacePrivate *private;
 
65
 
 
66
        /**
 
67
         * duplicate:
 
68
         * @object: the #NAObject object to be duplicated.
 
69
         *
 
70
         * Allocates an exact copy of the specified #NAObject object.
 
71
         *
 
72
         * The implementor should define a duplicate()-equivalent virtual
 
73
         * function in order the new #NAObject-derived object be allocated
 
74
         * with the right most-derived class.
 
75
         *
 
76
         * The implementor should also define a copy()-equivalent virtual
 
77
         * function so that each class in the derivation hierarchy be able
 
78
         * to copy its own data and properties to the target instance.
 
79
         *
 
80
         * Returns: a newly allocated #NAObject object, which is an exact
 
81
         * copy of @object.
 
82
         */
 
83
        NAObject * ( *duplicate )( const NAObject *object );
 
84
 
 
85
        /**
 
86
         * are_equal:
 
87
         * @a: a first #NAObject object.
 
88
         * @b: a second #NAObject object to be compared to the first one.
 
89
         *
 
90
         * Compares the two objects.
 
91
         *
 
92
         * The implementor should define a are_equal()-equivalent virtual
 
93
         * function so that each #NAObject-derived class be able to check
 
94
         * for identity.
 
95
         *
 
96
         * Returns: %TRUE if @a and @b are identical, %FALSE else.
 
97
         */
 
98
        gboolean   ( *are_equal )( const NAObject *a, const NAObject *b );
 
99
 
 
100
        /**
 
101
         * is_valid:
 
102
         * @object: the #NAObject object to be checked.
 
103
         *
 
104
         * Checks @object for validity.
 
105
         *
 
106
         * The implementor should define a is_valid()-equivalent virtual
 
107
         * function so that each #NAObject-derived class be able to check
 
108
         * for validity.
 
109
         *
 
110
         * Returns: %TRUE if @object is valid, %FALSE else.
 
111
         */
 
112
        gboolean   ( *is_valid ) ( const NAObject *object );
 
113
}
 
114
        NAIDuplicableInterface;
 
115
 
 
116
GType     na_iduplicable_get_type( void );
 
117
 
 
118
void      na_iduplicable_init( NAObject *object );
 
119
void      na_iduplicable_dump( const NAObject *object );
 
120
NAObject *na_iduplicable_duplicate( const NAObject *object );
 
121
void      na_iduplicable_check_edited_status( const NAObject *object );
 
122
gboolean  na_iduplicable_is_modified( const NAObject *object );
 
123
gboolean  na_iduplicable_is_valid( const NAObject *object );
 
124
NAObject *na_iduplicable_get_origin( const NAObject *object );
 
125
void      na_iduplicable_set_origin( NAObject *object, const NAObject *origin );
 
126
 
 
127
G_END_DECLS
 
128
 
 
129
#endif /* __NA_IDUPLICABLE_H__ */