code update
[apps/home/ug-nfc-efl.git] / ug-nfc-share-efl / include / ug-nfc-share-main.h
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
18 #ifndef __UG_NFC_SHARE_MAIN_H__
19 #define __UG_NFC_SHARE_MAIN_H__
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif /* __cplusplus */
24
25 #include <ui-gadget-module.h>
26 #include <Evas.h>
27 #include <Elementary.h>
28 #include <dlog.h>
29 #include <stdbool.h>
30 #include <string.h>
31
32 #include <Ecore_X.h>
33 #include <utilX.h>
34 #include <bundle.h>
35 #include <assert.h>
36 #include <glib.h>
37
38 #include <nfc.h>
39
40 #include "ug-nfc-share-common-error.h"
41 #include "ug-nfc-share-common-debug.h"
42 #include "ug-nfc-share-common-util.h"
43
44 #define LOCALE_PATH             LOCALEDIR
45 #define IMAGES_PATH             IMAGEDIR
46 #define EDJ_PATH                EDJDIR
47 #define EDJ_FILE                        EDJ_PATH"/"PACKAGE".edj"
48
49 #ifdef LOG_TAG
50 #undef LOG_TAG
51 #endif
52
53 #define LOG_TAG "UG_SHARE_NFC_EFL"
54
55 #define NFC_SHARE_SERVICE                       "com.samsung.nfc-share-service"
56 #define NFC_SHARE_SERVICE_SHARE_VIA_UG          "http://tizen.org/appcontrol/operation/nfc_share_via_ug"
57
58 #define GET_SAFE_STRING(x) ((x) != NULL ? (x) : "NULL")
59 #define STRING_AND_SIZE(x) (x), strlen((x))
60 #define NULL_TO_EMPTY_STRING(x) (((x) != NULL) ? (x) : "")
61
62 #define UG_NFC_SHARE_HANDOVER_FILE_SIZE      (10 * 1024) /* 10kB */
63 #define UG_NFC_SHARE_DB_MAX_ROW_COUNT        100
64
65
66 /* Buffer length for Text */
67 #define POPUP_TEXT_SIZE 1024
68 #define LABEL_TEXT_SIZE         1024
69
70 #define NFCUG_TEXT_DOMAIN               PACKAGE
71 #define NFCUG_LOCALEDIR         LOCALE_PATH
72
73 /* Registered string in STMS NFC */
74 #define IDS_NFC_NFC                                                             dgettext(PACKAGE, "IDS_NFC_BODY_NFC")
75 #define IDS_SHARE_VIA_NFC                                                       dgettext(PACKAGE, "IDS_NFC_HEADER_SHARE_VIA_NFC")
76 #define IDS_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE                               dgettext(PACKAGE, "IDS_NFC_BODY_GENTLY_TOUCH_PHONES_TOGETHER_TO_SHARE")
77 #define IDS_TO_CANCEL_SHARING_TAP_CANCEL                                        dgettext(PACKAGE, "IDS_NFC_BODY_TO_CANCEL_SHARING_TAP_CANCEL")
78 #define IDS_TRANSFER_FAILED                                                     dgettext(PACKAGE, "IDS_NFC_POP_TRANSFER_FAILED")
79 #define IDS_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q          dgettext(PACKAGE, "IDS_NFC_POP_SERVICE_NOT_AVAILABLE_NFC_TURNED_OFF_TURN_ON_NFC_Q")
80 #define IDS_SECURITY_POLICY_RESTRICTS_USE_OF_PS                         dgettext(PACKAGE, "IDS_COM_BODY_SECURITY_POLICY_RESTRICTS_USE_OF_PS")
81
82 #define IDS_SHARED                                                              dgettext(PACKAGE, "IDS_COM_OPT_SHARED")
83 #define IDS_UNABLE_TO_SHARE                                                     dgettext(PACKAGE, "IDS_COM_BODY_UNABLE_TO_SHARE")
84
85
86 /* will be deleted */
87 #define IDS_NFC_SERVICE_IS_NOT_SUPPORTED                                        _("NFC service is not supported")
88
89 /* System string */
90 #define IDS_YES                         dgettext("sys_string", "IDS_COM_SK_YES")
91 #define IDS_NO                          dgettext("sys_string", "IDS_COM_SK_NO")
92 #define IDS_OK                          dgettext("sys_string", "IDS_COM_SK_OK")
93 #define IDS_NONE                        dgettext("sys_string", "IDS_COM_BODY_NONE")
94 #define IDS_UNKNOWN                     dgettext("sys_string", "IDS_COM_BODY_UNKNOWN")
95 #define IDS_CANCEL                      dgettext("sys_string", "IDS_COM_SK_CANCEL")
96 #define IDS_CLOSE                       dgettext("sys_string", "IDS_COM_POP_CLOSE")
97
98 /**** common lib functions endzz  **********/
99
100 typedef enum
101 {
102         UG_NFC_SHARE_TAG_CONTACT = 0,
103         UG_NFC_SHARE_TAG_URL,
104         UG_NFC_SHARE_TAG_MPLAYER,
105         UG_NFC_SHARE_TAG_MEMO,
106         UG_NFC_SHARE_TAG_BT,
107         UG_NFC_SHARE_TAG_WIFI,
108         UG_NFC_SHARE_TAG_PROFILE,
109         UG_NFC_SHARE_TAG_ALLSHARE,
110         UG_NFC_SHARE_TAG_FILE,
111         UG_NFC_SHARE_TAG_HANDOVER,
112         UG_NFC_SHARE_TAG_UNKNOWN,
113         UG_NFC_SHARE_TAG_MAX
114 } ug_nfc_share_tag_type;
115
116 enum
117 {
118         UG_FONT_LIST = 0,
119         UG_FONT_SBEAM_TITLE,
120         UG_FONT_LIVEBOX,
121         UG_FONT_HELP,
122         UG_FONT_MAX,
123 };
124
125 enum
126 {
127         UG_ALIGN_LEFT,
128         UG_ALIGN_CENTER,
129         UG_ALIGN_RIGHT,
130 };
131
132 typedef struct _ugdata_t
133 {
134         Evas_Object* ug_win_main;
135         ui_gadget_h nfc_share_ug;
136         Evas_Object* base_layout;
137         Evas_Object *bg;
138
139         nfc_ndef_message_h current_ndef;
140         bundle *bd;
141 }ugdata_t;
142
143
144 #ifdef __cplusplus
145 }
146 #endif
147
148 #endif /*__UG_NFC_SHARE_MAIN_H__*/