Modify enum values
[apps/home/usb-syspopup.git] / usb-syspopup.h
1 /*
2  * usb-syspopup
3  *
4  * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
5  *
6  * Contact: Taeyoung Kim <ty317.kim@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef __SYSPOPUP_APP_H__
23 #define __SYSPOPUP_APP_H__
24
25 #include <vconf.h>
26 #include <syspopup.h>
27 #include <ail.h>
28
29 #include <errno.h>
30 #include <string.h>
31 #include <sys/types.h>
32 #include <sys/socket.h>
33 #include <sys/un.h>
34
35 #define SOCK_PATH "/tmp/usb_server_sock"
36 #define SOCK_STR_LEN 1542
37 #define ACC_ELEMENT_LEN 256
38 #define PKG_NAME_LEN    64
39 #define ACC_INFO_NUM 6
40 #define MAX_NUM_OF_MATCHED_APPS 256
41
42 #if !defined(PACKAGE)
43 #define PACKAGE "usb_syspopup"
44 #endif
45
46 #include <dlog.h>
47 #define USB_LOG_VERBOSE    LOG_VERBOSE
48 #define USB_LOG_DEBUG      LOG_DEBUG
49 #define USB_LOG_INFO       LOG_INFO
50 #define USB_LOG_WARN       LOG_WARN
51 #define USB_LOG_ERROR      LOG_ERROR
52 #define USB_LOG_FATAL      LOG_FATAL
53
54 #define USB_TAG "USB_SYSPOPUP"
55 #define USB_LOG(log_level, format, args...)\
56         LOG(log_level, USB_TAG, "[%s][Ln: %d] " format,__FILE__, __LINE__, ##args)
57 #define __USB_FUNC_ENTER__\
58         USB_LOG(USB_LOG_DEBUG, "Entering: %s()\n", __func__)
59 #define __USB_FUNC_EXIT__\
60         USB_LOG(USB_LOG_DEBUG, "Exit: %s()\n", __func__)
61
62 typedef enum {
63         SYSPOPUP_TYPE = 0,
64         MAX_NUM_SYSPOPUP_PARAM
65         /* When we need to deliver other parameters to USB-syspopup
66          * add the types of parameters */
67 } SYSPOPUP_PARAM;
68
69 typedef enum {
70         ERROR_POPUP = 0,
71         SELECT_PKG_FOR_ACC_POPUP,
72         REQ_ACC_PERM_POPUP,
73         TEST_POPUP,
74         MAX_NUM_SYSPOPUP_TYPE
75         /* When we need to add other system popup,
76          * Write here the type of popup */
77 } POPUP_TYPE;
78
79 typedef enum {
80         ACC_MANUFACTURER = 0,
81         ACC_MODEL,
82         ACC_DESCRIPTION,
83         ACC_VERSION,
84         ACC_URI,
85         ACC_SERIAL
86 } ACC_ELEMENT;
87
88 typedef enum {
89         /* General */
90         ERROR_POPUP_OK_BTN = 0,
91         IS_EMUL_BIN,
92
93         /* for Accessory */
94         LAUNCH_APP_FOR_ACC = 20,
95         REQ_ACC_PERMISSION,
96         HAS_ACC_PERMISSION,
97         REQ_ACC_PERM_NOTI_YES_BTN,
98         REQ_ACC_PERM_NOTI_NO_BTN,
99         GET_ACC_INFO
100 } REQUEST_TO_USB_MANGER;
101
102 typedef struct _usbAccessory {
103         char manufacturer[ACC_ELEMENT_LEN];
104         char model[ACC_ELEMENT_LEN];
105         char description[ACC_ELEMENT_LEN];
106         char version[ACC_ELEMENT_LEN];
107         char uri[ACC_ELEMENT_LEN];
108         char serial[ACC_ELEMENT_LEN];
109 } UsbAccessory;
110
111 struct appdata {
112         Evas_Object             *win;
113         Evas_Object             *popup;
114         Evas_Object             *lbtn;
115         Evas_Object             *rbtn;
116         bundle                  *b;
117         int                             noti_fd;
118         int                             type;
119         char                    *content;
120
121         UsbAccessory    *usbAcc;
122         char                    selPkg[PKG_NAME_LEN];
123
124         /* add more variables here */
125 };
126
127 static void load_connection_failed_popup_ok_response_cb(void *data, Evas_Object * obj, void *event_info);
128 static void request_perm_popup_yes_response_cb(void *data, Evas_Object * obj, void *event_info);
129 static void request_perm_popup_no_response_cb(void *data, Evas_Object * obj, void *event_info);
130
131 #endif                    /* __SYSPOPUP_APP_H__ */
132