3
* A Nautilus extension which offers configurable context menu actions.
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)
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.
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.
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.
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)
31
#ifndef __NACT_IDUPLICABLE_H__
32
#define __NACT_IDUPLICABLE_H__
35
* SECTION: na_iduplicable
36
* @short_description: #NAObject IDuplicable interface.
37
* @include: common/na-iduplicable.h
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.
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.
49
#include "na-object.h"
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 ))
58
typedef struct NAIDuplicable NAIDuplicable;
60
typedef struct NAIDuplicableInterfacePrivate NAIDuplicableInterfacePrivate;
63
GTypeInterface parent;
64
NAIDuplicableInterfacePrivate *private;
68
* @object: the #NAObject object to be duplicated.
70
* Allocates an exact copy of the specified #NAObject object.
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.
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.
80
* Returns: a newly allocated #NAObject object, which is an exact
83
NAObject * ( *duplicate )( const NAObject *object );
87
* @a: a first #NAObject object.
88
* @b: a second #NAObject object to be compared to the first one.
90
* Compares the two objects.
92
* The implementor should define a are_equal()-equivalent virtual
93
* function so that each #NAObject-derived class be able to check
96
* Returns: %TRUE if @a and @b are identical, %FALSE else.
98
gboolean ( *are_equal )( const NAObject *a, const NAObject *b );
102
* @object: the #NAObject object to be checked.
104
* Checks @object for validity.
106
* The implementor should define a is_valid()-equivalent virtual
107
* function so that each #NAObject-derived class be able to check
110
* Returns: %TRUE if @object is valid, %FALSE else.
112
gboolean ( *is_valid ) ( const NAObject *object );
114
NAIDuplicableInterface;
116
GType na_iduplicable_get_type( void );
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 );
129
#endif /* __NA_IDUPLICABLE_H__ */