File indexing completed on 2024-05-12 16:39:41

0001 /* This file is part of the KDE project
0002    Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
0003    Copyright (C) 2003,2005 Jarosław Staniek <staniek@kde.org>
0004 
0005    This library is free software; you can redistribute it and/or
0006    modify it under the terms of the GNU Library General Public
0007    License as published by the Free Software Foundation; either
0008    version 2 of the License, or (at your option) any later version.
0009 
0010    This library is distributed in the hope that it will be useful,
0011    but WITHOUT ANY WARRANTY; without even the implied warranty of
0012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013    Library General Public License for more details.
0014 
0015    You should have received a copy of the GNU Library General Public License
0016    along with this library; see the file COPYING.LIB.  If not, write to
0017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018  * Boston, MA 02110-1301, USA.
0019 */
0020 
0021 #ifndef KEXISTATICPART_H
0022 #define KEXISTATICPART_H
0023 
0024 #include "kexipart.h"
0025 #include "kexipartinfo.h"
0026 
0027 namespace KexiPart
0028 {
0029 
0030 /**
0031  * @short Information about a static Kexi Part (plugin).
0032  */
0033 class KEXICORE_EXPORT StaticPartInfo : public Info
0034 {
0035 public:
0036     StaticPartInfo(const QString& pluginId, const QString& itemIcon,
0037                    const QString& objectName);
0038     ~StaticPartInfo();
0039 
0040 protected:
0041 };
0042 
0043 /**
0044  * @short Static Kexi Part (plugin).
0045  */
0046 class KEXICORE_EXPORT StaticPart : public Part
0047 {
0048 public:
0049     StaticPart(const QString& pluginId, const QString& itemIcon,
0050                const QString& objectName);
0051     virtual ~StaticPart();
0052 
0053     /*! Creates a new view for mode \a viewMode, \a item and \a parent. The view will be
0054      used inside \a window. \a args arguments can be passed. */
0055     virtual Q_REQUIRED_RESULT KexiView *createView(QWidget *parent, KexiWindow *window,
0056                                                    KexiPart::Item *item, Kexi::ViewMode viewMode,
0057                                                    QMap<QString, QVariant> *args) override = 0;
0058 
0059 protected:
0060     //! unused by static parts
0061     Q_REQUIRED_RESULT KexiView *createView(QWidget *parent, KexiWindow *window,
0062                                            KexiPart::Item *item,
0063                                            Kexi::ViewMode viewMode = Kexi::DataViewMode) override;
0064 };
0065 
0066 }
0067 
0068 #endif