bug fix: TC-1152
[profile/ivi/ico-uxf-homescreen.git] / src / onscreen / CicoOSPopWindow.h
1 /*
2  * Copyright (c) 2014, TOYOTA MOTOR CORPORATION.
3  *
4  * This program is licensed under the terms and conditions of the
5  * Apache License, version 2.0.  The full text of the Apache License is at
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  */
9 /**
10  * @brief   Pop Window
11  *
12  * @date    Feb-17-2014
13  */
14 #ifndef __CICO_ONSCREEN_POP_WINDOW_H__
15 #define __CICO_ONSCREEN_POP_WINDOW_H__
16
17 #ifdef HAVE_CONFIG_H
18     #include "config.h"
19     #define __UNUSED__
20 #else
21     #define __UNUSED__
22 #endif
23
24 #include <stdio.h>
25 #include <unistd.h>
26 #include <string>
27 #include <cstring>
28
29 #include <app.h>
30 #include <aul.h>
31 #include <Ecore_Evas.h>
32 #include <Evas.h>
33 #include <Edje.h>
34
35 #include <stdbool.h>
36 #include <CicoNotification.h>
37 #include <CicoNotificationService.h>
38
39 #include "ico_syc_common.h"
40 #include "ico_syc_privilege.h"
41
42 #include "ico_log.h"
43
44 /*============================================================================*/
45 /* Define fixed parameters                                                    */
46 /*============================================================================*/
47 /* Window Size */
48 #define STATUS_BAR_HEIGHT    64
49 #define CTRL_BAR_HEIGHT      128
50 #define WIDTH                1080
51 #define HEIGHT               1920
52
53 /* Popup Size */
54 #define POPUP_WIDTH         640
55 #define POPUP_HEIGHT        300
56
57 /* Popup Frame Size */
58 #define POPUP_FRAME_THICK   10
59 #define POPUP_FRAME_WIDTH   (POPUP_WIDTH+POPUP_FRAME_THICK)
60 #define POPUP_FRAME_HEIGHT  (POPUP_HEIGHT+POPUP_FRAME_THICK)
61
62 /* OnScreen window name(title) */
63 #define POPUP_WINDOW_TITLE  "OnScreen"
64
65 /* Wait time for delete popup(ms) */
66 #define POPUP_DELETE_WAIT   100
67
68 #define FALSE                0
69 #define TRUE                 1
70
71 #define ICO_OS_THEMES_EDJ_FILEPATH  ICO_SYC_PACKAGE_ONSCREEN "/res/themes/onscreen.edj"
72
73 /*============================================================================*/
74 /* Define data types                                                          */
75 /*============================================================================*/
76
77 /*============================================================================*/
78 /* Define class                                                               */
79 /*============================================================================*/
80 class CicoOSPopWindow :public CicoNotification {
81 public:
82     CicoOSPopWindow(notification_type_e type);
83     CicoOSPopWindow(notification_h noti);
84     virtual ~CicoOSPopWindow();
85     bool    showPopup();
86     void    hidePopup(bool buttonTouch = false);
87     bool    acquireRes();
88     bool    releaseRes();
89     const CicoNotification& getNotif() const {
90         return (const CicoNotification&)*this;
91     }
92     bool    createMainWindow();
93     void    removeMainWindow();
94
95 private:
96     bool    InitializeWindow(void);
97     static void evasMouseUpCB(void *data, Evas *e, Evas_Object *obj,
98                               void *event_info);
99     void    makeResWindowT(ico_syc_res_window_t& w);
100     static Ecore_Evas*  m_window;
101
102 public:
103     Evas_Object* m_icon;
104     Evas_Object* m_theme;
105     uint32_t     m_resourceId;
106     struct ico_syc_res_context* m_context;
107     std::string  m_appsvc_pkgname;
108     bool         m_buttonTouch;
109 };
110 #endif  // __CICO_ONSCREEN_POP_WINDOW_H__
111 // vim:set expandtab ts=4 sw=4: