tabs -> spaces in the new Yesno java files and remove unused imports.
[kugel-rb.git] / utils / themeeditor / qtfindreplacedialog / varianteditor.h
blobf5c9f57d43adc8d268c049b987cb05b48dc0e53b
1 /*
2 * Copyright 2010, Robert Bieber
3 * Licensed under the LGPLv2.1, see the COPYING file for more information
4 */
6 #ifndef VARIANTEDITOR_H
7 #define VARIANTEDITOR_H
9 #include <QTextDocument>
11 class QTextEdit;
12 class QPlainTextEdit;
13 class QPushButton;
14 class QTextCursor;
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
22 class VariantEditor
24 public:
25 VariantEditor(QTextEdit* textEdit);
26 VariantEditor(QPlainTextEdit* textEdit);
28 void connectToSetEnabled(QPushButton* button);
30 QTextDocument* document();
31 void setTextCursor(const QTextCursor& cursor);
32 bool find(const QString& exp, QTextDocument::FindFlags flags);
33 QTextCursor textCursor() const;
35 private:
36 QPlainTextEdit* plainTextEdit;
37 QTextEdit* textEdit;
39 enum{ Plain, Rich} type;
43 #endif // VARIANTEDITOR_H