48c6b9c54ad08b1bd25cac623195c7d40c08f8cb
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / control-impl.h
1 #ifndef DALI_TOOLKIT_CONTROL_IMPL_H
2 #define DALI_TOOLKIT_CONTROL_IMPL_H
3
4 /*
5  * Copyright (c) 2021 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 // EXTERNAL INCLUDES
22 #include <dali/public-api/adaptor-framework/style-change.h>
23 #include <dali/public-api/animation/alpha-function.h>
24 #include <dali/public-api/animation/time-period.h>
25 #include <dali/public-api/events/long-press-gesture.h>
26 #include <dali/public-api/events/pan-gesture.h>
27 #include <dali/public-api/events/pinch-gesture.h>
28 #include <dali/public-api/events/tap-gesture.h>
29 #include <dali/public-api/object/property-index-ranges.h>
30 #include <dali/public-api/object/type-info.h>
31
32 // INTERNAL INCLUDES
33 #include <dali-toolkit/public-api/controls/control.h>
34
35 namespace Dali
36 {
37 namespace Toolkit
38 {
39 /**
40  * @addtogroup dali_toolkit_controls
41  * @{
42  */
43
44 class StyleManager;
45
46 namespace Internal
47 {
48
49 /**
50  * @brief This is the internal base class for all controls.
51  *
52  * It will provide some common functionality required by all controls.
53  * Implements ConnectionTrackerInterface so that signals (typically connected to member functions) will
54  * be disconnected automatically when the control is destroyed.
55  * @SINCE_1_0.0
56  */
57 class DALI_TOOLKIT_API Control : public CustomActorImpl, public ConnectionTrackerInterface
58 {
59 public:
60   class Extension; ///< Forward declare future extension interface
61
62   // Creation & Destruction
63
64   /**
65    * @brief Creates a new ControlImpl instance that does not require touch by default.
66    *
67    * If touch is required, then the user can connect to this class' touch signal.
68    * @SINCE_1_0.0
69    * @return A handle to the ControlImpl instance
70    */
71   static Toolkit::Control New();
72
73 protected:
74   /**
75    * @brief Virtual destructor.
76    * @SINCE_1_0.0
77    */
78   virtual ~Control();
79
80 public:
81   // Styling
82
83   /**
84    * @copydoc Dali::Toolkit::Control::SetStyleName
85    */
86   void SetStyleName(const std::string& styleName);
87
88   /**
89    * @copydoc Dali::Toolkit::Control::GetStyleName
90    */
91   const std::string& GetStyleName() const;
92
93   // Background
94
95   /**
96    * @copydoc Dali::Toolkit::Control::SetBackgroundColor
97    */
98   void SetBackgroundColor(const Vector4& color);
99
100   /**
101    * @brief Sets the background with a property map.
102    *
103    * @SINCE_1_0.0
104    * @param[in] map The background property map
105    */
106   void SetBackground(const Property::Map& map);
107
108   /**
109    * @copydoc Dali::Toolkit::Control::ClearBackground
110    */
111   void ClearBackground();
112
113   // Gesture Detection
114
115   /**
116    * @brief Allows deriving classes to enable any of the gesture detectors that are available.
117    *
118    * Gesture detection can be enabled one at a time or in bitwise format as shown:
119    * @code
120    * EnableGestureDetection(GestureType::Value(GestureType::PINCH | GestureType::TAP | GestureType::PAN));
121    * @endcode
122    * @SINCE_1_0.0
123    * @param[in] type The gesture type(s) to enable
124    */
125   void EnableGestureDetection(GestureType::Value type);
126
127   /**
128    * @brief Allows deriving classes to disable any of the gesture detectors.
129    *
130    * Like EnableGestureDetection, this can also be called using bitwise or.
131    * @SINCE_1_0.0
132    * @param[in] type The gesture type(s) to disable
133    * @see EnableGetureDetection
134    */
135   void DisableGestureDetection(GestureType::Value type);
136
137   /**
138    * @brief If deriving classes wish to fine tune pinch gesture
139    * detection, then they can access the gesture detector through this
140    * API and modify the detection.
141    *
142    * @SINCE_1_0.0
143    * @return The pinch gesture detector
144    * @pre Pinch detection should have been enabled via EnableGestureDetection().
145    * @see EnableGestureDetection
146    */
147   PinchGestureDetector GetPinchGestureDetector() const;
148
149   /**
150    * @brief If deriving classes wish to fine tune pan gesture
151    * detection, then they can access the gesture detector through this
152    * API and modify the detection.
153    *
154    * @SINCE_1_0.0
155    * @return The pan gesture detector
156    * @pre Pan detection should have been enabled via EnableGestureDetection().
157    * @see EnableGestureDetection
158    */
159   PanGestureDetector GetPanGestureDetector() const;
160
161   /**
162    * @brief If deriving classes wish to fine tune tap gesture
163    * detection, then they can access the gesture detector through this
164    * API and modify the detection.
165    *
166    * @SINCE_1_0.0
167    * @return The tap gesture detector
168    * @pre Tap detection should have been enabled via EnableGestureDetection().
169    * @see EnableGestureDetection
170    */
171   TapGestureDetector GetTapGestureDetector() const;
172
173   /**
174    * @brief If deriving classes wish to fine tune long press gesture
175    * detection, then they can access the gesture detector through this
176    * API and modify the detection.
177    *
178    * @SINCE_1_0.0
179    * @return The long press gesture detector
180    * @pre Long press detection should have been enabled via EnableGestureDetection().
181    * @see EnableGestureDetection
182    */
183   LongPressGestureDetector GetLongPressGestureDetector() const;
184
185   // Keyboard Navigation
186
187   /**
188    * @brief Sets whether this control supports two dimensional
189    * keyboard navigation (i.e. whether it knows how to handle the
190    * keyboard focus movement between its child actors).
191    *
192    * The control doesn't support it by default.
193    * @SINCE_1_0.0
194    * @param[in] isSupported Whether this control supports two dimensional keyboard navigation
195    */
196   void SetKeyboardNavigationSupport(bool isSupported);
197
198   /**
199    * @brief Gets whether this control supports two dimensional keyboard navigation.
200    *
201    * @SINCE_1_0.0
202    * @return true if this control supports two dimensional keyboard navigation
203    */
204   bool IsKeyboardNavigationSupported();
205
206   // Key Input
207
208   /**
209    * @copydoc Toolkit::Control::SetKeyInputFocus()
210    */
211   void SetKeyInputFocus();
212
213   /**
214    * @copydoc Toolkit::Control::HasKeyInputFocus()
215    */
216   bool HasKeyInputFocus();
217
218   /**
219    * @copydoc Toolkit::Control::ClearKeyInputFocus()
220    */
221   void ClearKeyInputFocus();
222
223   // Keyboard Focus
224
225   /**
226    * @brief Sets whether this control is a focus group for keyboard navigation.
227    *
228    * (i.e. the scope of keyboard focus movement
229    * can be limited to its child actors). The control is not a focus group by default.
230    * @SINCE_1_0.0
231    * @param[in] isFocusGroup Whether this control is set as a focus group for keyboard navigation
232    */
233   void SetAsKeyboardFocusGroup(bool isFocusGroup);
234
235   /**
236    * @brief Gets whether this control is a focus group for keyboard navigation.
237    *
238    * @SINCE_1_0.0
239    * @return true if this control is set as a focus group for keyboard navigation
240    */
241   bool IsKeyboardFocusGroup();
242
243   /// @cond internal
244   /**
245    * @brief Called by the AccessibilityManager to activate the Control.
246    * @SINCE_1_0.0
247    */
248   DALI_INTERNAL void AccessibilityActivate();
249
250   /**
251    * @brief Called by the KeyboardFocusManager.
252    * @SINCE_1_0.0
253    */
254   DALI_INTERNAL void KeyboardEnter();
255   /// @endcond
256
257
258   // Signals
259
260   /**
261    * @copydoc Dali::Toolkit::Control::KeyEventSignal()
262    */
263   Toolkit::Control::KeyEventSignalType& KeyEventSignal();
264
265   /**
266    * @copydoc Dali::Toolkit::Control::KeyInputFocusGainedSignal()
267    */
268   Toolkit::Control::KeyInputFocusSignalType& KeyInputFocusGainedSignal();
269
270   /**
271    * @copydoc Dali::Toolkit::Control::KeyInputFocusLostSignal()
272    */
273   Toolkit::Control::KeyInputFocusSignalType& KeyInputFocusLostSignal();
274
275   /// @cond internal
276   /**
277    * @brief Called by the KeyInputFocusManager to emit key event signals.
278    *
279    * @SINCE_1_0.0
280    * @param[in] event The key event
281    * @return True if the event was consumed
282    */
283   DALI_INTERNAL bool EmitKeyEventSignal(const KeyEvent& event);
284   /// @endcond
285
286 protected: // For derived classes to call
287   /**
288    * @brief Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal.
289    *
290    * Should be called last by the control after it acts on the Input Focus change.
291    *
292    * @SINCE_1_0.0
293    * @param[in] focusGained True if gained, False if lost
294    */
295   void EmitKeyInputFocusSignal(bool focusGained);
296
297 protected: // From CustomActorImpl
298   /**
299    * @copydoc CustomActorImpl::OnSceneConnection()
300    * @note If overridden, then an up-call to Control::OnSceneConnection MUST be made at the end.
301    */
302   void OnSceneConnection(int depth) override;
303
304   /**
305    * @copydoc CustomActorImpl::OnSceneDisconnection()
306    * @note If overridden, then an up-call to Control::OnSceneDisconnection MUST be made at the end.
307    */
308   void OnSceneDisconnection() override;
309
310   /**
311    * @copydoc CustomActorImpl::OnChildAdd()
312    * @note If overridden, then an up-call to Control::OnChildAdd MUST be made at the end.
313    */
314   void OnChildAdd(Actor& child) override;
315
316   /**
317    * @copydoc CustomActorImpl::OnChildRemove()
318    * @note If overridden, then an up-call to Control::OnChildRemove MUST be made at the end.
319    */
320   void OnChildRemove(Actor& child) override;
321
322   /**
323    * @copydoc CustomActorImpl::OnPropertySet()
324    * @note If overridden, then an up-call to Control::OnChildRemove MUST be made at the end.
325    */
326   void OnPropertySet(Property::Index index, const Property::Value& propertyValue) override;
327
328   /**
329    * @copydoc CustomActorImpl::OnSizeSet()
330    * @note If overridden, then an up-call to Control::OnSizeSet MUST be made at the end.
331    */
332   void OnSizeSet(const Vector3& targetSize) override;
333
334   /**
335    * @copydoc CustomActorImpl::OnSizeAnimation()
336    * @note If overridden, then an up-call to Control::OnSizeAnimation MUST be made at the end.
337    */
338   void OnSizeAnimation(Animation& animation, const Vector3& targetSize) override;
339
340   /**
341    * @copydoc CustomActorImpl::OnRelayout()
342    */
343   void OnRelayout(const Vector2& size, RelayoutContainer& container) override;
344
345   /**
346    * @copydoc CustomActorImpl::OnSetResizePolicy()
347    */
348   void OnSetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension) override;
349
350   /**
351    * @copydoc CustomActorImpl::GetNaturalSize()
352    */
353   Vector3 GetNaturalSize() override;
354
355   /**
356    * @copydoc CustomActorImpl::CalculateChildSize()
357    */
358   float CalculateChildSize(const Dali::Actor& child, Dimension::Type dimension) override;
359
360   /**
361    * @copydoc CustomActorImpl::GetHeightForWidth()
362    */
363   float GetHeightForWidth(float width) override;
364
365   /**
366    * @copydoc CustomActorImpl::GetWidthForHeight()
367    */
368   float GetWidthForHeight(float height) override;
369
370   /**
371    * @copydoc CustomActorImpl::RelayoutDependentOnChildren()
372    */
373   bool RelayoutDependentOnChildren(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) override;
374
375   /**
376    * @copydoc CustomActorImpl::OnCalculateRelayoutSize()
377    */
378   void OnCalculateRelayoutSize(Dimension::Type dimension) override;
379
380   /**
381    * @copydoc CustomActorImpl::OnLayoutNegotiated()
382    */
383   void OnLayoutNegotiated(float size, Dimension::Type dimension) override;
384
385 protected: // Helpers for deriving classes
386   // Construction
387
388   /**
389    * @brief Flags for the constructor.
390    * @SINCE_1_0.0
391    */
392   enum ControlBehaviour
393   {
394     CONTROL_BEHAVIOUR_DEFAULT            = 0, ///< Default behaviour: Size negotiation is enabled & listens to Style Change signal, but doesn't receive event callbacks. @SINCE_1_2_10
395     NOT_IN_USE_1                         = 1 << (CustomActorImpl::ACTOR_FLAG_COUNT + 0),
396     REQUIRES_KEYBOARD_NAVIGATION_SUPPORT = 1 << (CustomActorImpl::ACTOR_FLAG_COUNT + 1), ///< True if needs to support keyboard navigation @SINCE_1_0.0
397     DISABLE_STYLE_CHANGE_SIGNALS         = 1 << (CustomActorImpl::ACTOR_FLAG_COUNT + 2), ///< True if control should not monitor style change signals @SINCE_1_2_10
398
399     LAST_CONTROL_BEHAVIOUR_FLAG
400   };
401
402   static const int CONTROL_BEHAVIOUR_FLAG_COUNT = Log<LAST_CONTROL_BEHAVIOUR_FLAG - 1>::value + 1; ///< Total count of flags
403
404   /**
405    * @brief Control constructor.
406    *
407    * @SINCE_1_0.0
408    * @param[in] behaviourFlags Behavioural flags from ControlBehaviour enum
409    */
410   Control(ControlBehaviour behaviourFlags);
411
412   /**
413    * @brief Second phase initialization.
414    * @SINCE_1_0.0
415    */
416   void Initialize();
417
418 public: // API for derived classes to override
419   // Lifecycle
420
421   /**
422    * @brief This method is called after the Control has been initialized.
423    *
424    * Derived classes should do any second phase initialization by overriding this method.
425    * @SINCE_1_0.0
426    */
427   virtual void OnInitialize();
428
429   // Styling
430
431   /**
432    * @brief This method should be overridden by deriving classes requiring notifications when the style changes.
433    *
434    * @SINCE_1_0.0
435    * @param[in] styleManager The StyleManager object
436    * @param[in] change Information denoting what has changed
437    */
438   virtual void OnStyleChange(Toolkit::StyleManager styleManager, StyleChange::Type change);
439
440   // Accessibility
441
442   /**
443    * @brief This method is called when the control is accessibility activated.
444    *
445    * Derived classes should override this to perform custom accessibility activation.
446    * @SINCE_1_0.0
447    * @return true if this control can perform accessibility activation
448    */
449   virtual bool OnAccessibilityActivated();
450
451   /**
452    * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
453    * pan gesture.
454    *
455    * @SINCE_1_0.0
456    * @param[in] gesture The pan gesture
457    * @return true if the pan gesture has been consumed by this control
458    */
459   virtual bool OnAccessibilityPan(PanGesture gesture);
460
461   /**
462    * @brief This method should be overridden by deriving classes when they wish to respond
463    * the accessibility up and down action (i.e. value change of slider control).
464    *
465    * @SINCE_1_0.0
466    * @param[in] isIncrease Whether the value should be increased or decreased
467    * @return true if the value changed action has been consumed by this control
468    */
469   virtual bool OnAccessibilityValueChange(bool isIncrease);
470
471   /**
472    * @brief This method should be overridden by deriving classes when they wish to respond
473    * the accessibility zoom action.
474    *
475    * @SINCE_1_0.0
476    * @return true if the zoom action has been consumed by this control
477    */
478   virtual bool OnAccessibilityZoom();
479
480   // Keyboard focus
481
482   /**
483    * @brief Called when the control gains key input focus.
484    *
485    * Should be overridden by derived classes if they need to customize what happens when focus is gained.
486    * @SINCE_1_0.0
487    */
488   virtual void OnKeyInputFocusGained();
489
490   /**
491    * @brief Called when the control loses key input focus.
492    *
493    * Should be overridden by derived classes if they need to customize what happens when focus is lost.
494    * @SINCE_1_0.0
495    */
496   virtual void OnKeyInputFocusLost();
497
498   /**
499    * @brief Gets the next keyboard focusable actor in this control towards the given direction.
500    *
501    * A control needs to override this function in order to support two dimensional keyboard navigation.
502    * @SINCE_1_0.0
503    * @param[in] currentFocusedActor The current focused actor
504    * @param[in] direction The direction to move the focus towards
505    * @param[in] loopEnabled Whether the focus movement should be looped within the control
506    * @return The next keyboard focusable actor in this control or an empty handle if no actor can be focused
507    */
508   virtual Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled);
509
510   /**
511    * @brief Informs this control that its chosen focusable actor will be focused.
512    *
513    * This allows the application to perform any actions if wishes
514    * before the focus is actually moved to the chosen actor.
515    *
516    * @SINCE_1_0.0
517    * @param[in] commitedFocusableActor The commited focusable actor
518    */
519   virtual void OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor);
520
521   /**
522    * @brief This method is called when the control has enter pressed on it.
523    *
524    * Derived classes should override this to perform custom actions.
525    * @SINCE_1_0.0
526    * @return true if this control supported this action
527    */
528   virtual bool OnKeyboardEnter();
529
530   /**
531    * @brief Called after a key-event is received by the actor that has had its focus set.
532    *
533    * @SINCE_1_0.0
534    * @param[in] event The Key Event
535    * @return True if the event should be consumed
536    */
537   virtual bool OnKeyEvent(const KeyEvent& event);
538
539   // Gestures
540
541   /**
542    * @brief Called whenever a pinch gesture is detected on this control.
543    *
544    * This can be overridden by deriving classes when pinch detection
545    * is enabled.  The default behaviour is to scale the control by the
546    * pinch scale.
547    *
548    * @SINCE_1_0.0
549    * @param[in] pinch The pinch gesture
550    * @note If overridden, then the default behavior will not occur.
551    * @note Pinch detection should be enabled via EnableGestureDetection().
552    * @see EnableGestureDetection
553    */
554   virtual void OnPinch(const PinchGesture& pinch);
555
556   /**
557    * @brief Called whenever a pan gesture is detected on this control.
558    *
559    * This should be overridden by deriving classes when pan detection
560    * is enabled.
561    *
562    * @SINCE_1_0.0
563    * @param[in] pan The pan gesture
564    * @note There is no default behavior with panning.
565    * @note Pan detection should be enabled via EnableGestureDetection().
566    * @see EnableGestureDetection
567    */
568   virtual void OnPan(const PanGesture& pan);
569
570   /**
571    * @brief Called whenever a tap gesture is detected on this control.
572    *
573    * This should be overridden by deriving classes when tap detection
574    * is enabled.
575    *
576    * @SINCE_1_0.0
577    * @param[in] tap The tap gesture
578    * @note There is no default behavior with a tap.
579    * @note Tap detection should be enabled via EnableGestureDetection().
580    * @see EnableGestureDetection
581    */
582   virtual void OnTap(const TapGesture& tap);
583
584   /**
585    * @brief Called whenever a long press gesture is detected on this control.
586    *
587    * This should be overridden by deriving classes when long press
588    * detection is enabled.
589    *
590    * @SINCE_1_0.0
591    * @param[in] longPress The long press gesture
592    * @note There is no default behaviour associated with a long press.
593    * @note Long press detection should be enabled via EnableGestureDetection().
594    * @see EnableGestureDetection
595    */
596   virtual void OnLongPress(const LongPressGesture& longPress);
597
598   // From ConnectionTrackerInterface
599
600   /**
601    * @copydoc ConnectionTrackerInterface::SignalConnected
602    */
603   void SignalConnected(SlotObserver* slotObserver, CallbackBase* callback) override;
604
605   /**
606    * @copydoc ConnectionTrackerInterface::SignalDisconnected
607    */
608   void SignalDisconnected(SlotObserver* slotObserver, CallbackBase* callback) override;
609
610   /**
611    * @brief Retrieves the extension for this control.
612    *
613    * @SINCE_1_0.0
614    * @return The extension if available, NULL otherwise
615    */
616   virtual Extension* GetControlExtension()
617   {
618     return NULL;
619   }
620
621   // Transition APIs
622
623   /**
624    * @brief Make visual transition from source control to destination control about specific Visual.
625    * If both of source and destination control have same visual index, than generates information for the transition of this Control.
626    *
627    * @param[out] sourcePropertyMap Source property map to be applied on this Control.
628    * @param[out] destinationPropertyMap Destination property map to be applied on this Control.
629    * @param[in] source Source control of the animation.
630    * @param[in] destination Destination control of the animation.
631    * @param[in] visualIndex Property::Index to make animation.
632    */
633   void MakeVisualTransition(Dali::Property::Map& sourcePropertyMap, Dali::Property::Map& destinationPropertyMap,
634                             Dali::Toolkit::Control source, Dali::Toolkit::Control destination, Dali::Property::Index visualIndex);
635
636   /**
637    * @brief Retrieves source and destination visual properties for the Transition of this Control.
638    * The properties of this Control will be transitioned from the propeties of source Control to that of destination control.
639    * If a property value is different between source and destination Control,
640    * the property information of each Control will be included in sourceProperties and destinationProperties.
641    *
642    * @param[out] sourceProperties Source property list to be applied on this Control.
643    * @param[out] destinationProperties Destination property list to be applied on this Control.
644    * @param[in] source Source control of the animation.
645    * @param[in] destination Destination control of the animation.
646    *
647    * @note This method do not handle Actor properties.
648    * And the size and order of the sourceProperties and destinationProperties must be synchronized.
649    */
650   virtual void OnCreateTransitions(std::vector<std::pair<Dali::Property::Index, Dali::Property::Map>>& sourceProperties,
651                                    std::vector<std::pair<Dali::Property::Index, Dali::Property::Map>>& destinationProperties,
652                                    Dali::Toolkit::Control                                              source,
653                                    Dali::Toolkit::Control                                              destination)
654   {
655   }
656
657   /**
658    * @brief Update visual properties.
659    * @param[in] properties Property list to be used to update visual properties of this Control.
660    */
661   virtual void OnUpdateVisualProperties(const std::vector<std::pair<Dali::Property::Index, Dali::Property::Map>>& properties)
662   {
663   }
664
665 private:
666   /// @cond internal
667
668   // Not copyable or movable
669   DALI_INTERNAL Control(const Control&) = delete;            ///< Deleted copy constructor.
670   DALI_INTERNAL Control(Control&&)      = delete;            ///< Deleted move constructor.
671   DALI_INTERNAL Control& operator=(const Control&) = delete; ///< Deleted copy assignment operator.
672   DALI_INTERNAL Control& operator=(Control&&) = delete;      ///< Deleted move assignment operator.
673
674 public:
675   class DALI_INTERNAL Impl; // Class declaration is public so we can internally add devel API's to the Controls Impl
676
677 private:
678   Impl* mImpl;
679   /// @endcond
680 };
681
682 /**
683  * @brief Gets implementation from the handle.
684  *
685  * @SINCE_1_0.0
686  * @param handle
687  * @return Implementation
688  * @pre handle is initialized and points to a control
689  */
690 DALI_TOOLKIT_API Internal::Control& GetImplementation(Dali::Toolkit::Control& handle);
691
692 /**
693  * @brief Gets implementation from the handle.
694  *
695  * @SINCE_1_0.0
696  * @param handle
697  * @return Implementation
698  * @pre Handle is initialized and points to a control.
699  */
700 DALI_TOOLKIT_API const Internal::Control& GetImplementation(const Dali::Toolkit::Control& handle);
701
702 } // namespace Internal
703
704 /**
705  * @}
706  */
707 } // namespace Toolkit
708
709 } // namespace Dali
710
711 #endif // DALI_TOOLKIT_CONTROL_IMPL_H