Go to the documentation of this file.00001
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 GCU_LOADER_H
00026 #define GCU_LOADER_H
00027
00028 #include "structs.h"
00029 #include <list>
00030 #include <map>
00031 #include <string>
00032 #include <goffice/goffice.h>
00033 #include <gsf/gsf-input.h>
00034 #include <gsf/gsf-output.h>
00035
00037 namespace gcu {
00038
00039 class Document;
00040 class Loader;
00041 class Object;
00042
00048 typedef struct {
00052 Loader *loader;
00056 bool read;
00060 bool write;
00064 bool supports2D;
00068 bool supports3D;
00072 bool supportsCrystals;
00076 bool supportsSpectra;
00077 } LoaderStruct;
00078
00144 class Loader
00145 {
00146 public:
00151 Loader ();
00156 virtual ~Loader ();
00157
00158
00165 static void Init (Application *app);
00174 static bool GetFirstLoader (std::map<std::string, LoaderStruct>::iterator &it);
00181 static bool GetNextLoader (std::map<std::string, LoaderStruct>::iterator &it);
00186 static Loader *GetLoader (char const *mime_type);
00191 static Loader *GetSaver (char const *mime_type);
00192
00193
00205 virtual ContentType Read (Document *doc, GsfInput *in, char const *mime_type, GOIOContext *io);
00218 virtual bool Write (Object const *obj, GsfOutput *out, char const *mime_type, GOIOContext *io, ContentType type = ContentTypeMisc);
00219
00220 protected:
00226 void AddMimeType (const char *mime_type);
00232 void RemoveMimeType (const char *mime_type);
00233
00234 private:
00235 static bool Inited;
00236
00237 protected:
00241 std::list<std::string> MimeTypes;
00242 };
00243
00244 }
00245
00246 #endif // GCU_LOADER_H