1 // Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef WRT_RUNTIME_POPUP_H_
6 #define WRT_RUNTIME_POPUP_H_
9 #include <Elementary.h>
21 enum class ButtonType {
28 enum class EntryType {
33 static Popup* CreatePopup(NativeWindow* window);
36 void SetButtonType(ButtonType type);
37 bool IsPositiveButton(Evas_Object* button);
38 bool GetButtonResult() const; // yes/allow/ok: true, the others: false
40 void SetFirstEntry(const std::string& str_id, EntryType type);
41 void SetSecondEntry(const std::string& str_id, EntryType type);
42 std::string GetFirstEntryResult() const;
43 std::string GetSecondEntryResult() const;
46 void SetCheckBox(const std::string& str_id = std::string());
47 bool GetCheckBoxResult() const;
50 void SetTitle(const std::string& str_id);
51 void SetBody(const std::string& str_id);
52 void SetResultHandler(std::function
53 <void(Popup* popup, void* user_data)> handler, void* user_data);
58 void Result(bool is_positive);
61 Evas_Object* popup() { return popup_; }
64 Popup(Evas_Object* popup, Evas_Object* grid, Evas_Object* box);
70 Evas_Object* button1_;
71 Evas_Object* button2_;
74 Evas_Object* check_box_;
76 std::function<void(Popup* popup, void* user_data)> handler_;
82 std::string result_entry1_;
83 std::string result_entry2_;
84 bool enable_check_box_;
85 bool result_check_box_;
90 #endif // WRT_RUNTIME_POPUP_H_