X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftable-view%2Ftable-view-impl.h;h=154c341348a443fecf98564a5db47556f3d1d738;hp=5f7a5d1d5845ddd41d41c90ce8fa178bd5b66693;hb=c32e712ddb572650fe0766d7f10a9707db5b5c6b;hpb=e2eda444afbe82e9591fe198eef339227f90a616 diff --git a/dali-toolkit/internal/controls/table-view/table-view-impl.h b/dali-toolkit/internal/controls/table-view/table-view-impl.h index 5f7a5d1..154c341 100644 --- a/dali-toolkit/internal/controls/table-view/table-view-impl.h +++ b/dali-toolkit/internal/controls/table-view/table-view-impl.h @@ -1,21 +1,22 @@ #ifndef __DALI_TOOLKIT_INTERNAL_TABLE_VIEW_H__ #define __DALI_TOOLKIT_INTERNAL_TABLE_VIEW_H__ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // INTERNAL INCLUDES #include @@ -35,7 +36,7 @@ namespace Internal * TableView is a custom control for laying out actors in a table layout * @see Dali::Toolkit:TableView for more details */ -class TableView : public ControlImpl +class TableView : public Control { public: @@ -166,52 +167,59 @@ public: float GetRelativeWidth( unsigned int columnIndex ) const; /** - * @copydoc Toolkit::TableView::SetLayoutAnimationDuration + * @copydoc Toolkit::TableView::GetRows */ - void SetLayoutAnimationDuration( float duration ); + unsigned int GetRows(); /** - * @copydoc Toolkit::TableView::GetLayoutAnimationDuration + * @copydoc Toolkit::TableView::GetColumns */ - float GetLayoutAnimationDuration(); + unsigned int GetColumns(); + // Properties /** - * @copydoc Toolkit::TableView::GetRows + * Called when a property of an object of this type is set. + * @param[in] object The object whose property is set. + * @param[in] index The property index. + * @param[in] value The new property value. */ - unsigned int GetRows(); + static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value ); /** - * @copydoc Toolkit::TableView::GetColumns + * Called to retrieve a property of an object of this type. + * @param[in] object The object whose property is to be retrieved. + * @param[in] index The property index. + * @return The current value of the property. */ - unsigned int GetColumns(); + static Property::Value GetProperty( BaseObject* object, Property::Index index ); -private: // From ControlImpl +private: // From Control /** - * @copydoc Toolkit::ControlImpl::OnControlChildAdd(Actor& child) + * @copydoc Control::OnControlChildAdd(Actor& child) */ virtual void OnControlChildAdd(Actor& child); /** - * @copydoc Toolkit::ControlImpl::OnControlChildRemove(Actor& child) + * @copydoc Control::OnControlChildRemove(Actor& child) */ virtual void OnControlChildRemove(Actor& child); /** - * @copydoc Toolkit::ControlImpl::OnRelaidOut + * @copydoc Control::OnRelayout */ - virtual void OnRelaidOut( Vector2 size, ActorSizeContainer& container ); + virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container ); /** - * @copydoc Toolkit::ControlImpl::OnInitialize() + * @copydoc Control::OnInitialize() */ virtual void OnInitialize(); /** - * @copydoc Toolkit::ControlImpl::GetNextKeyboardFocusableActor + * @copydoc Control::GetNextKeyboardFocusableActor */ - virtual Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, Control::KeyboardFocusNavigationDirection direction, bool loopEnabled); + virtual Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled); private: // Implementation @@ -265,6 +273,41 @@ private: // Implementation */ virtual ~TableView(); +private: // scripting support + + /** + * Called to set the heights/widths property. + * @param[in] tableViewImpl The object whose property is set. + * @param[in] funcFixed The set function to call, it can be SetFixedHeight or SetFixedWidths. + * @param[in] funcRelative The set function to call, it can be SetRelativeHeight or SetRelativeWidths. + * @param[in] value The new property value. + */ + static void SetHeightOrWidthProperty( TableView& tableViewImpl, + void(TableView::*funcFixed)(unsigned int, float), + void(TableView::*funcRelative)(unsigned int, float), + const Property::Value& map ); + + /** + * Called to retrieve the property value of row heights. + * @return The property value of row heights. + */ + Property::Value GetRowHeightsPropertyValue(); + + /** + * Called to retrieve the property value of column widths. + * @return The fixed-widths property value. + */ + Property::Value GetColumnWidthsPropertyValue(); + + /** + * Generate the map type property value from the size vectors. + * @param[in] fixedSize The vector of fixed heights or widths. + * @param[in] relativeSize The vector of relative heights or widths. + * @param[out] map The property value. + */ + void GetMapPropertyValue( const std::vector& fixedSize, const std::vector& relativeSize, Property::Map& map ); + + /** * Helper class to prevent child adds and removes from causing relayout * when we're already anyways going to do one in the end @@ -315,7 +358,6 @@ private: // Data std::vector mRelativeWidths; Size mPadding; bool mLayoutingChild; - float mConstraintDuration; };