Tizen 2.1 base
[apps/core/preloaded/wrt-setting.git] / webapp-common / view.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://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_VIEW_H_ 
18 #define WEB_SRC_SETTING_WEBAPP_COMMON_VIEW_H_
19
20 #include <Evas.h>
21
22 namespace WebAppCommonSetting {
23
24 typedef void (*ViewUnloadCb)(void *data);
25
26 class View
27 {
28     Evas_Object *m_base;
29     ViewUnloadCb m_viewUnloadCb;
30     void *m_viewUnloadCbData;
31
32   public:
33     View() :
34         m_base(NULL),
35         m_viewUnloadCb(NULL),
36         m_viewUnloadCbData(NULL) { };
37     virtual ~View(void);
38
39     void resetBase(Evas_Object *base = NULL);
40     Evas_Object *getBase(void) { return m_base; }
41     void setUnloadCb(ViewUnloadCb cb, void *data);
42     void unsetUnloadCb(void);
43     void invokeUnloadCb(void);
44
45     virtual bool loadView(void) = 0;
46 };
47
48 } /* WebAppCommonSetting */
49
50 #endif /* WEB_SRC_SETTING_WEBAPP_COMMON_VIEW_H_ */