summaryrefslogtreecommitdiff
path: root/utils/themeeditor/qtfindreplacedialog/varianteditor.h
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-23 07:31:53 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-23 07:31:53 +0000
commite6fd3d0318d0f53c51cf4cc87ccdc8f9741957e7 (patch)
treeda29255f5c33ae915c28a1dbff5525fdf912fbe6 /utils/themeeditor/qtfindreplacedialog/varianteditor.h
parentb21b7714209230cbadab1e709c6778c4cc214437 (diff)
downloadrockbox-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.h43
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
11class QTextEdit;
12class QPlainTextEdit;
13class QPushButton;
14class 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
22class VariantEditor
23{
24public:
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
35private:
36 QPlainTextEdit* plainTextEdit;
37 QTextEdit* textEdit;
38
39 enum{ Plain, Rich} type;
40
41};
42
43#endif // VARIANTEDITOR_H