Tizen 2.1 base
[framework/osp/uifw.git] / src / app / inc / FApp_AppFrame.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FApp_AppFrame.h
20  * @brief       This is the header file for _AppFrame.
21  */
22
23 #ifndef _FAPP_INTERNAL_APP_FRAME_H_
24 #define _FAPP_INTERNAL_APP_FRAME_H_
25
26 #include <FBaseObject.h>
27 #include <FOspConfig.h>
28 #include <FAppIAppFrame.h>
29
30 namespace Tizen { namespace Graphics { class Canvas; } }
31 namespace Tizen { namespace Ui { class IKeyEventListener; } }
32 namespace Tizen { namespace Ui { class ITouchEventListener; } }
33 namespace Tizen { namespace Ui { class IWindowEventListener; } }
34 namespace Tizen { namespace Ui { namespace Controls { class Frame; } } }
35
36 namespace Tizen { namespace App
37 {
38
39 //
40 // @class               _AppFrame
41 // @brief               This is implementation of the application frame.
42 // @since               1.0
43 //
44 class _AppFrame
45         : public Tizen::Base::Object
46         , public virtual IAppFrame
47 {
48 public:
49
50         _AppFrame(Tizen::Ui::Controls::Frame& pFrame);
51
52         /**
53          * Constructs this instance.
54          *
55          * @return      An error code.
56          * @exception   E_SUCCESS               - This method is successful.
57          * @exception   E_OUT_OF_MEMORY - Memory allocation failed.
58          * @exception   E_INVALID_STATE - Already constructed.
59          * @exception   E_SYSTEM                - System internal error.
60          */
61         result Construct(void);
62
63         /**
64          * This is a destructor.
65          */
66         virtual ~_AppFrame(void);
67
68         /**
69          * Gets the application frame's canvas.
70          *
71          * @return      See above.
72          */
73         virtual Tizen::Graphics::Canvas* GetCanvasN(void) const;
74
75         /**
76          * Adds a listener for key event.
77          *
78          * @param[in]   pListener       a listener for key event
79          * @return      An error code.
80          * @exception   E_SUCCESS       - This method is successful.
81          * @exception   E_OUT_OF_MEMORY - Memory allocation has failed.
82          */
83         virtual result AddKeyEventListener(Tizen::Ui::IKeyEventListener& listener);
84
85         /**
86          * Removes an existing key event listener.
87          *
88          * @param[in]   pListener       a listener to be removed
89          * @return      An error code.
90          * @exception   E_SUCCESS       - This method is successful.
91          * @exception   E_OBJ_NOT_FOUND         - The specified object is not found.
92          */
93         virtual result RemoveKeyEventListener(Tizen::Ui::IKeyEventListener& listener);
94
95         virtual result AddTouchEventListener(Tizen::Ui::ITouchEventListener& listener);
96
97         virtual result RemoveTouchEventListener(Tizen::Ui::ITouchEventListener& listener);
98
99         virtual result AddWindowEventListener(Tizen::Ui::IWindowEventListener& listener);
100
101         virtual result RemoveWindowEventListener(Tizen::Ui::IWindowEventListener& listener);
102
103         virtual Tizen::Ui::Controls::Frame* GetFrame(void);
104
105         result SetFrame(Tizen::Ui::Controls::Frame* pFrame);
106
107 private:
108         /**
109          * This is a default constructor.
110          */
111         _AppFrame(void);
112
113         _AppFrame(const _AppFrame& value);
114
115         _AppFrame& operator =(const _AppFrame& value);
116
117 private:
118         Tizen::Ui::Controls::Frame* __pFrame;
119 }; // _AppFrame
120
121 } } // Tizen::App
122
123 #endif // _FAPP_INTERNAL_APP_FRAME_H_