diff options
author | Robert Bieber <robby@bieberphoto.com> | 2010-07-23 07:31:53 +0000 |
---|---|---|
committer | Robert Bieber <robby@bieberphoto.com> | 2010-07-23 07:31:53 +0000 |
commit | e6fd3d0318d0f53c51cf4cc87ccdc8f9741957e7 (patch) | |
tree | da29255f5c33ae915c28a1dbff5525fdf912fbe6 /utils/themeeditor/qtfindreplacedialog/varianteditor.h | |
parent | b21b7714209230cbadab1e709c6778c4cc214437 (diff) | |
download | rockbox-e6fd3d0318d0f53c51cf4cc87ccdc8f9741957e7.tar.gz rockbox-e6fd3d0318d0f53c51cf4cc87ccdc8f9741957e7.zip |
Theme Editor: Switched back to Lorenzo Bettini's find/replace dialog (with some modifications) as he changed the license to LGPL v2.1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27528 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/qtfindreplacedialog/varianteditor.h')
-rw-r--r-- | utils/themeeditor/qtfindreplacedialog/varianteditor.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/utils/themeeditor/qtfindreplacedialog/varianteditor.h b/utils/themeeditor/qtfindreplacedialog/varianteditor.h new file mode 100644 index 0000000000..f5c9f57d43 --- /dev/null +++ b/utils/themeeditor/qtfindreplacedialog/varianteditor.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Copyright 2010, Robert Bieber | ||
3 | * Licensed under the LGPLv2.1, see the COPYING file for more information | ||
4 | */ | ||
5 | |||
6 | #ifndef VARIANTEDITOR_H | ||
7 | #define VARIANTEDITOR_H | ||
8 | |||
9 | #include <QTextDocument> | ||
10 | |||
11 | class QTextEdit; | ||
12 | class QPlainTextEdit; | ||
13 | class QPushButton; | ||
14 | class QTextCursor; | ||
15 | |||
16 | /** | ||
17 | * A simple class that transparently wraps a pointer to either | ||
18 | * a QPlainTextEdit or a QTextEdit, providing access to functions common | ||
19 | * to each of them | ||
20 | */ | ||
21 | |||
22 | class VariantEditor | ||
23 | { | ||
24 | public: | ||
25 | VariantEditor(QTextEdit* textEdit); | ||
26 | VariantEditor(QPlainTextEdit* textEdit); | ||
27 | |||
28 | void connectToSetEnabled(QPushButton* button); | ||
29 | |||
30 | QTextDocument* document(); | ||
31 | void setTextCursor(const QTextCursor& cursor); | ||
32 | bool find(const QString& exp, QTextDocument::FindFlags flags); | ||
33 | QTextCursor textCursor() const; | ||
34 | |||
35 | private: | ||
36 | QPlainTextEdit* plainTextEdit; | ||
37 | QTextEdit* textEdit; | ||
38 | |||
39 | enum{ Plain, Rich} type; | ||
40 | |||
41 | }; | ||
42 | |||
43 | #endif // VARIANTEDITOR_H | ||