2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef WRT_RUNTIME_POPUP_H_
19 #define WRT_RUNTIME_POPUP_H_
22 #include <Elementary.h>
34 enum class ButtonType {
41 enum class EntryType {
46 static Popup* CreatePopup(NativeWindow* window);
49 void SetButtonType(ButtonType type);
50 bool IsPositiveButton(Evas_Object* button);
51 bool GetButtonResult() const; // yes/allow/ok: true, the others: false
53 void SetFirstEntry(const std::string& str_id, EntryType type);
54 void SetSecondEntry(const std::string& str_id, EntryType type);
55 std::string GetFirstEntryResult() const;
56 std::string GetSecondEntryResult() const;
59 void SetCheckBox(const std::string& str_id = std::string());
60 bool GetCheckBoxResult() const;
63 void SetTitle(const std::string& str_id);
64 void SetBody(const std::string& str_id);
65 void SetResultHandler(std::function
66 <void(Popup* popup, void* user_data)> handler, void* user_data);
71 void Result(bool is_positive);
74 Evas_Object* popup() { return popup_; }
77 Popup(Evas_Object* popup, Evas_Object* grid, Evas_Object* box);
83 Evas_Object* button1_;
84 Evas_Object* button2_;
87 Evas_Object* check_box_;
89 std::function<void(Popup* popup, void* user_data)> handler_;
95 std::string result_entry1_;
96 std::string result_entry2_;
97 bool enable_check_box_;
98 bool result_check_box_;
103 #endif // WRT_RUNTIME_POPUP_H_