libkdepim

kpartsdesignerplugin.h

00001 /*
00002     Copyright (C) 2005, David Faure <faure@kde.org>
00003     This file is part of the KDE project
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 version 2, as published by the Free Software Foundation.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, USA.
00018 */
00019 
00020 
00021 #ifndef DESIGNER_PARTPLUGIN_H
00022 #define DESIGNER_PARTPLUGIN_H
00023 
00024 #include <qwidgetplugin.h>
00025 #include <qwidget.h>
00026 namespace KParts { class ReadOnlyPart; }
00027 
00032 class KPartsGenericPart : public QWidget {
00033     Q_OBJECT
00034     Q_PROPERTY( QString url READ url WRITE setURL )
00035     Q_PROPERTY( QString mimetype READ mimetype WRITE setMimetype )
00036 public:
00037     KPartsGenericPart( QWidget* parentWidget, const char* name );
00038 
00039     QString url() const { return m_url; }
00040     void setURL( const QString& url ) { m_url = url; load(); }
00041 
00042     // The mimetype, or "auto" if unknown
00043     QString mimetype() const { return m_mimetype; }
00044     void setMimetype( const QString& mimetype ) { m_mimetype = mimetype; load(); }
00045 
00046 private:
00047     void load();
00048 
00049 private:
00050     QString m_mimetype;
00051     QString m_url;
00052     KParts::ReadOnlyPart* m_part;
00053 };
00054 
00058 class KPartsWidgetPlugin : public QWidgetPlugin {
00059 public:
00060   QStringList keys() const;
00061   QWidget * create( const QString & key, QWidget * parent, const char * name );
00062   QString group( const QString & key ) const;
00063   //QIconSet iconSet( const QString & key ) const;
00064   QString includeFile( const QString & key ) const;
00065   QString toolTip( const QString & key ) const;
00066   QString whatsThis( const QString & key ) const;
00067   bool isContainer( const QString & key ) const;
00068 };
00069 
00070 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys