1 #ifndef DALI_TOOLKIT_CONFIRMATION_POPUP_H
2 #define DALI_TOOLKIT_CONFIRMATION_POPUP_H
5 * Copyright (c) 2020 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.
28 // Forward declarations
29 namespace Internal DALI_INTERNAL
31 class ConfirmationPopup;
35 * @brief The ConfirmationPopup widget provides a simple interface to the Popup widget in which to
36 * create common use-case popups.
38 * ConfirmationPopup will automatically provide signals for 1 or 2 buttons.
39 * These signals are dynamically created. The controls (typically PushButtons) must be named as per the example below.
41 * Please see the programming guide for a detailed description of the ConfirmationPopup including examples.
43 * Signals (these are dynamically created upon connect).
44 * | %Signal Name | Actor name to connect to | Property to set signal type (eg clicked) |
45 * |---------------------|--------------------------|------------------------------------------|
46 * | controlSignalOk | controlOk | connectSignalOkSelected |
47 * | controlSignalCancel | controlCancel | connectSignalCancelSelected |
49 class DALI_TOOLKIT_API ConfirmationPopup : public Popup
53 * @brief The start and end property ranges for this control.
57 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1 + DEFAULT_PROPERTY_MAX_COUNT_PER_DERIVATION + 1,
58 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
62 * @brief An enumeration of properties belonging to the ConfirmationPopup class.
68 CONNECT_SIGNAL_OK_SELECTED = PROPERTY_START_INDEX, ///< name "connectSignalOkSelected", type std::string
69 CONNECT_SIGNAL_CANCEL_SELECTED ///< name "connectSignalCancelSelected", type std::string
74 * @brief An enumeration to use as indices to reference buttons.
78 CONTROL_OK = 0, ///< Index of control 1
79 CONTROL_CANCEL, ///< Index of control 2
83 * @brief Create an uninitialized ConfirmationPopup; this can be initialized with ConfirmationPopup::New().
85 * Calling member functions with an uninitialized Dali::Object is not allowed.
90 * @brief Copy constructor.
92 ConfirmationPopup(const ConfirmationPopup& confirmationPopup);
95 * @brief Assignment operator.
97 ConfirmationPopup& operator=(const ConfirmationPopup& confirmationPopup);
102 * This is non-virtual since derived types must not contain data or virtual methods.
104 ~ConfirmationPopup();
107 * @brief Create an initialized ConfirmationPopup.
109 * @return A handle to a newly allocated Dali resource.
111 static ConfirmationPopup New();
114 * @brief Downcast an Object handle to ConfirmationPopup.
116 * If handle points to a ConfirmationPopup the downcast produces valid
117 * handle. If not the returned handle is left uninitialized.
119 * @param[in] handle Handle to an object
120 * @return handle to a ConfirmationPopup or an uninitialized handle
122 static ConfirmationPopup DownCast(BaseHandle handle);
124 public: // Not intended for application developers
126 * @brief Creates a handle using the Toolkit::Internal implementation.
128 * @param[in] implementation The Control implementation.
130 DALI_INTERNAL ConfirmationPopup(Internal::ConfirmationPopup& implementation);
133 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
135 * @param[in] internal A pointer to the internal CustomActor.
137 DALI_INTERNAL ConfirmationPopup(Dali::Internal::CustomActor* internal);
140 } // namespace Toolkit
144 #endif // DALI_TOOLKIT_CONFIRMATION_POPUP_H