apply FSL(Flora Software License)
[apps/home/indicator-win.git] / modules / modules.c
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
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 #include "modules.h"
18
19 /* Home */
20 extern Indicator_Icon_Object home;
21
22 /* Network */
23 extern Indicator_Icon_Object rssi;
24 extern Indicator_Icon_Object roaming;
25
26 /* Connection */
27 extern Indicator_Icon_Object usb;
28 extern Indicator_Icon_Object wifi;
29 extern Indicator_Icon_Object mobile_hotspot;
30 extern Indicator_Icon_Object conn;
31
32 /* Processing */
33 extern Indicator_Icon_Object trnsfr;
34 extern Indicator_Icon_Object call;
35 extern Indicator_Icon_Object call_divert;
36 extern Indicator_Icon_Object active_sync;
37
38 /* Information */
39 extern Indicator_Icon_Object mmc;
40 extern Indicator_Icon_Object noti;
41
42 /* message */
43 /* extern Indicator_Icon_Object message; */
44
45 /* voice mail*/
46 /* extern Indicator_Icon_Object voice_mail; */
47
48 /*
49 extern Indicator_Icon_Object missed_call;
50 extern Indicator_Icon_Object im;
51 */
52
53 /* alarm */
54 extern Indicator_Icon_Object useralarm;
55
56 /* playing */
57 extern Indicator_Icon_Object fm_radio;
58 extern Indicator_Icon_Object mp3_play;
59 extern Indicator_Icon_Object voice_recorder;
60
61 /* Setting */
62 extern Indicator_Icon_Object silent;
63 extern Indicator_Icon_Object bluetooth;
64 extern Indicator_Icon_Object rotate;
65 extern Indicator_Icon_Object gps;
66 extern Indicator_Icon_Object nfc;
67 extern Indicator_Icon_Object wifi_direct;
68
69 /* Clock */
70 extern Indicator_Icon_Object sysclock;
71
72 /* Power */
73 extern Indicator_Icon_Object battery;
74
75 static Indicator_Icon_Object *modules[] = {
76         /* Home */
77         &home,
78         /* Network */
79         &rssi,
80         &roaming,
81         /* Connection */
82         &usb,
83         &wifi,
84         &mobile_hotspot,
85         &conn,
86         /* Processing */
87         &trnsfr,
88         &call,
89         &call_divert,
90
91         /* 
92            &active_sync, 
93          */
94
95         /* Information */
96         /* &message, */
97         /* &voice_mail, */
98         &mmc,
99         &noti,
100         &useralarm,
101         &fm_radio,
102         &mp3_play,
103         &voice_recorder,
104
105         /* Setting */
106         &silent,
107         &bluetooth,
108         &rotate,
109         &gps,
110         &nfc,
111         &wifi_direct,
112
113         /* Clock */
114         &sysclock,
115         /* Power */
116         &battery,
117 /* Add your module object here */
118         NULL
119 };
120
121 void indicator_init_modules(void *data)
122 {
123         int i;
124         /* add items to list */
125         for (i = 0; modules[i]; i++) {
126                 indicator_icon_list_insert(modules[i]);
127                 modules[i]->ad = data;
128                 if (modules[i]->init)
129                         modules[i]->init(data);
130         }
131 }
132
133 void indicator_fini_modules(void *data)
134 {
135         int i;
136         /* add items to list */
137         for (i = 0; modules[i]; i++) {
138                 if (modules[i]->fini)
139                         modules[i]->fini();
140         }
141         /* delete modules */
142         indicator_icon_list_free();
143 }
144
145 void indicator_hib_enter_modules(void *data)
146 {
147         int i;
148         /* add items to list */
149         for (i = 0; modules[i]; i++) {
150                 if (modules[i]->hib_enter)
151                         modules[i]->hib_enter();
152         }
153 }
154
155 void indicator_hib_leave_modules(void *data)
156 {
157         int i;
158         /* add items to list */
159         for (i = 0; modules[i]; i++) {
160                 if (modules[i]->hib_leave)
161                         modules[i]->hib_leave(data);
162         }
163 }
164
165 void indicator_lang_changed_modules(void *data)
166 {
167         int i;
168         /* add items to list */
169         for (i = 0; modules[i]; i++) {
170                 if (modules[i]->lang_changed)
171                         modules[i]->lang_changed(data);
172         }
173 }
174
175 void indicator_region_changed_modules(void *data)
176 {
177         int i;
178         /* add items to list */
179         for (i = 0; modules[i]; i++) {
180                 if (modules[i]->region_changed)
181                         modules[i]->region_changed(data);
182         }
183 }