69df3151870397851728349e064dc5100a9ac6c1
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / text-controls / text-selection-popup.h
1 #ifndef __DALI_TOOLKIT_TEXT_SELECTION_POPUP_H__
2 #define __DALI_TOOLKIT_TEXT_SELECTION_POPUP_H__
3
4 /*
5  * Copyright (c) 2015 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 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/control.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace Internal DALI_INTERNAL
31 {
32 class TextSelectionPopup;
33 }
34
35 /**
36  * @brief A control which provides a Popup with a number of buttons
37  *
38  * The style of the pop can be set through style sheets, this includes the images for the buttons
39  * A Show and Hide API is provided.
40  *
41  * If the buttons exceed the size constraints of the popup then it will offer scrolling.
42  *
43  *
44  */
45 class DALI_IMPORT_API TextSelectionPopup : public Control
46 {
47 public:
48
49   /**
50    * @brief The start and end property ranges for this control.
51    */
52   enum PropertyRange
53   {
54     PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
55     PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000              ///< Reserve property indices
56   };
57
58   /**
59    * @brief An enumeration of properties belonging to the TextSelectionPopup class.
60    */
61   struct Property
62   {
63     enum
64     {
65
66       POPUP_MAX_SIZE =  PROPERTY_START_INDEX,   ///< name "popup-max-size",                The maximum size the Popup can be,              type VECTOR2
67       POPUP_MIN_SIZE,                           ///< name "popup-min-size",                The minimum size the Popup can be,              type VECTOR2
68       OPTION_MAX_SIZE,                          ///< name "option-max-size",               The maximum size an option can be,              type VECTOR2
69       OPTION_MIN_SIZE,                          ///< name "option-min-size",               The minimum size an option can be,              type VECTOR2
70       OPTION_DIVIDER_SIZE,                      ///< name "option-divider-size",           The size of the divider between options         type VECTOR2
71       POPUP_CLIPBOARD_BUTTON_ICON_IMAGE,        ///< name "popup-clipboard-button-image",  The image to use as the popup clipboard icon,   type STRING
72       POPUP_CUT_BUTTON_ICON_IMAGE,              ///< name "popup-cut-button-image",        The image to use as the popup cut icon,         type STRING
73       POPUP_COPY_BUTTON_ICON_IMAGE,             ///< name "popup-copy-button-image",       The image to use as the popup copy icon,        type STRING
74       POPUP_PASTE_BUTTON_ICON_IMAGE,            ///< name "popup-paste-button-image",      The image to use as the popup paste icon,       type STRING
75       POPUP_SELECT_BUTTON_ICON_IMAGE,           ///< name "popup-select-button-image",     The image to use as the popup select icon,      type STRING
76       POPUP_SELECT_ALL_BUTTON_ICON_IMAGE,       ///< name "popup-select-all-button-image", The image to use as the popup select all icon,  type STRING
77     };
78   };
79
80   /**
81    * Create the TextSelectionPopup control.
82    * @return A handle to the TextSelectionPopup control.
83    */
84   static TextSelectionPopup New();
85
86   /**
87    * @brief Creates an empty handle.
88    */
89   TextSelectionPopup();
90
91   /**
92    * @brief Copy constructor.
93    *
94    * @param[in] handle The handle to copy from.
95    */
96   TextSelectionPopup( const TextSelectionPopup& handle );
97
98   /**
99    * @brief Assignment operator.
100    *
101    * @param[in] handle The handle to copy from.
102    * @return A reference to this.
103    */
104   TextSelectionPopup& operator=( const TextSelectionPopup& handle );
105
106   /**
107    * @brief Destructor
108    *
109    * This is non-virtual since derived Handle types must not contain data or virtual methods.
110    */
111   ~TextSelectionPopup();
112
113   /**
114    * @brief Downcast a handle to TextSelectionPopup.
115    *
116    * If the BaseHandle points is a TextSelectionPopup the downcast returns a valid handle.
117    * If not the returned handle is left empty.
118    *
119    * @param[in] handle Handle to an object
120    * @return handle to a TextSelectionPopup or an empty handle
121    */
122   static TextSelectionPopup DownCast( BaseHandle handle );
123
124 public: // Not intended for application developers
125
126   /**
127    * @brief Creates a handle using the Toolkit::Internal implementation.
128    *
129    * @param[in] implementation The Control implementation.
130    */
131   DALI_INTERNAL TextSelectionPopup( Internal::TextSelectionPopup& implementation );
132
133   /**
134    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
135    *
136    * @param[in]  internal  A pointer to the internal CustomActor.
137    */
138   explicit DALI_INTERNAL TextSelectionPopup( Dali::Internal::CustomActor* internal );
139
140 }; // Class TextSelectionPopup
141
142 } // namespace Toolkit
143
144 } // namespace Dali
145
146 #endif // __DALI_TOOLKIT_TEXT_SELECTION_POPUP_H__