2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef _CONTEXT_DBUS_SERVER_H_
18 #define _CONTEXT_DBUS_SERVER_H_
30 static void publish(std::string dest, int reqId, std::string subject, int error, std::string data);
31 static void call(std::string dest, std::string obj, std::string iface, std::string method, GVariant *param);
36 static void __onMethodCalled(GDBusConnection *conn, const gchar *sender,
37 const gchar *path, const gchar *iface, const gchar *name,
38 GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data);
39 static void __onBusAcquired(GDBusConnection *conn, const gchar *name, gpointer userData);
40 static void __onNameAcquired(GDBusConnection *conn, const gchar *name, gpointer userData);
41 static void __onNameLost(GDBusConnection *conn, const gchar *name, gpointer userData);
42 static void __onCallDone(GObject *source, GAsyncResult *res, gpointer userData);
46 void __publish(const char *dest, int reqId, const char *subject, int error, const char *data);
47 void __call(const char *dest, const char *obj, const char *iface, const char *method, GVariant *param);
49 void __processRequest(const char *sender, GVariant *param, GDBusMethodInvocation *invocation);
50 void __reply(GDBusMethodInvocation *invocation, int error);
52 static DBusServer *__theInstance;
55 GDBusConnection *__connection;
56 GDBusNodeInfo *__nodeInfo;
60 }; /* class ctx::DBusServer */
64 #endif /* End of _CONTEXT_DBUS_SERVER_H_ */