-#ifndef __DALI_TOOLKIT_INTERNAL_TOOL_BAR_H__
-#define __DALI_TOOLKIT_INTERNAL_TOOL_BAR_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.
-//
-
-#include <dali/dali.h>
+#ifndef DALI_TOOLKIT_INTERNAL_TOOL_BAR_H
+#define DALI_TOOLKIT_INTERNAL_TOOL_BAR_H
+
+/*
+ * Copyright (c) 2021 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
+#include <dali/devel-api/common/map-wrapper.h>
// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
+#include <dali-toolkit/devel-api/controls/tool-bar/tool-bar.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/tool-bar/tool-bar.h>
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
namespace Dali
{
-
namespace Toolkit
{
-
class ToolBar;
namespace Internal
{
-
/**
* ToolBar is a control to create a tool bar.
* @see Dali::Toolkit::ToolBar for more details.
*/
-class ToolBar : public ControlImpl
+class ToolBar : public Control
{
public:
-
/**
* Create an initialized ToolBar.
* @return A handle to a newly allocated Dali resource.
static Toolkit::ToolBar New();
/**
- * @copydoc Dali::Toolkit::View::SetBackground()
+ * @copydoc Dali::Toolkit::ToolBar::AddControl()
*/
- void SetBackground( Actor background );
+ void AddControl(Dali::Actor control, float relativeSize, Toolkit::Alignment::Type alignment, const Toolkit::Alignment::Padding& padding);
/**
- * @copydoc Dali::Toolkit::View::AddControl()
+ * @copydoc Dali::Toolkit::ToolBar::RemoveControl()
*/
- void AddControl( Dali::Actor control, float relativeSize, Toolkit::Alignment::Type alignment, const Toolkit::Alignment::Padding& padding );
-
- /**
- * @copydoc Dali::Toolkit::View::RemoveControl()
- */
- void RemoveControl( Dali::Actor control );
-
-private: // From ControlImpl
+ void RemoveControl(Dali::Actor control);
+private: // From Control
/**
* @copydoc Toolkit::Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* Adds a control using some default values (the control uses 10% of the tool bar space and is placed on the left group).
* @param child The control to be added.
*
- * @see Toolkit::ControlImpl::OnControlChildAdd()
+ * @see Control::OnChildAdd()
*/
- virtual void OnControlChildAdd(Actor& child);
-
- /**
- * Called when the tool-bar is relaid out.
- * @param[in] size The size allocated.
- * @param[in/out] container the container to put actors not handled.
- */
- virtual void OnRelaidOut( Vector2 size, ActorSizeContainer& container );
+ void OnChildAdd(Actor& child) override;
private:
/**
/**
* Constructor, sets the lock boolean
*/
- Lock( bool& lock )
- : mLock( lock )
+ Lock(bool& lock)
+ : mLock(lock)
{
mLock = true;
}
{
mLock = false;
}
+
private:
bool& mLock;
};
float mAccumulatedRelativeSpace; ///< Stores the total percentage space used by controls.
bool mInitializing; ///< Allows the use of Actor's API to add controls.
- std::map<Actor/*control*/,Toolkit::Alignment> mControls; ///< Stores a relationship between controls and their alignments used to place them inside the table view.
+ std::map<Actor /*control*/, Toolkit::Alignment> mControls; ///< Stores a relationship between controls and their alignments used to place them inside the table view.
};
} // namespace Internal
-
// Helpers for public-api forwarding methods
-inline Toolkit::Internal::ToolBar& GetImpl( Toolkit::ToolBar& toolBar )
+inline Toolkit::Internal::ToolBar& GetImpl(Toolkit::ToolBar& toolBar)
{
- DALI_ASSERT_ALWAYS( toolBar );
+ DALI_ASSERT_ALWAYS(toolBar);
Dali::RefObject& handle = toolBar.GetImplementation();
- return static_cast<Toolkit::Internal::ToolBar&>( handle );
+ return static_cast<Toolkit::Internal::ToolBar&>(handle);
}
-inline const Toolkit::Internal::ToolBar& GetImpl( const Toolkit::ToolBar& toolBar )
+inline const Toolkit::Internal::ToolBar& GetImpl(const Toolkit::ToolBar& toolBar)
{
- DALI_ASSERT_ALWAYS( toolBar );
+ DALI_ASSERT_ALWAYS(toolBar);
const Dali::RefObject& handle = toolBar.GetImplementation();
- return static_cast<const Toolkit::Internal::ToolBar&>( handle );
+ return static_cast<const Toolkit::Internal::ToolBar&>(handle);
}
} // namespace Toolkit
} // namespace Dali
-#endif // __DALI_TOOLKIT_INTERNAL_TOOL_BAR_H__
+#endif // DALI_TOOLKIT_INTERNAL_TOOL_BAR_H