MySQL Workbench
6.1
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
find_panel.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
3
*
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; version 2 of the
7
* License.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17
* 02110-1301 USA
18
*/
19
20
#ifndef _MFORMS_FINDPANEL_H_
21
#define _MFORMS_FINDPANEL_H_
22
23
24
#include "
mforms/view.h
"
25
26
namespace
mforms
27
{
28
class
CodeEditor;
29
30
enum
FindPanelAction
31
{
32
FindNext
,
// Select next occurrence after current selection or after current caret position
33
// (if there is no selection).
34
FindPrevious
,
// Same as FindNext, but backwards.
35
Replace
,
// Replace what is selected currently.
36
ReplaceAndFind
,
// Replace current selection (whatever it is) or insert at caret position
37
// (if there is no selection) and select the next occurrence.
38
FindAndReplace
,
// Replace next occurrence after current selection or after current caret position.
39
ReplaceAll
,
// Replace all occurrences of the search text.
40
};
41
42
class
FindPanel;
43
44
#ifndef DOXYGEN_SHOULD_SKIP_THIS
45
#ifndef SWIG
46
struct
FindPanelImplPtrs
47
{
48
bool (*create)(FindPanel *fp);
49
int (*perform_action)(FindPanel *fp,
FindPanelAction
action);
50
void (*focus)(FindPanel *fp);
51
void (*enable_replace)(FindPanel *fp, bool);
52
};
53
#endif
54
#endif
55
56
// Implementation is in platform specific code
57
class
MFORMS_EXPORT
FindPanel
:
public
View
58
{
59
protected
:
60
FindPanelImplPtrs *
_find_impl
;
61
CodeEditor
*
_editor
;
62
63
public
:
64
FindPanel
(
CodeEditor
*editor);
65
66
CodeEditor
*
get_editor
() {
return
_editor; }
67
69
int
perform_action(
FindPanelAction
action);
70
71
virtual
void
focus();
72
void
enable_replace(
bool
flag);
73
};
74
};
75
76
#endif
mforms::Replace
Definition:
find_panel.h:35
MFORMS_EXPORT
#define MFORMS_EXPORT
Definition:
base.h:33
mforms::FindPanel
Definition:
find_panel.h:57
view.h
mforms::FindPanel::_editor
CodeEditor * _editor
Definition:
find_panel.h:61
mforms::ReplaceAndFind
Definition:
find_panel.h:36
mforms::FindPanel::get_editor
CodeEditor * get_editor()
Definition:
find_panel.h:66
mforms::CodeEditor
Definition:
code_editor.h:188
mforms::FindPanelAction
FindPanelAction
Definition:
find_panel.h:30
mforms::FindPanel::_find_impl
FindPanelImplPtrs * _find_impl
Definition:
find_panel.h:60
mforms::FindAndReplace
Definition:
find_panel.h:38
mforms::ReplaceAll
Definition:
find_panel.h:39
mforms::FindPrevious
Definition:
find_panel.h:34
mforms::FindNext
Definition:
find_panel.h:32
mforms::View
Definition:
view.h:201
MySQL Workbench 6.1 documentation