The license change version 1.0 to version 1.1
[apps/home/wrt-setting.git] / webapp-common / whiteuriview.h
1 /*
2   * Copyright 2012  Samsung Electronics Co., Ltd
3   *
4   * Licensed under the Flora License, Version 1.1 (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://floralicense.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 #ifndef WEB_SRC_SETTING_WEBAPP_COMMON_WHITEURIVIEW_H_
18 #define WEB_SRC_SETTING_WEBAPP_COMMON_WHITEURIVIEW_H_
19
20 #include <Evas.h>
21
22 #include <string>
23
24 #include "view.h"
25
26 namespace WebAppCommonSetting {
27
28 class WhiteUriView : public View
29 {
30     Evas_Object *m_naviFrame;
31     Elm_Object_Item *m_saveBtn;
32     std::string m_uri;
33     bool m_isModify;
34     Eina_Bool m_supportSubDomain;
35
36     static void onBackBtnClicked(void *data,
37                                  Evas_Object *obj,
38                                  void *event_info);
39     static void onSaveBtnClicked(void *data,
40                                  Evas_Object *obj,
41                                  void *event_info);
42     static void onUriErase(void *data,
43                            Evas_Object *obj,
44                            const char *emission,
45                            const char *source);
46     static void onUriFocused(void *data,
47                              Evas_Object *obj,
48                              void *event_info);
49     static void onUriUnfocused(void *data,
50                                Evas_Object *obj,
51                                void *event_info);
52     static void onUriChanged(void *data,
53                              Evas_Object *obj,
54                              void *event_info);
55     static void onSubDomainReleased(void *data,
56                                     Evas *e,
57                                     Evas_Object *obj,
58                                     void *event_info);
59     static void onSubDomainClicked(void *data,
60                                    Evas *e,
61                                    Evas_Object *obj,
62                                    void *event_info);
63
64     bool pushToNaviFrame(void);
65     void popFromNaviFrame(void);
66     bool addUriField(Evas_Object *bx);
67     bool addSubDomainField(Evas_Object *bx);
68     Evas_Object *addToolBar(Evas_Object *parent);
69
70   public:
71     WhiteUriView(Evas_Object *naviFrame);
72     WhiteUriView(Evas_Object *naviFrame,
73                  std::string uri);
74     ~WhiteUriView(void);
75
76     bool loadView(void);
77     void save(void);
78     void updateUri(const char *uri);
79 };
80
81 } /* WebAppCommonSetting */
82
83 #endif /* WEB_SRC_SETTING_WEBAPP_COMMON_WHITEURIVIEW_H_ */