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 <tqwidgetplugin.h>
00025 #include <tqwidget.h>
00026 namespace KParts { class ReadOnlyPart; }
00027 
00032 class KPartsGenericPart : public TQWidget {
00033     Q_OBJECT
00034     Q_PROPERTY( TQString url READ url WRITE setURL )
00035     Q_PROPERTY( TQString mimetype READ mimetype WRITE setMimetype )
00036 public:
00037     KPartsGenericPart( TQWidget* parentWidget, const char* name );
00038 
00039     TQString url() const { return m_url; }
00040     void setURL( const TQString& url ) { m_url = url; load(); }
00041 
00042     // The mimetype, or "auto" if unknown
00043     TQString mimetype() const { return m_mimetype; }
00044     void setMimetype( const TQString& mimetype ) { m_mimetype = mimetype; load(); }
00045 
00046 private:
00047     void load();
00048 
00049 private:
00050     TQString m_mimetype;
00051     TQString m_url;
00052     KParts::ReadOnlyPart* m_part;
00053 };
00054 
00058 class KPartsWidgetPlugin : public TQWidgetPlugin {
00059 public:
00060   TQStringList keys() const;
00061   TQWidget * create( const TQString & key, TQWidget * parent, const char * name );
00062   TQString group( const TQString & key ) const;
00063   //TQIconSet iconSet( const TQString & key ) const;
00064   TQString includeFile( const TQString & key ) const;
00065   TQString toolTip( const TQString & key ) const;
00066   TQString whatsThis( const TQString & key ) const;
00067   bool isContainer( const TQString & key ) const;
00068 };
00069 
00070 #endif