X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=dali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fscroll-view%2Fscroll-base-impl.h;h=aa34f20051c04059bb30379b3229674eacbb2251;hb=b694e7e2ae624e206e1548b1a863c554eb9cd4d7;hp=5dd0a3f2e5d0d4b29e26470dd4ca5127757d7d2e;hpb=e2eda444afbe82e9591fe198eef339227f90a616;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h index 5dd0a3f..aa34f20 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h @@ -1,28 +1,29 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_BASE_H__ -#define __DALI_TOOLKIT_INTERNAL_SCROLL_BASE_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. -// +#ifndef DALI_TOOLKIT_INTERNAL_SCROLL_BASE_H +#define DALI_TOOLKIT_INTERNAL_SCROLL_BASE_H + +/* + * Copyright (c) 2019 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. + * + */ // EXTERNAL INCLUDES // TODO - Replace list with dali-vector.h #include +#include // INTERNAL INCLUDES -#include #include #include @@ -77,8 +78,9 @@ public: */ void ApplyConstraint(Constraint constraint) { - ActiveConstraint activeConstraint = mActor.ApplyConstraint( constraint ); - mConstraints.push_back( activeConstraint ); + Constraint clone = constraint.Clone( mActor ); + clone.Apply(); + mConstraints.push_back( clone ); } /** @@ -88,17 +90,17 @@ public: */ void RemoveConstraints() { - std::vector::iterator it = mConstraints.begin(); - std::vector::iterator end = mConstraints.end(); + std::vector::iterator it = mConstraints.begin(); + std::vector::iterator end = mConstraints.end(); for(;it!=end;++it) { - mActor.RemoveConstraint(*it); + it->Remove(); } mConstraints.clear(); } Actor mActor; ///< The Actor that this ActorInfo represents. - std::vector mConstraints; ///< A list keeping track of constraints applied to the actor via this delegate. + std::vector mConstraints; ///< A list keeping track of constraints applied to the actor via this delegate. }; typedef IntrusivePtr ActorInfoPtr; @@ -180,7 +182,7 @@ public: protected: - static const std::string SCROLL_DOMAIN_OFFSET_PROPERTY_NAME; + static const char* const SCROLL_DOMAIN_OFFSET_PROPERTY_NAME; protected: @@ -190,28 +192,15 @@ protected: ScrollBase(); /** - * 2nd-phase initialization. + * @brief Construct a new ScrollBase. + * + * @param[in] behaviourFlags Flags to enable */ - void RegisterProperties(); + ScrollBase( ControlBehaviour behaviourFlags ); protected: ScrollBase *mParent; ///< Pointer to ScrollBase parent, if exists. - Property::Index mPropertyTime; ///< Scroll Time (0 to animationDuration while animating, otherwise 0) - Property::Index mPropertyX; ///< Scroll Position X ("scroll-x") - Property::Index mPropertyY; ///< Scroll Position Y ("scroll-y") - Property::Index mPropertyPrePosition; ///< Scroll Position ("scroll-position") [function of scroll-x, scroll-y] - Property::Index mPropertyPosition; ///< Scroll Position ("scroll-position") [function of scroll-pre-position] - Property::Index mPropertyScale; ///< Scroll Scale ("scroll-scale") - Property::Index mPropertyOvershootX; ///< Scroll Overshoot ("scroll-overshoot-x") [function of scroll-pre-position, scroll-position] - Property::Index mPropertyOvershootY; ///< Scroll Overshoot ("scroll-overshoot-y") [function of scroll-pre-position, scroll-position] - Property::Index mPropertyWrap; ///< Scroll Wrap ("scroll-wrap") - Property::Index mPropertyPanning; ///< Whether we are panning - Property::Index mPropertyScrolling; ///< Whether we are scrolling - Property::Index mPropertyFinal; ///< Scroll Final Position ("scroll-final") [scroll-position + f(scroll-overshoot)] - Property::Index mPropertyDomainOffset; ///< Scroll Domain Offset ("scroll-domain-offset") keeps track of scroll position as it wraps domains - Property::Index mPropertyPositionDelta; ///< Scroll Position Delta ("scroll-position-delta") - Property::Index mPropertyScrollStartPagePosition; ///< Scroll Start Page Position ("scroll-start-page-position") private: @@ -227,4 +216,4 @@ private: } // namespace Dali -#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_GROUP_H__ +#endif // DALI_TOOLKIT_INTERNAL_SCROLL_BASE_H