2 * Copyright (c) 2020 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 THEME_DBUS_REQUEST_BROKER_H_
18 #define THEME_DBUS_REQUEST_BROKER_H_
26 #include "theme/dbus/request_filter.h"
33 static RequestBroker& GetInst();
34 GDBusConnection* GetConnection();
36 int RegisterRequestFilter(RequestFilter filter);
37 bool EmitSignal(std::string signal_name,
38 Command cmd, tizen_base::Bundle data);
41 tizen_base::Bundle SendData(Command cmd, tizen_base::Bundle&);
42 void SendDataAsync(Command cmd, tizen_base::Bundle&);
45 void OnReceiveDbusMethod(GDBusConnection* connection,
46 const gchar* sender, const gchar* object_path,
47 const gchar* interface_name, const gchar* method_name,
48 GVariant* parameters, GDBusMethodInvocation* invocation,
51 RequestBroker() : registration_id_(0), subscribe_id_(0),
52 connection_(nullptr) {}
53 ~RequestBroker() = default;
58 GDBusConnection* connection_;
59 std::map<Command, RequestFilter> filters_;
65 #endif // THEME_DBUS_REQUEST_BROKER_H_