tdepartsdesignerplugin.h
1 /*
2  Copyright (C) 2005, David Faure <faure@kde.org>
3  This file is part of the KDE project
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2, as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 
21 #ifndef DESIGNER_PARTPLUGIN_H
22 #define DESIGNER_PARTPLUGIN_H
23 
24 #include <tqwidgetplugin.h>
25 #include <tqwidget.h>
26 namespace KParts { class ReadOnlyPart; }
27 
32 class KPartsGenericPart : public TQWidget {
33  TQ_OBJECT
34 
35  TQ_PROPERTY( TQString url READ url WRITE setURL )
36  TQ_PROPERTY( TQString mimetype READ mimetype WRITE setMimetype )
37 public:
38  KPartsGenericPart( TQWidget* parentWidget, const char* name );
39 
40  TQString url() const { return m_url; }
41  void setURL( const TQString& url ) { m_url = url; load(); }
42 
43  // The mimetype, or "auto" if unknown
44  TQString mimetype() const { return m_mimetype; }
45  void setMimetype( const TQString& mimetype ) { m_mimetype = mimetype; load(); }
46 
47 private:
48  void load();
49 
50 private:
51  TQString m_mimetype;
52  TQString m_url;
53  KParts::ReadOnlyPart* m_part;
54 };
55 
59 class KPartsWidgetPlugin : public TQWidgetPlugin {
60 public:
61  TQStringList keys() const;
62  TQWidget * create( const TQString & key, TQWidget * parent, const char * name );
63  TQString group( const TQString & key ) const;
64  //TQIconSet iconSet( const TQString & key ) const;
65  TQString includeFile( const TQString & key ) const;
66  TQString toolTip( const TQString & key ) const;
67  TQString whatsThis( const TQString & key ) const;
68  bool isContainer( const TQString & key ) const;
69 };
70 
71 #endif
Generic part loader, able to view any kind of file for which a KParts::ReadOnlyPart is available.
TQt designer plugin for embedding a KParts using KPartsGenericPart.
editor.h