TDME2
1.9.200
src
tdme
tools
editor
controllers
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
>
7
#include <
tdme/gui/events/fwd-tdme.h
>
8
#include <
tdme/gui/events/GUIActionListener.h
>
9
#include <
tdme/gui/events/GUITooltipRequestListener.h
>
10
#include <
tdme/gui/events/GUIFocusListener.h
>
11
#include <
tdme/gui/nodes/fwd-tdme.h
>
12
#include <
tdme/tools/editor/controllers/ScreenController.h
>
13
#include <
tdme/tools/editor/misc/fwd-tdme.h
>
14
#include <
tdme/utilities/fwd-tdme.h
>
15
16
using
std::string;
17
using
std::unique_ptr;
18
19
using
tdme::gui::events::GUIActionListener
;
20
using
tdme::gui::events::GUIActionListenerType
;
21
using
tdme::gui::events::GUITooltipRequestListener
;
22
using
tdme::gui::events::GUIFocusListener
;
23
using
tdme::gui::nodes::GUIElementNode
;
24
using
tdme::gui::nodes::GUIScreenNode
;
25
using
tdme::tools::editor::controllers::ScreenController
;
26
using
tdme::tools::editor::misc::PopUps
;
27
using
tdme::utilities::Action
;
28
using
tdme::utilities::MutableString
;
29
30
/**
31
* Find/Replace dialog screen controller
32
* @author Andreas Drewke
33
*/
34
class
tdme::tools::editor::controllers::FindReplaceDialogScreenController
final
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
};
45
GUIElementNode
*
replaceText
{
nullptr
};
46
GUIElementNode
*
matchCase
{
nullptr
};
47
GUIElementNode
*
wholeWordOnly
{
nullptr
};
48
GUIElementNode
*
inSelectionOnly
{
nullptr
};
49
GUIElementNode
*
findButton
{
nullptr
};
50
GUIElementNode
*
countButton
{
nullptr
};
51
GUIElementNode
*
cancelButton
{
nullptr
};
52
GUIElementNode
*
replaceButton
{
nullptr
};
53
GUIElementNode
*
replaceAllButton
{
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
63
FORBID_CLASS_COPY
(
FindReplaceDialogScreenController
)
64
65
/**
66
* Public constructor
67
* @param popUps pop ups
68
*/
69
FindReplaceDialogScreenController
(
PopUps
*
popUps
);
70
71
/**
72
* Destructor
73
*/
74
virtual
~FindReplaceDialogScreenController
();
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
*/
119
void
show
(
Action
*
findAction
,
Action
*
countAction
,
Action
*
replaceAction
,
Action
*
replaceAllAction
,
Action
*
completeAction
);
120
/**
121
* Closes the pop up
122
*/
123
void
close
();
124
125
};
GUIActionListener.h
GUIFocusListener.h
GUITooltipRequestListener.h
ScreenController.h
tdme::gui::nodes::GUIElementNode
GUI element node.
Definition:
GUIElementNode.h:37
tdme::gui::nodes::GUINode
GUI node base class.
Definition:
GUINode.h:64
tdme::gui::nodes::GUIScreenNode
GUI screen node that represents a screen that can be rendered via GUI system.
Definition:
GUIScreenNode.h:72
tdme::tools::editor::controllers::FindReplaceDialogScreenController
Find/Replace dialog screen controller.
Definition:
FindReplaceDialogScreenController.h:39
tdme::tools::editor::controllers::FindReplaceDialogScreenController::matchCase
GUIElementNode * matchCase
Definition:
FindReplaceDialogScreenController.h:46
tdme::tools::editor::controllers::FindReplaceDialogScreenController::dispose
void dispose() override
Dispose.
Definition:
FindReplaceDialogScreenController.cpp:88
tdme::tools::editor::controllers::FindReplaceDialogScreenController::replaceButton
GUIElementNode * replaceButton
Definition:
FindReplaceDialogScreenController.h:52
tdme::tools::editor::controllers::FindReplaceDialogScreenController::isInSelectionOnly
bool isInSelectionOnly()
Definition:
FindReplaceDialogScreenController.cpp:108
tdme::tools::editor::controllers::FindReplaceDialogScreenController::isWholeWordOnly
bool isWholeWordOnly()
Definition:
FindReplaceDialogScreenController.cpp:104
tdme::tools::editor::controllers::FindReplaceDialogScreenController::initialize
void initialize() override
Init.
Definition:
FindReplaceDialogScreenController.cpp:65
tdme::tools::editor::controllers::FindReplaceDialogScreenController::replaceAllButton
GUIElementNode * replaceAllButton
Definition:
FindReplaceDialogScreenController.h:53
tdme::tools::editor::controllers::FindReplaceDialogScreenController::show
void show(Action *findAction, Action *countAction, Action *replaceAction, Action *replaceAllAction, Action *completeAction)
Shows the pop up.
Definition:
FindReplaceDialogScreenController.cpp:112
tdme::tools::editor::controllers::FindReplaceDialogScreenController::getScreenNode
GUIScreenNode * getScreenNode() override
Definition:
FindReplaceDialogScreenController.cpp:60
tdme::tools::editor::controllers::FindReplaceDialogScreenController::countAction
unique_ptr< Action > countAction
Definition:
FindReplaceDialogScreenController.h:56
tdme::tools::editor::controllers::FindReplaceDialogScreenController::replaceAction
unique_ptr< Action > replaceAction
Definition:
FindReplaceDialogScreenController.h:57
tdme::tools::editor::controllers::FindReplaceDialogScreenController::close
void close()
Closes the pop up.
Definition:
FindReplaceDialogScreenController.cpp:124
tdme::tools::editor::controllers::FindReplaceDialogScreenController::FindReplaceDialogScreenController
FindReplaceDialogScreenController(PopUps *popUps)
Public constructor.
Definition:
FindReplaceDialogScreenController.cpp:52
tdme::tools::editor::controllers::FindReplaceDialogScreenController::onUnfocus
void onUnfocus(GUIElementNode *node) override
On unfocus.
Definition:
FindReplaceDialogScreenController.cpp:162
tdme::tools::editor::controllers::FindReplaceDialogScreenController::replaceText
GUIElementNode * replaceText
Definition:
FindReplaceDialogScreenController.h:45
tdme::tools::editor::controllers::FindReplaceDialogScreenController::findAction
unique_ptr< Action > findAction
Definition:
FindReplaceDialogScreenController.h:55
tdme::tools::editor::controllers::FindReplaceDialogScreenController::onTooltipCloseRequest
void onTooltipCloseRequest() override
On tooltip close request.
Definition:
FindReplaceDialogScreenController.cpp:169
tdme::tools::editor::controllers::FindReplaceDialogScreenController::findText
GUIElementNode * findText
Definition:
FindReplaceDialogScreenController.h:44
tdme::tools::editor::controllers::FindReplaceDialogScreenController::replaceAllAction
unique_ptr< Action > replaceAllAction
Definition:
FindReplaceDialogScreenController.h:58
tdme::tools::editor::controllers::FindReplaceDialogScreenController::screenNode
GUIScreenNode * screenNode
Definition:
FindReplaceDialogScreenController.h:43
tdme::tools::editor::controllers::FindReplaceDialogScreenController::cancelButton
GUIElementNode * cancelButton
Definition:
FindReplaceDialogScreenController.h:51
tdme::tools::editor::controllers::FindReplaceDialogScreenController::onFocus
void onFocus(GUIElementNode *node) override
On focus.
Definition:
FindReplaceDialogScreenController.cpp:158
tdme::tools::editor::controllers::FindReplaceDialogScreenController::~FindReplaceDialogScreenController
virtual ~FindReplaceDialogScreenController()
Destructor.
Definition:
FindReplaceDialogScreenController.cpp:56
tdme::tools::editor::controllers::FindReplaceDialogScreenController::findButton
GUIElementNode * findButton
Definition:
FindReplaceDialogScreenController.h:49
tdme::tools::editor::controllers::FindReplaceDialogScreenController::inSelectionOnly
GUIElementNode * inSelectionOnly
Definition:
FindReplaceDialogScreenController.h:48
tdme::tools::editor::controllers::FindReplaceDialogScreenController::wholeWordOnly
GUIElementNode * wholeWordOnly
Definition:
FindReplaceDialogScreenController.h:47
tdme::tools::editor::controllers::FindReplaceDialogScreenController::getReplaceText
const string getReplaceText()
Definition:
FindReplaceDialogScreenController.cpp:96
tdme::tools::editor::controllers::FindReplaceDialogScreenController::popUps
PopUps * popUps
Definition:
FindReplaceDialogScreenController.h:42
tdme::tools::editor::controllers::FindReplaceDialogScreenController::countButton
GUIElementNode * countButton
Definition:
FindReplaceDialogScreenController.h:50
tdme::tools::editor::controllers::FindReplaceDialogScreenController::onAction
void onAction(GUIActionListenerType type, GUIElementNode *node) override
Definition:
FindReplaceDialogScreenController.cpp:134
tdme::tools::editor::controllers::FindReplaceDialogScreenController::completeAction
unique_ptr< Action > completeAction
Definition:
FindReplaceDialogScreenController.h:59
tdme::tools::editor::controllers::FindReplaceDialogScreenController::isMatchCase
bool isMatchCase()
Definition:
FindReplaceDialogScreenController.cpp:100
tdme::tools::editor::controllers::FindReplaceDialogScreenController::getFindText
const string getFindText()
Definition:
FindReplaceDialogScreenController.cpp:92
tdme::tools::editor::controllers::FindReplaceDialogScreenController::onTooltipShowRequest
void onTooltipShowRequest(GUINode *node, int mouseX, int mouseY) override
On tooltip show request.
Definition:
FindReplaceDialogScreenController.cpp:165
tdme::tools::editor::misc::PopUps
Pop ups controller accessor class.
Definition:
PopUps.h:29
tdme::utilities::MutableString
Mutable utf8 aware string class.
Definition:
MutableString.h:23
fwd-tdme.h
fwd-tdme.h
tdme::gui::events::GUIActionListenerType
GUIActionListenerType
Definition:
GUIActionListener.h:12
tdme::gui::events::GUIActionListener
GUI action listener interface.
Definition:
GUIActionListener.h:25
tdme::gui::events::GUIFocusListener
GUI focus listener interface.
Definition:
GUIFocusListener.h:14
tdme::gui::events::GUITooltipRequestListener
GUI tooltip request listener.
Definition:
GUITooltipRequestListener.h:14
tdme::tools::editor::controllers::ScreenController
Screen controller, which connects GUI screen definition with code.
Definition:
ScreenController.h:14
tdme::utilities::Action
Action Interface.
Definition:
Action.h:11
tdme.h
FORBID_CLASS_COPY
#define FORBID_CLASS_COPY(CLASS)
Definition:
tdme.h:6
fwd-tdme.h
fwd-tdme.h
Generated by
1.9.1