summaryrefslogtreecommitdiff
path: root/src/eggdbus/eggdbusmethodinvocation.h
blob: 84f4d375095351f6b0311431d579179fc08a254d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
 * Copyright (C) 2008 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Author: David Zeuthen <davidz@redhat.com>
 */

#if !defined (_EGG_DBUS_COMPILATION) && !defined(_EGG_DBUS_INSIDE_EGG_DBUS_H)
#error "Only <eggdbus/eggdbus.h> can be included directly, this file may disappear or change contents."
#endif

#ifndef __EGG_DBUS_METHOD_INVOCATION_H
#define __EGG_DBUS_METHOD_INVOCATION_H

#include <eggdbus/eggdbustypes.h>

G_BEGIN_DECLS

#define EGG_DBUS_TYPE_METHOD_INVOCATION         (egg_dbus_method_invocation_get_type())
#define EGG_DBUS_METHOD_INVOCATION(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EGG_DBUS_TYPE_METHOD_INVOCATION, EggDBusMethodInvocation))
#define EGG_DBUS_METHOD_INVOCATION_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), EGG_DBUS_TYPE_METHOD_INVOCATION, EggDBusMethodInvocationClass))
#define EGG_DBUS_METHOD_INVOCATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EGG_DBUS_TYPE_METHOD_INVOCATION, EggDBusMethodInvocationClass))
#define EGG_DBUS_IS_METHOD_INVOCATION(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EGG_DBUS_TYPE_METHOD_INVOCATION))
#define EGG_DBUS_IS_METHOD_INVOCATION_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EGG_DBUS_TYPE_METHOD_INVOCATION))

typedef struct _EggDBusMethodInvocationClass EggDBusMethodInvocationClass;

struct _EggDBusMethodInvocation
{
  GObject parent_instance;
};

struct _EggDBusMethodInvocationClass
{
  GObjectClass parent_class;

  /*< private >*/
  /* Padding for future expansion */
  void (*_g_reserved0) (void);
  void (*_g_reserved1) (void);
  void (*_g_reserved2) (void);
  void (*_g_reserved3) (void);
  void (*_g_reserved4) (void);
  void (*_g_reserved5) (void);
  void (*_g_reserved6) (void);
  void (*_g_reserved7) (void);
};

GType                  egg_dbus_method_invocation_get_type (void) G_GNUC_CONST;

EggDBusMethodInvocation *egg_dbus_method_invocation_new                 (EggDBusMessage         *request_message,
                                                                         gpointer                source_tag);

gpointer               egg_dbus_method_invocation_get_source_tag       (EggDBusMethodInvocation *method_invocation);

EggDBusMessage        *egg_dbus_method_invocation_create_reply_message (EggDBusMethodInvocation *method_invocation);

EggDBusConnection     *egg_dbus_method_invocation_get_connection       (EggDBusMethodInvocation *method_invocation);

const gchar           *egg_dbus_method_invocation_get_caller           (EggDBusMethodInvocation *method_invocation);

void                   egg_dbus_method_invocation_add_destroy_notify   (EggDBusMethodInvocation *method_invocation,
                                                                        gpointer                 data,
                                                                        GDestroyNotify           func);

void                   egg_dbus_method_invocation_return_error         (EggDBusMethodInvocation *method_invocation,
                                                                        GQuark                   domain,
                                                                        gint                     code,
                                                                        const gchar             *format,
                                                                        ...) G_GNUC_PRINTF (4, 5);

void                   egg_dbus_method_invocation_return_error_valist  (EggDBusMethodInvocation *method_invocation,
                                                                        GQuark                   domain,
                                                                        gint                     code,
                                                                        const gchar             *format,
                                                                        va_list                  var_args);

void                   egg_dbus_method_invocation_return_error_literal (EggDBusMethodInvocation *method_invocation,
                                                                        GQuark                   domain,
                                                                        gint                     code,
                                                                        const gchar             *message);

void                   egg_dbus_method_invocation_return_gerror        (EggDBusMethodInvocation *method_invocation,
                                                                        GError                  *error);

void                   egg_dbus_method_invocation_return_dbus_error    (EggDBusMethodInvocation *method_invocation,
                                                                        const gchar             *name,
                                                                        const gchar             *format,
                                                                        ...) G_GNUC_PRINTF (3, 4);

void                   egg_dbus_method_invocation_return_dbus_error_valist (EggDBusMethodInvocation *method_invocation,
                                                                            const gchar             *name,
                                                                            const gchar             *format,
                                                                            va_list                  var_args);

void                   egg_dbus_method_invocation_return_dbus_error_literal (EggDBusMethodInvocation *method_invocation,
                                                                             const gchar             *name,
                                                                             const gchar             *message);


G_END_DECLS

#endif /* __EGG_DBUS_METHOD_INVOCATION_H */