[SRUK] Initial copy from Tizen 2.2 version
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / popup / popup-style-impl.cpp
1 //
2 // Copyright (c) 2014 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 #include <dali-toolkit/internal/controls/popup/popup-style-impl.h>
18
19 using namespace Dali;
20 using namespace Dali::Toolkit;
21 using namespace std;
22
23 namespace // unnamed namespace
24 {
25 // Popup style default
26 const Vector4 DEFAULT_BACKING_COLOR = Vector4(0.0f, 0.0f, 0.0f, 0.5f);
27 const float DEFAULT_MARGIN = 20.0f;          //From Tizen GUI UX
28 const float DEFAULT_BUTTON_SPACING = 20.0f;  //From Tizen GUI UX
29 const Vector3 DEFAULT_BUTTON_SIZE(275.0f, 74.0f, 0.0f);
30 const char* DEFAULT_BACKGROUND_IMAGE_PATH = DALI_IMAGE_DIR "00_popup_bg.png";
31 const char* DEFAULT_BUTTON_AREA_IMAGE_PATH = DALI_IMAGE_DIR "00_popup_button_bg.png";
32 const char* DEFAULT_TAIL_UP_IMAGE_PATH = DALI_IMAGE_DIR "popup_tail_up.png";
33 const char* DEFAULT_TAIL_DOWN_IMAGE_PATH = DALI_IMAGE_DIR "popup_tail_down.png";
34 const char* DEFAULT_TAIL_LEFT_IMAGE_PATH = DALI_IMAGE_DIR "popup_tail_left.png";
35 const char* DEFAULT_TAIL_RIGHT_IMAGE_PATH = DALI_IMAGE_DIR "popup_tail_right.png";
36 const Vector3 DEFAULT_BOTTOM_SIZE(620.0f,96.0f,0.0f);
37 const Vector2 DEFAULT_BACKGROUND_SIZE(620.0f, 236.0f);
38 const Vector4 DEFAULT_BACKGROUND_STYLE_9_BORDER( 25.0f, 25.0f, 26.0f, 50.0f );
39 const Vector4 DEFAULT_BACKGROUND_OUTER_BORDER( 0.0f, 0.0f, 0.0f, 0.0f );
40 const Vector4 DEFAULT_BUTTON_AREA_9_PATCH_BORDER( 13.0f, 8.0f, 13.0f, 8.0f );
41 }
42
43 namespace Dali
44 {
45
46 namespace Toolkit
47 {
48
49 namespace Internal
50 {
51
52 ///////////////////////////////////////////////////////////////////////////////
53 // Popup Style (base class)
54 ///////////////////////////////////////////////////////////////////////////////
55
56 PopupStyle::PopupStyle()
57 : backingColor(),
58   backgroundImage(),
59   buttonAreaImage(),
60   backgroundSize(),
61   backgroundScale9Border(),
62   backgroundOuterBorder(),
63   buttonArea9PatchBorder(),
64   margin(0.0f),
65   buttonSpacing(0.0f),
66   buttonSize(),
67   tailUpImage(),
68   tailDownImage(),
69   tailLeftImage(),
70   tailRightImage()
71 {
72 }
73
74 PopupStyle::~PopupStyle()
75 {
76 }
77
78 ///////////////////////////////////////////////////////////////////////////////
79 // Popup style: Default
80 ///////////////////////////////////////////////////////////////////////////////
81
82 PopupStyleDefault::PopupStyleDefault()
83 {
84   backingColor = DEFAULT_BACKING_COLOR;
85   backgroundImage = DEFAULT_BACKGROUND_IMAGE_PATH;
86   buttonAreaImage = DEFAULT_BUTTON_AREA_IMAGE_PATH;
87   margin = DEFAULT_MARGIN;
88   buttonSpacing = DEFAULT_BUTTON_SPACING;
89   buttonSize = DEFAULT_BUTTON_SIZE;
90   tailUpImage = DEFAULT_TAIL_UP_IMAGE_PATH;
91   tailDownImage = DEFAULT_TAIL_DOWN_IMAGE_PATH;
92   tailLeftImage = DEFAULT_TAIL_LEFT_IMAGE_PATH;
93   tailRightImage = DEFAULT_TAIL_RIGHT_IMAGE_PATH;
94   backgroundSize = DEFAULT_BACKGROUND_SIZE;
95   backgroundScale9Border = DEFAULT_BACKGROUND_STYLE_9_BORDER;
96   backgroundOuterBorder = DEFAULT_BACKGROUND_OUTER_BORDER;
97   buttonArea9PatchBorder = DEFAULT_BUTTON_AREA_9_PATCH_BORDER;
98   bottomSize = DEFAULT_BOTTOM_SIZE;
99 }
100
101 PopupStyleDefaultPtr PopupStyleDefault::New()
102 {
103   return PopupStyleDefaultPtr(new PopupStyleDefault());
104 }
105
106 PopupStyleDefault::~PopupStyleDefault()
107 {
108 }
109
110 } // namespace Internal
111
112 } // namespace Toolkit
113
114 } // namespace Dali