File indexing completed on 2024-04-28 15:29:18

0001 /*
0002     SPDX-FileCopyrightText: 1999, 2000 David Faure <faure@kde.org>
0003     SPDX-FileCopyrightText: 1999, 2000 Simon Hausmann <hausmann@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #ifndef notepad_h
0009 #define notepad_h
0010 
0011 #include <KPluginFactory>
0012 #include <kparts/readwritepart.h>
0013 
0014 class KPluginMetaData;
0015 class QTextEdit;
0016 
0017 /**
0018  * Who said writing a part should be complex ? :-)
0019  * Here is a very simple kedit-like part
0020  * @internal
0021  */
0022 class NotepadPart : public KParts::ReadWritePart
0023 {
0024     Q_OBJECT
0025 public:
0026     NotepadPart(QWidget *parentWidget, QObject *parent, const KPluginMetaData &metaData, const QVariantList &args = QVariantList());
0027     ~NotepadPart() override;
0028 
0029     void setReadWrite(bool rw) override;
0030 
0031 protected:
0032     bool openFile() override;
0033     bool saveFile() override;
0034 
0035 protected Q_SLOTS:
0036     void slotSearchReplace();
0037 
0038 protected:
0039     QTextEdit *m_edit;
0040 };
0041 
0042 #endif