Merge base & optional
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / navigation-frame / page.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
18 // CLASS HEADER
19 #include "page.h"
20
21 // EXTERNAL INCLUDES
22
23 // INTERNAL INCLUDES
24 #include <dali-toolkit/internal/controls/navigation-frame/page-impl.h>
25
26 namespace Dali
27 {
28
29 namespace Toolkit
30 {
31
32 const char* const Page::PROPERTY_TITLE = "title";
33 const char* const Page::PROPERTY_SUB_TITLE = "sub-title";
34
35 Page::Page()
36 {
37 }
38
39 Page::Page( const Page& handle )
40 : Control(handle)
41 {
42 }
43
44 Page& Page::operator=( const Page& handle )
45 {
46   if( &handle != this )
47   {
48     CustomActor::operator=( handle );
49   }
50   return *this;
51 }
52
53 Page Page::New()
54 {
55   return Internal::Page::New();
56 }
57
58 Page Page::DownCast( BaseHandle handle )
59 {
60   return Control::DownCast<Page, Internal::Page>(handle);
61 }
62
63 Page::Page(Internal::Page& impl)
64 : Control(impl)
65 {
66 }
67
68 Page::Page( Dali::Internal::CustomActor* internal )
69 : Control( internal)
70 {
71   VerifyCustomActorPointer<Internal::Page>(internal);
72 }
73
74 void Page::SetTitle(const std::string& title)
75 {
76   GetImpl( *this ).SetTitle(title);
77 }
78
79 const std::string& Page::GetTitle() const
80 {
81   return GetImpl( *this ).GetTitle();
82 }
83
84 void Page::SetSubTitle(const std::string& subtitle)
85 {
86   GetImpl( *this ).SetSubTitle(subtitle);
87 }
88
89 const std::string& Page::GetSubTitle() const
90 {
91   return GetImpl( *this ).GetSubTitle();
92 }
93
94 void Page::SetTitleIcon( Actor titleIcon)
95 {
96   GetImpl( *this ).SetTitleIcon(titleIcon);
97 }
98
99 Actor Page::GetTitleIcon() const
100 {
101   return GetImpl( *this ).GetTitleIcon();
102 }
103
104 bool Page::AddControlToToolBar(Actor control, Alignment::Type alignment)
105 {
106   return GetImpl( *this ).AddControlToToolBar(control, alignment);
107 }
108
109 const Page::ControlOnBarContainer Page::GetControlsOnToolBar() const
110 {
111   return GetImpl( *this ).GetControlsOnToolBar();
112 }
113
114 bool Page::AddControlToTitleBar(Actor control)
115 {
116   return GetImpl( *this ).AddControlToTitleBar(control);
117 }
118
119 const ActorContainer Page::GetControlsOnTitleBar() const
120 {
121   return GetImpl( *this ).GetControlsOnTitleBar();
122 }
123
124 void Page::SetPopupMenu( Toolkit::Popup popupMenu )
125 {
126   GetImpl( *this ).SetPopupMenu( popupMenu );
127 }
128
129 Toolkit::Popup Page::GetPopupMenu() const
130 {
131   return GetImpl( *this ).GetPopupMenu();
132 }
133
134 } // namespace Toolkit
135
136 } // namespace Dali