2 * Copyright (c) 2009-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.
18 #include <Elementary.h>
20 #include <tzsh_quickpanel_service.h>
23 #include "quickpanel-ui.h"
26 /*******************************************************************
30 *****************************************************************/
32 #ifdef QP_SETTING_ENABLE
34 extern QP_Module settings;
35 extern QP_Module settings_view_featured;
36 extern QP_Module settings_view_all;
37 #endif /* QP_SETTING_ENABLE */
39 #ifdef QP_MINICTRL_ENABLE
40 extern QP_Module minictrl;
41 #endif /* QP_MINICTRL_ENABLE */
43 #ifdef QP_BRIGHTNESS_ENABLE
45 extern QP_Module brightness_ctrl;
46 #endif /* QP_BRIGHTNESS_ENABLE */
48 #ifdef QP_ANIMATED_IMAGE_ENABLE
49 extern QP_Module animated_image;
52 extern QP_Module vi_manager;
53 extern QP_Module pager;
56 extern QP_Module noti;
57 extern QP_Module activenoti;
58 extern QP_Module qp_datetime_controller;
59 extern QP_Module qp_datetime_view;
62 #ifdef QP_VOICE_CONTROL_ENABLE
63 extern QP_Module voice_control;
66 /* do not change the order of modules, result may be changed up to order */
67 static QP_Module *modules[] = {
70 &qp_datetime_controller,
72 #ifdef QP_SETTING_ENABLE
74 &settings_view_featured,
76 #endif /* QP_SETTING_ENABLE */
77 #ifdef QP_MINICTRL_ENABLE
79 #endif /* QP_MINICTRL_ENABLE */
80 #ifdef QP_BRIGHTNESS_ENABLE
82 #endif /* QP_BRIGHTNESS_ENABLE */
85 #ifdef QP_ANIMATED_IMAGE_ENABLE
88 #ifdef QP_VOICE_CONTROL_ENABLE
93 HAPI int quickpanel_modules_init(void *data)
97 retif(data == NULL, QP_FAIL, "Invalid parameter!");
99 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
100 if (modules[i]->init) {
101 modules[i]->init(data);
104 if (modules[i]->init_job_cb) {
105 ecore_job_add(modules[i]->init_job_cb, data);
112 HAPI int quickpanel_modules_fini(void *data)
116 retif(data == NULL, QP_FAIL, "Invalid parameter!");
118 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
119 if (modules[i]->fini) {
120 modules[i]->fini(data);
127 HAPI int quickpanel_modules_suspend(void *data)
131 retif(data == NULL, QP_FAIL, "Invalid parameter!");
133 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
134 if (modules[i]->suspend) {
135 modules[i]->suspend(data);
142 HAPI int quickpanel_modules_resume(void *data)
146 retif(data == NULL, QP_FAIL, "Invalid parameter!");
148 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
149 if (modules[i]->resume) {
150 modules[i]->resume(data);
157 HAPI int quickpanel_modules_hib_enter(void *data)
161 retif(data == NULL, QP_FAIL, "Invalid parameter!");
163 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
164 if (modules[i]->hib_enter) {
165 modules[i]->hib_enter(data);
172 HAPI int quickpanel_modules_hib_leave(void *data)
176 retif(data == NULL, QP_FAIL, "Invalid parameter!");
178 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
179 if (modules[i]->hib_leave) {
180 modules[i]->hib_leave(data);
187 /******************************************************************
191 ****************************************************************/
193 HAPI void quickpanel_modules_lang_change(void *data)
196 retif(data == NULL, , "Invalid parameter!");
198 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
199 if (modules[i]->lang_changed) {
200 modules[i]->lang_changed(data);
205 HAPI void quickpanel_modules_refresh(void *data)
208 retif(data == NULL, , "Invalid parameter!");
210 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
211 if (modules[i]->refresh) {
212 modules[i]->refresh(data);
217 /******************************************************************
219 * Quickpanel open/close Events
221 ****************************************************************/
222 HAPI int quickpanel_modules_opened(void *data)
226 retif(data == NULL, QP_FAIL, "Invalid parameter!");
228 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
229 if (modules[i]->qp_opened) {
230 modules[i]->qp_opened(data);
237 HAPI int quickpanel_modules_closed(void *data)
241 retif(data == NULL, QP_FAIL, "Invalid parameter!");
243 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
244 if (modules[i]->qp_closed) {
245 modules[i]->qp_closed(data);