Theme Editor: Added an edit menu with a find/replace function (copied from an LGPL...
[kugel-rb.git] / utils / themeeditor / findreplace / findreplacedialog.h
blobc3f2539113ff28daa63e80e483af052f813f6ce0
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * This file has been copied from Lorenzo Bettini, with minor modifications
11 * made available under the LGPL version 3, as the original file was licensed
13 ****************************************************************************
15 * Copyright (C) 2009 Lorenzo Bettini <http://www.lorenzobettini.it>
16 * See COPYING file that comes with this distribution
19 #ifndef FINDREPLACEDIALOG_H
20 #define FINDREPLACEDIALOG_H
22 #include <QDialog>
23 #include <QPlainTextEdit>
25 namespace Ui {
26 class FindReplaceDialog;
29 class QTextEdit;
30 class QSettings;
32 /**
33 * A find/replace dialog.
35 * It relies on a FindReplaceForm object (see that class for the functionalities provided).
37 class FindReplaceDialog : public QDialog {
38 Q_OBJECT
39 public:
40 FindReplaceDialog(QWidget *parent = 0);
41 virtual ~FindReplaceDialog();
43 /**
44 * Associates the text editor where to perform the search
45 * @param textEdit
47 void setTextEdit(QPlainTextEdit *textEdit);
49 /**
50 * Writes the state of the form to the passed settings.
51 * @param settings
52 * @param prefix the prefix to insert in the settings
54 virtual void writeSettings(QSettings &settings, const QString &prefix = "FindReplaceDialog");
56 /**
57 * Reads the state of the form from the passed settings.
58 * @param settings
59 * @param prefix the prefix to look for in the settings
61 virtual void readSettings(QSettings &settings, const QString &prefix = "FindReplaceDialog");
63 public slots:
64 /**
65 * Finds the next occurrence
67 void findNext();
69 /**
70 * Finds the previous occurrence
72 void findPrev();
74 protected:
75 void changeEvent(QEvent *e);
77 Ui::FindReplaceDialog *ui;
80 #endif // FINDREPLACEDIALOG_H