posix: Fix dup0 wrappers in POSIX profile
[vala-lang.git] / vapi / dbus-glib-1.vapi
blob11f7bd6b754dc3c44e98e9160b0939eefaba838e
1 /* dbus-glib-1.vala
2  *
3  * Copyright (C) 2007-2009  Jürg Billeter
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
18  *
19  * Author:
20  *      Jürg Billeter <j@bitron.ch>
21  */
23 [CCode (cheader_filename = "dbus/dbus-glib-lowlevel.h,dbus/dbus-glib.h")]
24 namespace DBus {
25         [CCode (cprefix = "DBUS_BUS_")]
26         public enum BusType {
27                 SESSION,
28                 SYSTEM,
29                 STARTER
30         }
32         namespace RawBus {
33                 [CCode (cname = "dbus_bus_get")]
34                 public static RawConnection get (BusType type, ref RawError error);
35         }
37         [CCode (ref_function = "dbus_connection_ref", unref_function = "dbus_connection_unref", cname = "DBusConnection")]
38         public class RawConnection {
39                 [CCode (cname = "dbus_connection_setup_with_g_main")]
40                 public void setup_with_main (GLib.MainContext? context = null);
41                 [CCode (cname = "dbus_connection_get_g_connection")]
42                 public Connection get_g_connection ();
43                 [CCode (cname = "dbus_connection_register_g_object")]
44                 public void register_object (string at_path, GLib.Object object);
45         }
47         [CCode (cname = "DBusError", cprefix = "dbus_error_", destroy_function = "dbus_error_free")]
48         public struct RawError {
49                 public string name;
50                 public string message;
52                 public RawError ();
53                 public bool has_name (string name);
54                 public bool is_set ();
55         }
57         [DBus (name = "org.freedesktop.DBus.Error")]
58         [CCode (cname = "DBusGError", lower_case_csuffix = "gerror", cprefix = "DBUS_GERROR_")]
59         public errordomain Error {
60                 FAILED,
61                 NO_MEMORY,
62                 SERVICE_UNKNOWN,
63                 NAME_HAS_NO_OWNER,
64                 NO_REPLY,
65                 [DBus (name = "IOError")]
66                 IO_ERROR,
67                 BAD_ADDRESS,
68                 NOT_SUPPORTED,
69                 LIMITS_EXCEEDED,
70                 ACCESS_DENIED,
71                 AUTH_FAILED,
72                 NO_SERVER,
73                 TIMEOUT,
74                 NO_NETWORK,
75                 ADDRESS_IN_USE,
76                 DISCONNECTED,
77                 INVALID_ARGS,
78                 FILE_NOT_FOUND,
79                 FILE_EXISTS,
80                 UNKNOWN_METHOD,
81                 TIMED_OUT,
82                 MATCH_RULE_NOT_FOUND,
83                 MATCH_RULE_INVALID,
84                 [DBus (name = "Spawn.ExecFailed")]
85                 SPAWN_EXEC_FAILED,
86                 [DBus (name = "Spawn.ForkFailed")]
87                 SPAWN_FORK_FAILED,
88                 [DBus (name = "Spawn.ChildExited")]
89                 SPAWN_CHILD_EXITED,
90                 [DBus (name = "Spawn.ChildSignaled")]
91                 SPAWN_CHILD_SIGNALED,
92                 [DBus (name = "Spawn.Failed")]
93                 SPAWN_FAILED,
94                 UNIX_PROCESS_ID_UNKNOWN,
95                 INVALID_SIGNATURE,
96                 INVALID_FILE_CONTENT,
97                 [DBus (name = "SELinuxSecurityContextUnknown")]
98                 SELINUX_SECURITY_CONTEXT_UNKNOWN,
99                 REMOTE_EXCEPTION
100         }
102         public struct Bus {
103                 [CCode (cname = "dbus_g_bus_get")]
104                 public static Connection get (BusType type) throws Error;
105         }
107         [Compact]
108         [CCode (ref_function = "dbus_g_connection_ref", unref_function = "dbus_g_connection_unref", cname = "DBusGConnection")]
109         public class Connection {
110                 [CCode (cname = "dbus_g_proxy_new_for_name")]
111                 public Object get_object (string name, string path, string? interface_ = null);
112                 [CCode (cname = "dbus_g_proxy_new_from_type")]
113                 public GLib.Object get_object_from_type (string name, string path, string interface_, GLib.Type type);
114                 [CCode (cname = "dbus_g_connection_register_g_object")]
115                 public void register_object (string at_path, GLib.Object object);
116                 [CCode (cname = "dbus_g_connection_lookup_g_object")]
117                 public weak GLib.Object lookup_object (string at_path);
118                 [CCode (cname = "dbus_g_connection_get_connection")]
119                 public RawConnection get_connection ();
120         }
122         [CCode (cname = "DBusGProxy", lower_case_csuffix = "g_proxy")]
123         public class Object : GLib.Object {
124                 public bool call (string method, out GLib.Error error, GLib.Type first_arg_type, ...);
125                 public weak ProxyCall begin_call (string method, ProxyCallNotify notify, GLib.DestroyNotify destroy, GLib.Type first_arg_type, ...);
126                 public bool end_call (ProxyCall call, out GLib.Error error, GLib.Type first_arg_type, ...);
127                 public void cancel_call (ProxyCall call);
128                 public weak string get_path ();
129                 public weak string get_bus_name ();
130                 public weak string get_interface ();
131         }
133         [CCode (cname = "char", const_cname = "const char", copy_function = "g_strdup", free_function = "g_free", cheader_filename = "stdlib.h,string.h,glib.h", type_id = "DBUS_TYPE_G_OBJECT_PATH", marshaller_type_name = "STRING", get_value_function = "g_value_get_string", set_value_function = "g_value_set_string", type_signature = "o")]
134         public class ObjectPath : string {
135                 [CCode (cname = "g_strdup")]
136                 public ObjectPath (string path);
137         }
139         [CCode (cname = "char", const_cname = "const char", copy_function = "g_strdup", free_function = "g_free", cheader_filename = "stdlib.h,string.h,glib.h", type_id = "DBUS_TYPE_G_OBJECT_PATH", marshaller_type_name = "STRING", get_value_function = "g_value_get_string", set_value_function = "g_value_set_string")]
140         public class BusName : string {
141                 [CCode (cname = "g_strdup")]
142                 public BusName (string bus_name);
143         }
145         [CCode (cname = "DBusGProxyCallNotify")]
146         public delegate void ProxyCallNotify (Object obj, ProxyCall call_id);
148         [CCode (cname = "DBusGProxyCall")]
149         public class ProxyCall {
150         }
152         [Flags]
153         public enum NameFlag {
154                 ALLOW_REPLACEMENT,
155                 REPLACE_EXISTING,
156                 DO_NOT_QUEUE
157         }
159         public enum RequestNameReply {
160                 PRIMARY_OWNER,
161                 IN_QUEUE,
162                 EXISTS,
163                 ALREADY_OWNER
164         }