rockbox/utils/themeeditor/qtfindreplacedialog/varianteditor.h
Robert Bieber e6fd3d0318 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
2010-07-23 07:31:53 +00:00

43 lines
920 B
C++

/*
* Copyright 2010, Robert Bieber
* Licensed under the LGPLv2.1, see the COPYING file for more information
*/
#ifndef VARIANTEDITOR_H
#define VARIANTEDITOR_H
#include <QTextDocument>
class QTextEdit;
class QPlainTextEdit;
class QPushButton;
class QTextCursor;
/**
* A simple class that transparently wraps a pointer to either
* a QPlainTextEdit or a QTextEdit, providing access to functions common
* to each of them
*/
class VariantEditor
{
public:
VariantEditor(QTextEdit* textEdit);
VariantEditor(QPlainTextEdit* textEdit);
void connectToSetEnabled(QPushButton* button);
QTextDocument* document();
void setTextCursor(const QTextCursor& cursor);
bool find(const QString& exp, QTextDocument::FindFlags flags);
QTextCursor textCursor() const;
private:
QPlainTextEdit* plainTextEdit;
QTextEdit* textEdit;
enum{ Plain, Rich} type;
};
#endif // VARIANTEDITOR_H