2
* Copyright (C) 2009 Canonical, Ltd.
4
* This library is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License
6
* version 3.0 as published by the Free Software Foundation.
8
* This library is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License version 3.0 for more details.
13
* You should have received a copy of the GNU Lesser General Public
14
* License along with this library. If not, see
15
* <http://www.gnu.org/licenses/>.
17
* Authored by Mikkel Kamstrup Erlandsen <mikkel.kamstrup@canonical.com>
20
#if !defined (_DEE_H_INSIDE) && !defined (DEE_COMPILATION)
21
#error "Only <dee.h> can be included directly."
24
#ifndef _HAVE_DEE_TRANSACTION_H
25
#define _HAVE_DEE_TRANSACTION_H
28
#include <glib-object.h>
30
#include <dee-model.h>
31
#include <dee-serializable-model.h>
35
#define DEE_TYPE_TRANSACTION (dee_transaction_get_type ())
37
#define DEE_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
38
DEE_TYPE_TRANSACTION, DeeTransaction))
40
#define DEE_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
41
DEE_TYPE_TRANSACTION, DeeTransactionClass))
43
#define DEE_IS_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
44
DEE_TYPE_TRANSACTION))
46
#define DEE_IS_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
47
DEE_TYPE_TRANSACTION))
49
#define DEE_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
50
DBUS_TYPE_SEQUENCE_MODEL, DeeTransactionClass))
52
typedef struct _DeeTransaction DeeTransaction;
53
typedef struct _DeeTransactionClass DeeTransactionClass;
54
typedef struct _DeeTransactionPrivate DeeTransactionPrivate;
59
* All fields in the DeeTransaction structure are private and should never be
62
struct _DeeTransaction
65
DeeSerializableModel parent;
67
DeeTransactionPrivate *priv;
70
struct _DeeTransactionClass
73
DeeSerializableModelClass parent_class;
76
void (*_dee_transaction_1) (void);
77
void (*_dee_transaction_2) (void);
78
void (*_dee_transaction_3) (void);
79
void (*_dee_transaction_4) (void);
83
* DEE_TRANSACTION_ERROR:
85
* Error domain for the #DeeTransaction. Error codes will be from the
86
* #DeeTransactionError enumeration
88
#define DEE_TRANSACTION_ERROR dee_transaction_error_quark()
91
* DeeTransactionError:
93
* Error codes for the #DeeTransaction class. These codes will be set when the
94
* error domain is #DEE_TRANSACTION_ERROR.
96
* @DEE_TRANSACTION_ERROR_CONCURRENT_MODIFICATION: The target model has been
97
* modified while the transaction was open.
99
* @DEE_TRANSACTION_ERROR_COMMITTED: Raised when someone tries to commit a
100
* transaction that has already been committed
103
DEE_TRANSACTION_ERROR_CONCURRENT_MODIFICATION = 1,
104
DEE_TRANSACTION_ERROR_COMMITTED = 2,
105
} DeeTransactionError;
108
* dee_transaction_get_type:
110
* The GType of #DeeTransaction
112
* Return value: the #GType of #DeeTransaction
114
GType dee_transaction_get_type (void);
116
DeeModel* dee_transaction_new (DeeModel *target);
118
DeeModel* dee_transaction_get_target (DeeTransaction *self);
120
gboolean dee_transaction_is_committed (DeeTransaction *self);
122
gboolean dee_transaction_commit (DeeTransaction *self,
125
GQuark dee_transaction_error_quark (void);
129
#endif /* _HAVE_DEE_TRANSACTION_H */