Remove obsolete and non functional SizeChanged signal from actor
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / public-api / controls / scrollable / item-view / navigation-layout.h
1 #ifndef __DALI_TOOLKIT_NAVIGATION_LAYOUT_H__
2 #define __DALI_TOOLKIT_NAVIGATION_LAYOUT_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h>
23
24 namespace Dali
25 {
26 namespace Toolkit
27 {
28 class NavigationLayout;
29
30 typedef IntrusivePtr<NavigationLayout> NavigationLayoutPtr;
31
32 /**
33  * An ItemView layout which arranges items in navigation mode.
34  */
35 class DALI_IMPORT_API NavigationLayout: public ItemLayout
36 {
37 public:
38
39   typedef boost::function<Vector3 (const Vector3& layoutSize,
40                                    const unsigned int orientation,
41                                    const unsigned int numberOfColumns,
42                                    const float columnSpacing,
43                                    const float sideMargin)>  ResizeFunction;
44
45   /**
46    * Create a new navigation layout
47    */
48   static NavigationLayoutPtr New();
49
50   /**
51    * Virtual destructor.
52    */
53   virtual ~NavigationLayout();
54
55   /**
56    * Set the number of columns in the layout.
57    * @param[in] columns  The number of columns.
58    */
59   void SetNumberOfColumns(unsigned int columns);
60
61   /**
62    * Get the number of columns in the layout.
63    * @return The number of columns.
64    */
65   unsigned int GetNumberOfColumns() const;
66
67   /**
68    * Set the spacing between columns.
69    * @param[in] spacing The spacing.
70    */
71   void SetColumnSpacing(float spacing);
72
73   /**
74    * Get the spacing between columns.
75    * @return The spacing.
76    */
77   float GetColumnSpacing() const;
78
79   /**
80    * Set the margin in the top of the layout
81    * @param[in] margin The layout top margin.
82    */
83   void SetTopMargin(float margin);
84
85   /**
86    * Get the margin in the top of the layout
87    * @return The layout top margin.
88    */
89   float GetTopMargin() const;
90
91   /**
92    * Set the margin in the bottom of the layout
93    * @param[in] margin The layout bottom margin.
94    */
95   void SetBottomMargin(float margin);
96
97   /**
98    * Get the margin in the bottom of the layout
99    * @return The layout bottom margin.
100    */
101   float GetBottomMargin() const;
102
103   /**
104    * Set the margin in the left and right of the layout
105    * @param[in] margin The layout side margin.
106    */
107   void SetSideMargin(float margin);
108
109   /**
110    * Get the margin in the left and right of the layout
111    * @return The layout side margin.
112    */
113   float GetSideMargin() const;
114
115   /**
116    * Set the factor used to customise the scroll speed while dragging and swiping the layout.
117    * @param[in] scrollSpeed The scroll speed factor.
118    */
119   void SetScrollSpeedFactor(float scrollSpeed);
120
121   /**
122    * Set the maximum swipe speed in pixels per second.
123    * @param[in] speed The maximum swipe speed.
124    */
125   void SetMaximumSwipeSpeed(float speed);
126
127   /**
128    * Set the duration of the flick animation in second. This is the time taken to animate each
129    * item to its next layout position (e.g. from 1.0 to 2.0) when a flick animation is triggered
130    * by a swipe gesture.
131    * @pre durationSeconds must be greater than zero.
132    * @param[in] durationSeconds The duration of flick animation in seconds.
133    */
134   void SetItemFlickAnimationDuration(float durationSeconds);
135
136   /**
137    * @copydoc ItemLayout::GetScrollSpeedFactor()
138    */
139   virtual float GetScrollSpeedFactor() const;
140
141   /**
142    * @copydoc ItemLayout::GetMaximumSwipeSpeed()
143    */
144   virtual float GetMaximumSwipeSpeed() const;
145
146   /**
147    * @copydoc ItemLayout::GetItemFlickAnimationDuration()
148    */
149   virtual float GetItemFlickAnimationDuration() const;
150
151 private:
152
153   /**
154    * @copydoc ItemLayout::GetMinimumLayoutPosition()
155    */
156   virtual float GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const;
157
158   /**
159    * @copydoc ItemLayout::GetClosestAnchorPosition()
160    */
161   virtual float GetClosestAnchorPosition(float layoutPosition) const;
162
163   /**
164    * @copydoc ItemLayout::GetItemScrollToPosition()
165    */
166   virtual float GetItemScrollToPosition(unsigned int itemId) const;
167
168   /**
169    * @copydoc ItemLayout::GetItemsWithinArea()
170    */
171   virtual ItemRange GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const;
172
173   /**
174    * @copydoc ItemLayout::GetReserveItemCount()
175    */
176   virtual unsigned int GetReserveItemCount(Vector3 layoutSize) const;
177
178   /**
179    * @copydoc ItemLayout::GetItemSize()
180    */
181   virtual bool GetItemSize(unsigned int itemId, Vector3 layoutSize, Vector3& itemSize) const;
182
183   /**
184    * @copydoc ItemLayout::GetResizeAnimation()
185    */
186   virtual void GetResizeAnimation(Animation& animation,
187                                         Actor actor,
188                                         Vector3 size,
189                                         float durationSeconds) const;
190
191   /**
192    * @copydoc ItemLayout::GetPositionConstraint()
193    */
194   virtual bool GetPositionConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const;
195
196   /**
197    * @copydoc ItemLayout::GetRotationConstraint()
198    */
199   virtual bool GetRotationConstraint(unsigned int itemId, ItemLayout::QuaternionFunction& constraint) const;
200
201   /**
202    * @copydoc ItemLayout::GetScaleConstraint()
203    */
204   virtual bool GetScaleConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const;
205
206   /**
207    * @copydoc ItemLayout::GetColorConstraint()
208    */
209   virtual bool GetColorConstraint(unsigned int itemId, ItemLayout::Vector4Function& constraint) const;
210
211   /**
212    * @copydoc ItemLayout::GetVisibilityConstraint()
213    */
214   virtual bool GetVisibilityConstraint(unsigned int itemId, ItemLayout::BoolFunction& constraint) const;
215
216   /**
217    * @copydoc ItemLayout::GetScrollDirection()
218    */
219   virtual Degree GetScrollDirection() const;
220
221 protected:
222
223   /**
224    * Protected constructor; see also GridLayout::New()
225    */
226   NavigationLayout();
227
228 private:
229
230   struct Impl;
231   Impl* mImpl;
232 };
233
234 }
235 }
236 #endif //__DALI_TOOLKIT_NAVIGATION_LAYOUT_H__