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.
22 /*******************************************************************
26 *****************************************************************/
28 #ifdef QP_SETTING_ENABLE
30 extern QP_Module settings;
31 extern QP_Module settings_view_featured;
32 extern QP_Module settings_view_all;
33 #endif /* QP_SETTING_ENABLE */
35 #ifdef QP_MINICTRL_ENABLE
36 extern QP_Module minictrl;
37 #endif /* QP_MINICTRL_ENABLE */
39 #ifdef QP_BRIGHTNESS_ENABLE
41 extern QP_Module brightness_ctrl;
42 #endif /* QP_BRIGHTNESS_ENABLE */
44 #ifdef QP_ANIMATED_IMAGE_ENABLE
45 extern QP_Module animated_image;
48 extern QP_Module vi_manager;
49 extern QP_Module pager;
52 extern QP_Module noti;
53 extern QP_Module activenoti;
54 extern QP_Module qp_datetime_controller;
55 extern QP_Module qp_datetime_view;
57 /* do not change the order of modules, result may be changed up to order */
58 static QP_Module *modules[] = {
61 &qp_datetime_controller,
63 #ifdef QP_SETTING_ENABLE
65 &settings_view_featured,
67 #endif /* QP_SETTING_ENABLE */
68 #ifdef QP_MINICTRL_ENABLE
70 #endif /* QP_MINICTRL_ENABLE */
71 #ifdef QP_BRIGHTNESS_ENABLE
73 #endif /* QP_BRIGHTNESS_ENABLE */
76 #ifdef QP_ANIMATED_IMAGE_ENABLE
81 HAPI int quickpanel_modules_init(void *data)
85 retif(data == NULL, QP_FAIL, "Invalid parameter!");
87 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
88 if (modules[i]->init) {
89 modules[i]->init(data);
92 if (modules[i]->init_job_cb) {
93 ecore_job_add(modules[i]->init_job_cb, data);
100 HAPI int quickpanel_modules_fini(void *data)
104 retif(data == NULL, QP_FAIL, "Invalid parameter!");
106 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
107 if (modules[i]->fini) {
108 modules[i]->fini(data);
115 HAPI int quickpanel_modules_suspend(void *data)
119 retif(data == NULL, QP_FAIL, "Invalid parameter!");
121 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
122 if (modules[i]->suspend) {
123 modules[i]->suspend(data);
130 HAPI int quickpanel_modules_resume(void *data)
134 retif(data == NULL, QP_FAIL, "Invalid parameter!");
136 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
137 if (modules[i]->resume) {
138 modules[i]->resume(data);
145 HAPI int quickpanel_modules_hib_enter(void *data)
149 retif(data == NULL, QP_FAIL, "Invalid parameter!");
151 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
152 if (modules[i]->hib_enter) {
153 modules[i]->hib_enter(data);
160 HAPI int quickpanel_modules_hib_leave(void *data)
164 retif(data == NULL, QP_FAIL, "Invalid parameter!");
166 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
167 if (modules[i]->hib_leave) {
168 modules[i]->hib_leave(data);
175 /******************************************************************
179 ****************************************************************/
181 HAPI void quickpanel_modules_lang_change(void *data)
184 retif(data == NULL, , "Invalid parameter!");
186 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
187 if (modules[i]->lang_changed) {
188 modules[i]->lang_changed(data);
193 HAPI void quickpanel_modules_refresh(void *data)
196 retif(data == NULL, , "Invalid parameter!");
198 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
199 if (modules[i]->refresh) {
200 modules[i]->refresh(data);
205 /******************************************************************
207 * Quickpanel open/close Events
209 ****************************************************************/
210 HAPI int quickpanel_modules_opened(void *data)
214 retif(data == NULL, QP_FAIL, "Invalid parameter!");
216 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
217 if (modules[i]->qp_opened) {
218 modules[i]->qp_opened(data);
225 HAPI int quickpanel_modules_closed(void *data)
229 retif(data == NULL, QP_FAIL, "Invalid parameter!");
231 for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
232 if (modules[i]->qp_closed) {
233 modules[i]->qp_closed(data);