TDME2  1.9.200
FindReplaceDialogScreenController.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <string>
5 
6 #include <tdme/tdme.h>
15 
16 using std::string;
17 using std::unique_ptr;
18 
29 
30 /**
31  * Find/Replace dialog screen controller
32  * @author Andreas Drewke
33  */
35  : public ScreenController
36  , public virtual GUIActionListener
37  , public virtual GUIFocusListener
38  , public virtual GUITooltipRequestListener
39 {
40 
41 private:
42  PopUps* popUps { nullptr };
43  GUIScreenNode* screenNode { nullptr };
44  GUIElementNode* findText { nullptr };
46  GUIElementNode* matchCase { nullptr };
49  GUIElementNode* findButton { nullptr };
54 
55  unique_ptr<Action> findAction;
56  unique_ptr<Action> countAction;
57  unique_ptr<Action> replaceAction;
58  unique_ptr<Action> replaceAllAction;
59  unique_ptr<Action> completeAction;
60 
61 public:
62  // forbid class copy
64 
65  /**
66  * Public constructor
67  * @param popUps pop ups
68  */
70 
71  /**
72  * Destructor
73  */
75 
76  // overridden methods
77  GUIScreenNode* getScreenNode() override;
78  void initialize() override;
79  void dispose() override;
80  void onAction(GUIActionListenerType type, GUIElementNode* node) override;
81  void onFocus(GUIElementNode* node) override;
82  void onUnfocus(GUIElementNode* node) override;
83  void onTooltipShowRequest(GUINode* node, int mouseX, int mouseY) override;
84  void onTooltipCloseRequest() override;
85 
86  /**
87  * @return find text
88  */
89  const string getFindText();
90 
91  /**
92  * @return replace text
93  */
94  const string getReplaceText();
95 
96  /**
97  * @return is match case checked
98  */
99  bool isMatchCase();
100 
101  /**
102  * @return is whole world only checked
103  */
104  bool isWholeWordOnly();
105 
106  /**
107  * @return is in selection only checked
108  */
109  bool isInSelectionOnly();
110 
111  /**
112  * Shows the pop up
113  * @param findAction find action
114  * @param coundAction count action
115  * @param replaceAction replace action
116  * @param replaceAllAction replace all action
117  * @param completeAction complete action
118  */
120  /**
121  * Closes the pop up
122  */
123  void close();
124 
125 };
GUI node base class.
Definition: GUINode.h:64
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:72
void show(Action *findAction, Action *countAction, Action *replaceAction, Action *replaceAllAction, Action *completeAction)
Shows the pop up.
void onAction(GUIActionListenerType type, GUIElementNode *node) override
void onTooltipShowRequest(GUINode *node, int mouseX, int mouseY) override
On tooltip show request.
Pop ups controller accessor class.
Definition: PopUps.h:29
Mutable utf8 aware string class.
Definition: MutableString.h:23
GUI action listener interface.
GUI focus listener interface.
Screen controller, which connects GUI screen definition with code.
Action Interface.
Definition: Action.h:11
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6