2 * Copyright (c) 2013-2015 Samsung Electronics Co., Ltd All Rights Reserved
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 _MINICTRL_INTERNAL_H_
18 #define _MINICTRL_INTERNAL_H_
20 #include <dbus/dbus.h>
21 #include <sys/types.h>
24 #include "minicontrol-type.h"
27 #define EXPORT_API __attribute__ ((visibility("default")))
28 #endif /* EXPORT_API */
30 #define MINICTRL_DBUS_SIG_RUNNING_REQ "minicontrol_running_request"
32 #define MINICTRL_DBUS_SIG_TO_PROVIDER "minicontrol_signal_to_provider"
33 #define MINICTRL_DBUS_SIG_TO_VIEWER "minicontrol_signal_to_viewer"
35 #define BUNDLE_BUFFER_LENGTH 100
38 * @brief Enumeration for describing type of dbus.
41 enum _minictrl_PROC_DBUS_TYPE {
42 MINICONTROL_DBUS_PROC_EXCLUDE, /**< Request to exclude from the unfreezing process list */
43 MINICONTROL_DBUS_PROC_INCLUDE, /**< Request to include to the unfreezing process list */
47 * @brief Enumeration for describing type of actions allowed to inhouse apps.
51 MINICONTROL_REQ_NONE = 0,
52 MINICONTROL_REQ_HIDE_VIEWER = 100, /**< Requests that the minicontrol viewer(s) close the provider's minicontrol */
53 MINICONTROL_REQ_FREEZE_SCROLL_VIEWER, /**< Requests that the minicontrol viewer(s) freeze its window scroll */
54 MINICONTROL_REQ_UNFREEZE_SCROLL_VIEWER, /**< Requests that the minicontrol viewer(s) unfreeze its window scroll */
55 MINICONTROL_REQ_REPORT_VIEWER_ANGLE, /**< Requests the current angle of the minicontrol viewer */
56 MINICONTROL_REQ_ROTATE_PROVIDER = 200, /**< Requests that the minicontrol provider rotate the provider's minicontrol */
57 } minicontrol_request_e;
60 * @brief Enumeration for describing priority of a minicontrol provider.
64 MINICONTROL_PRIORITY_TOP = 1000, /**< Top priority */
65 MINICONTROL_PRIORITY_MIDDLE = 100, /**< Middle priority */
66 MINICONTROL_PRIORITY_LOW = 1, /**< Low priority */
67 } minicontrol_priority_e;
70 * @brief Enumeration for describing type of events originated by a minicontrol provider.
73 typedef enum _minicontrol_action {
74 MINICONTROL_ACTION_START = 0, /**< A minicontrol object is created */
75 MINICONTROL_ACTION_STOP, /**< A minicontrol object is deleted */
76 MINICONTROL_ACTION_RESIZE, /**< A minicontrol object is resized */
77 MINICONTROL_ACTION_REQUEST, /**< the viewer of the minicontrol object is asked to do something */
78 } minicontrol_action_e;
81 MINICONTROL_EVENT_REQUEST_LOCK = 1001, /**< A minicontrol object should not be removed by user */
82 } minicontrol_internal_provider_event_e;
84 typedef struct _minictrl_sig_handle minictrl_sig_handle;
86 int _minictrl_provider_message_send(int event, const char *minicontrol_name, unsigned int witdh, unsigned int height, minicontrol_priority_e priority);
88 int _minictrl_viewer_req_message_send(void);
90 minictrl_sig_handle *_minictrl_dbus_sig_handle_attach(const char *signal,
91 void (*callback) (void *data, DBusMessage *msg),
94 void _minictrl_dbus_sig_handle_dettach(minictrl_sig_handle *handle);
96 int _minictrl_provider_proc_send(int type);
99 int _minictrl_send_event(const char *signal_name, const char *minicontrol_name, int event, bundle *signal_arg);
101 #endif /* _MINICTRL_INTERNAL_H_ */