1 #ifndef __DALI_TOOLKIT_CONFIRMATION_POPUP_H__
2 #define __DALI_TOOLKIT_CONFIRMATION_POPUP_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
30 // Forward declarations
31 namespace Internal DALI_INTERNAL
33 class ConfirmationPopup;
37 * @brief The ConfirmationPopup widget provides a simple interface to the Popup widget in which to
38 * create common use-case popups.
40 * ConfirmationPopup will automatically provide signals for 1 or 2 buttons.
41 * These signals are dynamically created. The controls (typically PushButtons) must be named as per the example below.
43 * Please see the programming guide for a detailed description of the ConfirmationPopup including examples.
45 * Signals (these are dynamically created upon connect).
46 * | %Signal Name | Actor name to connect to | Property to set signal type (eg clicked) |
47 * |---------------------|--------------------------|------------------------------------------|
48 * | controlSignalOk | controlOk | connectSignalOkSelected |
49 * | controlSignalCancel | controlCancel | connectSignalCancelSelected |
51 class DALI_IMPORT_API ConfirmationPopup : public Popup
56 * @brief The start and end property ranges for this control.
60 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1 + DEFAULT_PROPERTY_MAX_COUNT_PER_DERIVATION + 1,
61 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
65 * @brief An enumeration of properties belonging to the ConfirmationPopup class.
71 CONNECT_SIGNAL_OK_SELECTED = PROPERTY_START_INDEX, ///< name "connectSignalOkSelected", type std::string
72 CONNECT_SIGNAL_CANCEL_SELECTED ///< name "connectSignalCancelSelected", type std::string
77 * @brief An enumeration to use as indices to reference buttons.
81 CONTROL_OK = 0, ///< Index of control 1
82 CONTROL_CANCEL, ///< Index of control 2
86 * @brief Create an uninitialized ConfirmationPopup; this can be initialized with ConfirmationPopup::New().
88 * Calling member functions with an uninitialized Dali::Object is not allowed.
93 * @brief Copy constructor.
95 ConfirmationPopup( const ConfirmationPopup& confirmationPopup );
98 * @brief Assignment operator.
100 ConfirmationPopup& operator=( const ConfirmationPopup& confirmationPopup );
105 * This is non-virtual since derived types must not contain data or virtual methods.
107 ~ConfirmationPopup();
110 * @brief Create an initialized ConfirmationPopup.
112 * @return A handle to a newly allocated Dali resource.
114 static ConfirmationPopup New();
117 * @brief Downcast an Object handle to ConfirmationPopup.
119 * If handle points to a ConfirmationPopup the downcast produces valid
120 * handle. If not the returned handle is left uninitialized.
122 * @param[in] handle Handle to an object
123 * @return handle to a ConfirmationPopup or an uninitialized handle
125 static ConfirmationPopup DownCast( BaseHandle handle );
127 public: // Not intended for application developers
130 * @brief Creates a handle using the Toolkit::Internal implementation.
132 * @param[in] implementation The Control implementation.
134 DALI_INTERNAL ConfirmationPopup( Internal::ConfirmationPopup& implementation );
137 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
139 * @param[in] internal A pointer to the internal CustomActor.
141 DALI_INTERNAL ConfirmationPopup( Dali::Internal::CustomActor* internal );
144 } // namespace Toolkit
148 #endif // __DALI_TOOLKIT_CONFIRMATION_POPUP_H__