Tizen 2.4 SDK Rev6 Release
[apps/home/minicontrol.git] / include / minicontrol-internal.h
1 /*
2  * Copyright (c)  2013-2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef _MINICTRL_INTERNAL_H_
18 #define _MINICTRL_INTERNAL_H_
19
20 #include <dbus/dbus.h>
21 #include <sys/types.h>
22 #include <unistd.h>
23 #include <bundle.h>
24 #include "minicontrol-type.h"
25
26 #ifndef EXPORT_API
27 #define EXPORT_API __attribute__ ((visibility("default")))
28 #endif /* EXPORT_API */
29
30 #define MINICTRL_DBUS_SIG_RUNNING_REQ "minicontrol_running_request"
31
32 #define MINICTRL_DBUS_SIG_TO_PROVIDER "minicontrol_signal_to_provider"
33 #define MINICTRL_DBUS_SIG_TO_VIEWER   "minicontrol_signal_to_viewer"
34
35 #define BUNDLE_BUFFER_LENGTH 100
36
37 /**
38  * @brief Enumeration for describing type of dbus.
39  */
40
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 */
44 };
45
46 /**
47  * @brief Enumeration for describing type of actions allowed to inhouse apps.
48  * @since_tizen 2.4
49  */
50 typedef enum {
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;
58
59 /**
60  * @brief Enumeration for describing priority of a minicontrol provider.
61  * @since_tizen 2.4
62  */
63 typedef enum {
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;
68
69 /**
70  * @brief Enumeration for describing type of events originated by a minicontrol provider.
71  * @since_tizen 2.4
72  */
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;
79
80 typedef enum {
81         MINICONTROL_EVENT_REQUEST_LOCK = 1001, /**< A minicontrol object should not be removed by user */
82 } minicontrol_internal_provider_event_e;
83
84 typedef struct _minictrl_sig_handle minictrl_sig_handle;
85
86 int _minictrl_provider_message_send(int event, const char *minicontrol_name, unsigned int witdh, unsigned int height, minicontrol_priority_e priority);
87
88 int _minictrl_viewer_req_message_send(void);
89
90 minictrl_sig_handle *_minictrl_dbus_sig_handle_attach(const char *signal,
91                                 void (*callback) (void *data, DBusMessage *msg),
92                                 void *data);
93
94 void _minictrl_dbus_sig_handle_dettach(minictrl_sig_handle *handle);
95
96 int _minictrl_provider_proc_send(int type);
97
98 /* new */
99 int _minictrl_send_event(const char *signal_name, const char *minicontrol_name, int event, bundle *signal_arg);
100
101 #endif /* _MINICTRL_INTERNAL_H_ */
102