moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kig / filters / exporter.h
blob96bb63788e246b2138ae06b4e08c13039e7e6895
1 // Copyright (C) 2003 Dominique Devriese <devriese@kde.org>
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
16 // 02111-1307, USA.
18 #ifndef KIG_FILTERS_EXPORTER_H
19 #define KIG_FILTERS_EXPORTER_H
21 #include <vector>
23 class QString;
24 class KigDocument;
25 class KigPart;
26 class KigWidget;
27 class KActionCollection;
29 class KigExporter;
31 class KigExportManager
33 std::vector<KigExporter*> mexporters;
34 KigExportManager();
35 ~KigExportManager();
36 public:
37 static KigExportManager* instance();
38 void addMenuAction( const KigPart* doc, KigWidget* w,
39 KActionCollection* coll );
42 class KigExporter
44 public:
45 virtual ~KigExporter();
47 /**
48 * Returns a statement like i18n( "Export to image" )
50 virtual QString exportToStatement() const = 0;
51 /**
52 * Returns a string like i18n( "Image..." )
54 virtual QString menuEntryName() const = 0;
55 /**
56 * Returns a string with the name of the icon
58 virtual QString menuIcon() const = 0;
60 /**
61 * Do what you need to do. It's up to the individual exporters to
62 * ask the user for which file to export to etc., because they can
63 * do a much better job at that..
65 virtual void run( const KigPart& doc, KigWidget& w ) = 0;
68 /**
69 * This exporter takes care of the "Export to Image" stuff..
71 class ImageExporter
72 : public KigExporter
74 public:
75 ~ImageExporter();
76 QString exportToStatement() const;
77 QString menuEntryName() const;
78 QString menuIcon() const;
79 void run( const KigPart& doc, KigWidget& w );
82 /**
83 * Guess what this one does ;)
84 * It exports to the XFig file format, as documented in the file
85 * FORMAT3.2 in the XFig source distribution.
87 class XFigExporter
88 : public KigExporter
90 public:
91 ~XFigExporter();
92 QString exportToStatement() const;
93 QString menuEntryName() const;
94 QString menuIcon() const;
95 void run( const KigPart& doc, KigWidget& w );
97 #endif