filters
xfigimport.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef XFIGIMPORT_H
00026 #define XFIGIMPORT_H
00027
00028 #include <qintdict.h>
00029 #include <qvaluelist.h>
00030 #include <iostream.h>
00031
00032 class GDocument;
00033 class GObject;
00034 class QColor;
00035
00036 #include <KoFilter.h>
00037 #include <qobject.h>
00038 #include <qstring.h>
00039
00040 class XFIGImport : public KoFilter
00041 {
00042 Q_OBJECT
00043
00044 public:
00045 XFIGImport( KoFilter *parent, const char *name );
00046 virtual ~XFIGImport();
00047
00048 virtual bool filterImport( const QString &file, KoDocument *,
00049 const QString &from, const QString &to,
00050 const QString &config=QString::null );
00051
00052 private:
00053 void parseColorObject (istream& fin);
00054 void parseArc (istream& fin, GDocument* doc);
00055 void parseEllipse (istream& fin, GDocument* doc);
00056 void parsePolyline (istream& fin, GDocument* doc);
00057 void parseSpline (istream& fin, GDocument* doc);
00058 void parseText (istream& fin, GDocument* doc);
00059 void parseCompoundObject (istream& fin, GDocument* doc);
00060 void buildDocument (GDocument *doc);
00061
00062 void setProperties (GObject* obj, int pen_color, int style, int thickness,
00063 int area_fill, int fill_color);
00064
00065 float fig_resolution;
00066 int coordinate_system;
00067 int version;
00068 QIntDict<QColor> colorTable;
00069
00070
00071
00072 struct GObjectListItem
00073 {
00074 GObjectListItem() : object(0L) {}
00075
00076 GObjectListItem( int d, GObject * obj ) :
00077 object(obj), depth(d) {}
00078
00079 GObject * object;
00080 int depth;
00081 bool operator < (const GObjectListItem & item ) const
00082 {
00083
00084 return depth > item.depth;
00085 }
00086 bool operator == (const GObjectListItem & item ) const
00087 {
00088 return depth == item.depth;
00089 }
00090 };
00091 QValueList<GObjectListItem> objList;
00092 };
00093
00094 #endif
|