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