From e6fd3d0318d0f53c51cf4cc87ccdc8f9741957e7 Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Fri, 23 Jul 2010 07:31:53 +0000 Subject: 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 --- .../qtfindreplacedialog/findreplacedialog.h | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 utils/themeeditor/qtfindreplacedialog/findreplacedialog.h (limited to 'utils/themeeditor/qtfindreplacedialog/findreplacedialog.h') diff --git a/utils/themeeditor/qtfindreplacedialog/findreplacedialog.h b/utils/themeeditor/qtfindreplacedialog/findreplacedialog.h new file mode 100644 index 0000000000..78e87371cd --- /dev/null +++ b/utils/themeeditor/qtfindreplacedialog/findreplacedialog.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2009 Lorenzo Bettini + * See COPYING file that comes with this distribution + */ + +#ifndef FINDREPLACEDIALOG_H +#define FINDREPLACEDIALOG_H + +#include + +#include "findreplace_global.h" + +namespace Ui { + class FindReplaceDialog; +} + +class QTextEdit; +class QPlainTextEdit; +class QSettings; + +/** + * A find/replace dialog. + * + * It relies on a FindReplaceForm object (see that class for the functionalities provided). + */ +class FINDREPLACESHARED_EXPORT FindReplaceDialog : public QDialog { + Q_OBJECT +public: + FindReplaceDialog(QWidget *parent = 0); + virtual ~FindReplaceDialog(); + + /** + * Associates the text editor where to perform the search + * @param textEdit + */ + void setTextEdit(QTextEdit *textEdit); + + /** + * Associates the text editor where to perform the search + * @param textEdit + */ + void setTextEdit(QPlainTextEdit *textEdit); + + + /** + * Writes the state of the form to the passed settings. + * @param settings + * @param prefix the prefix to insert in the settings + */ + virtual void writeSettings(QSettings &settings, const QString &prefix = "FindReplaceDialog"); + + /** + * Reads the state of the form from the passed settings. + * @param settings + * @param prefix the prefix to look for in the settings + */ + virtual void readSettings(QSettings &settings, const QString &prefix = "FindReplaceDialog"); + +public slots: + /** + * Finds the next occurrence + */ + void findNext(); + + /** + * Finds the previous occurrence + */ + void findPrev(); + +protected: + void changeEvent(QEvent *e); + + Ui::FindReplaceDialog *ui; +}; + +#endif // FINDREPLACEDIALOG_H -- cgit v1.2.3