Tizen 2.1 base
[apps/home/mobileprint.git] / usb-printer-detector / include / upd.h
1 /*
2 *  USB-Printer-Detector
3 *
4 * Copyright 2012  Samsung Electronics Co., Ltd
5
6 * Licensed under the Flora License, Version 1.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9
10 * http://floralicense.org/license/
11
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20 #ifndef __UPD_H__
21 #define __UPD_H__
22
23 #include <appcore-efl.h>
24 #include <Ecore_X.h>
25 #include <Elementary.h>
26 #include <appsvc.h>
27 #include <aul.h>
28 #include <bundle.h>
29 #include <notification.h>
30 #include <vconf.h>
31 #include <pmapi.h>
32
33 #define PACKAGE "usb-printer-detector"
34 #define EDJ_NAME RESDIR"/edje/usb-printer-detector.edj"
35 #define LOCALEDIR "/opt/usr/apps/org.tizen.usb-printer-detector/res/locale"
36 #define UPD_STR_MAX_LEN         128
37
38 enum {
39         UPD_TIMER_3 = 3,
40         UPD_TIMER_10 = 10,
41         UPD_TIMER_30 = 30,
42         UPD_TIMER_120 = 120,
43 };
44
45 enum {
46         UPD_PROG_CONNECT,
47         UPD_PROG_DISCONNECT,
48         UPD_PROG_CONNECT_CANCEL,
49         UPD_NOTI_CONNECTED,
50         UPD_NOTI_DISCONNECTED,
51         UPD_FAIL_INIT,
52         UPD_FAIL_CONNECT,
53 //    UPD_BROWSE_FILES_REQ,
54 };
55
56 enum {
57         UPD_RESP_OK,
58         UPD_RESP_CANCEL,
59         UPD_RESP_APRV_CONNECT_PBC_YES = 1,
60         UPD_RESP_APRV_CONNECT_DISPLAY_YES,
61         UPD_RESP_APRV_CONNECT_KEYPAD_YES,
62         UPD_RESP_APRV_CONNECT_NO,
63         UPD_RESP_PROG_CONNECT_CANCEL,
64         UPD_RESP_PROG_CONNECT_KEYPAD_OK,
65         UPD_RESP_APRV_ENTER_PIN_YES,
66         UPD_RESP_APRV_ENTER_PIN_NO,
67         UPD_BROWSE_FILES_YES,
68         UPD_BROWSE_FILES_NO,
69 };
70
71 typedef struct {
72         int type;
73         char text[UPD_STR_MAX_LEN];
74         char label1[UPD_STR_MAX_LEN];
75         char label2[UPD_STR_MAX_LEN];
76         int timeout;
77         int resp_data1;
78         int resp_data2;
79         int data;
80 } upd_popup_t;
81
82 typedef struct {
83         Evas_Object *win;
84         Evas_Object *popup;
85         Evas_Object *pin_entry;
86         upd_popup_t *popup_data;
87         uint popup_timeout_handle;
88         int noti_id;
89 } upd_appdata_t;
90
91
92 extern upd_appdata_t *upd_get_appdata();
93 extern void upd_destroy_popup();
94 extern void upd_prepare_popup(int type, void *userdata);
95
96 #endif /* __UPD_H__ */