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

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 __parts_h__
0009 #define __parts_h__
0010 
0011 #include <kparts/readonlypart.h>
0012 
0013 class QTextEdit;
0014 namespace KParts
0015 {
0016 class GUIActivateEvent;
0017 }
0018 
0019 class Part1 : public KParts::ReadOnlyPart
0020 {
0021     Q_OBJECT
0022 public:
0023     Part1(QObject *parent, QWidget *parentWidget);
0024     ~Part1() override;
0025 
0026 public Q_SLOTS:
0027     void slotBlah();
0028     void slotFooBar();
0029 
0030 protected:
0031     bool openFile() override;
0032 
0033 protected:
0034     QTextEdit *m_edit;
0035 };
0036 
0037 class Part2 : public KParts::Part
0038 {
0039     Q_OBJECT
0040 public:
0041     Part2(QObject *parent, QWidget *parentWidget);
0042     ~Part2() override;
0043 
0044 protected:
0045     // This is not mandatory - only if you care about setting the
0046     // part caption when the part is used in a multi-part environment
0047     // (i.e. in a part manager)
0048     // There is a default impl for ReadOnlyPart...
0049     void guiActivateEvent(KParts::GUIActivateEvent *) override;
0050 };
0051 
0052 #endif