-#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_H__
-#define __DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_H__
+#ifndef DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_H
+#define DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
*
*/
+// EXTERNAL INCLUDES
+#include <string>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/object/property-map.h>
+
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/buttons/push-button.h>
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.h>
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/actors/layer.h>
-
namespace Dali
{
namespace Internal
{
-namespace
-{
-
enum PopupCustomisations
{
POPUP_MAXIMUM_SIZE,
OPTION_DIVIDER_SIZE
};
-} // namespace
-
class TextSelectionPopup : public Control
{
public:
priority( 0u ),
name(),
caption(),
- icon(),
enabled( false )
{}
std::size_t buttonPriority,
const std::string& buttonName,
const std::string& buttonCaption,
- Dali::Image& buttonIcon,
bool buttonEnabled )
: id( buttonId ),
priority( buttonPriority ),
name( buttonName ),
caption( buttonCaption ),
- icon( buttonIcon ),
enabled( buttonEnabled )
{}
std::size_t priority;
std::string name;
std::string caption;
- Dali::Image icon;
bool enabled;
};
/**
* @copydoc Toolkit::TextSelectionPopup::RaiseAbove()
*/
- void RaiseAbove( Layer target );
+ void RaiseAbove( Actor target );
/**
* @copydoc Toolkit::TextSelectionPopup::ShowPopup()
/**
* @copydoc Control::OnInitialize()
*/
- virtual void OnInitialize();
-
- /**
- * @copydoc Control::OnStageConnection()
- */
- virtual void OnStageConnection( int depth );
+ void OnInitialize() override;
private: // Implementation
*
* @param[in] setting The setting from the PopupCustomisations enum
*/
- Size GetDimensionToCustomise( const PopupCustomisations& setting );
+ Size GetDimensionToCustomise( const PopupCustomisations& setting ) const;
/**
* @brief Sets the image for the given button of the Popup.
* @param[in] button The button the image should be used for from the Buttons Enum.
* @param[in] image The image to use.
*/
- void SetButtonImage( Toolkit::TextSelectionPopup::Buttons button, Dali::Image image );
+ void SetButtonImage( Toolkit::TextSelectionPopup::Buttons button, const std::string& image );
/**
* @brief Retrieves the image of the given button used by the popup
* @param[in] button The button to get the image from
* @return The image used for that button.
*/
- Dali::Image GetButtonImage( Toolkit::TextSelectionPopup::Buttons button );
+ const std::string& GetButtonImage( Toolkit::TextSelectionPopup::Buttons button ) const;
/**
* @brief Sets the image for the pressed state of a popup option.
void AddOption( const ButtonRequirement& button, bool showDivider, bool showIcons, bool showCaption );
- std::size_t GetNumberOfEnabledOptions();
+ std::size_t GetNumberOfEnabledOptions() const;
void AddPopupOptionsToToolbar( bool showIcons, bool showCaptions );
/**
+ * Creates the background-border image
+ *
+ * @param[in] propertyMap The properties describing the background-border
+ */
+ void CreateBackgroundBorder( Property::Map& propertyMap );
+
+ /**
* Construct a new TextField.
*/
TextSelectionPopup( TextSelectionPopupCallbackInterface* callbackInterface );
Dali::Toolkit::TableView mTableOfButtons; // Actor which holds all the buttons, sensitivity can be set on buttons via this actor
- // Images to be used by the Popup buttons
- Image mCutIconImage;
- Image mCopyIconImage;
- Image mPasteIconImage;
- Image mClipboardIconImage;
- Image mSelectIconImage;
- Image mSelectAllIconImage;
+ // Images paths to be used by the Popup buttons
+ std::string mCutIconImage;
+ std::string mCopyIconImage;
+ std::string mPasteIconImage;
+ std::string mClipboardIconImage;
+ std::string mSelectIconImage;
+ std::string mSelectAllIconImage;
Size mPopupMaxSize; // Maximum size of the Popup
Size mOptionMaxSize; // Maximum size of an Option button
} // namespace Dali
-#endif // __DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_H__
+#endif // DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_H