b08bf85fc8be36276eeb07dea9ffb91be074ea47
[profile/tv/apps/native/filebrowser.git] / include / FbContextView.h
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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 __FBCONTEXT_VIEW_H__
18 #define __FBCONTEXT_VIEW_H__
19
20
21 class CContextView : public CBaseView {
22 private:
23         struct SContextView* m;
24
25         enum content_app_type {
26                 APP_LINKED,
27                 APP_OTHER,
28         };
29 private:
30
31         static void _lbl_start_slide(Evas_Object *lbl);
32         static void _btn_focused(void *data, Evas_Object *obj, void *ev);
33         static void _btn_unfocused(void *data, Evas_Object *obj, void *ev);
34
35         static bool _add_btn_label(Evas_Object *btn, const char *txt);
36         static bool _add_btn_icon(Evas_Object *btn, const char *icon);
37         static bool _add_btn_info(Evas_Object *btn, const char *icon, const char *txt);
38         static Evas_Object *_add_btnbox(Evas_Object *base);
39         static bool _get_context_details(CExtNameInfo *pInfo, char **path, char **title, char *subtitle, char *subtitle2);
40         static  Evas_Object *_add_rltv_ctnt(Evas_Object *obj, const char *name, const char *icon);
41         static Evas_Object *_add_scroller(Evas_Object *base);
42         static Evas_Object *_add_table(Evas_Object *base);
43         static Evas_Object *_get_icon(Evas_Object *obj, CExtNameInfo *finfo);
44         static void _set_default_thumb(Evas_Object *img, int type);
45         static Evas_Object *_create_lbl(Evas_Object *ly, char *title);
46
47         void m_SetBtnDownFocus(Evas_Object *btn);
48         void m_SetLayoutFocusOrder(Evas_Object *btn);
49         Evas_Object *m_AddButton(Evas_Object *base);
50         bool m_AddTableContents(Evas_Object *table, Eina_List *list, enum content_app_type type);
51
52         bool m_CreateContentApps(Eina_List *list, enum content_app_type type);
53         bool m_CreateBtnsPart(void);
54         bool m_CreateInfoPart(void);
55         static void sm_CbKeyPressed(void *dt, Evas *e, Evas_Object *obj, void *ei);
56
57 protected:
58         virtual void t_OnShow(void);
59         virtual void t_OnHide(void);
60
61 public:
62         CContextView(const char *szViewId) : CBaseView(szViewId), m(0) {}
63         virtual ~CContextView() {}
64
65         virtual bool Create(void *data);
66         virtual void Destroy(void);
67         virtual Evas_Object* Base(void);
68 };
69
70
71 #endif /*__FBCONTEXT_VIEW_H__*/