F:/KPlato/koffice/libs/flake/KoShapeFactory.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002  * Copyright (c) 2006 Boudewijn Rempt (boud@valdyas.org)
00003  * Copyright (C) 2006 Thomas Zander <zander@kde.org>
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public License
00016  * along with this library; see the file COPYING.LIB.  If not, write to
00017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #ifndef _KO_SHAPE_FACTORY_
00022 #define _KO_SHAPE_FACTORY_
00023 
00024 #include <QString>
00025 #include <QWidget>
00026 #include <QList>
00027 
00028 #include <KoID.h>
00029 
00030 #include <koffice_export.h>
00031 
00032 class KoShape;
00033 class KoProperties;
00034 class KoShapeConfigFactory;
00035 class KoShapeConfigWidgetBase;
00036 
00037 
00043 struct FLAKE_EXPORT KoShapeTemplate {
00044     KoShapeTemplate() {
00045         id="";
00046         name="";
00047         toolTip="";
00048         icon="";
00049     }
00050     QString id;         
00051     QString name;       
00052     QString toolTip;    
00053     QString icon;       
00054 
00058     KoProperties *properties;
00059 };
00060 
00082 class FLAKE_EXPORT KoShapeFactory : public QObject {
00083     Q_OBJECT
00084 public:
00085 
00093     KoShapeFactory(QObject *parent, const QString &id, const QString &name);
00094     virtual ~KoShapeFactory() {}
00095 
00104     virtual KoShape * createDefaultShape() = 0;
00112     virtual KoShape * createShape(const KoProperties * params) const = 0;
00120     virtual QList<KoShapeConfigWidgetBase*> createShapeOptionPanels() {
00121         return QList<KoShapeConfigWidgetBase*>();
00122     }
00123 
00138     void setOptionPanels(QList<KoShapeConfigFactory*> &panelFactories);
00139 
00144     const QList<KoShapeConfigFactory*> &panelFactories();
00145 
00149     const KoID id() const;
00154     const QString & shapeId() const;
00159     const QList<KoShapeTemplate> templates() const { return m_templates; }
00164     const QString & toolTip() const;
00169     const QString & icon() const;
00174     const QString & name() const;
00175 
00176 protected:
00177 
00183     void addTemplate(KoShapeTemplate params);
00188     void setToolTip(const QString & tooltip);
00194     void setIcon(const QString & iconName);
00195 
00196 private:
00197 
00198     QList<KoShapeTemplate> m_templates;
00199     QList<KoShapeConfigFactory*> m_configPanels;
00200     const QString m_id, m_name;
00201     QString m_tooltip;
00202     QString m_iconName;
00203 };
00204 
00205 #endif // _KO_SHAPE_FACTORY_

Généré le Wed Nov 22 23:40:59 2006 pour KPlato par  doxygen 1.5.1-p1