loader.h
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 <list>
00029 #include <map>
00030 #include <string>
00031 #include <goffice/app/io-context.h>
00032 #include <gsf/gsf-input.h>
00033 #include <gsf/gsf-output.h>
00034
00036 namespace gcu {
00037
00038 class Document;
00039 class Loader;
00040
00046 typedef struct {
00050 Loader *loader;
00054 bool read;
00058 bool write;
00062 bool supports2D;
00066 bool supports3D;
00070 bool supportsCrystals;
00074 bool supportsSpectra;
00075 } LoaderStruct;
00076
00142 class Loader
00143 {
00144 public:
00149 Loader ();
00154 virtual ~Loader ();
00155
00156
00161 static void Init ();
00170 static bool GetFirstLoader (std::map<std::string, LoaderStruct>::iterator &it);
00177 static bool GetNextLoader (std::map<std::string, LoaderStruct>::iterator &it);
00182 static Loader *GetLoader (char const *mime_type);
00187 static Loader *GetSaver (char const *mime_type);
00188
00189
00201 virtual bool Read (Document *doc, GsfInput *in, char const *mime_type, IOContext *io);
00213 virtual bool Write (Document *doc, GsfOutput *out, char const *mime_type, IOContext *io);
00214
00215 protected:
00221 void AddMimeType (const char *mime_type);
00227 void RemoveMimeType (const char *mime_type);
00228
00229 private:
00230 static bool Inited;
00231
00232 protected:
00236 std::list<std::string> MimeTypes;
00237 };
00238
00239 }
00240
00241 #endif // GCU_LOADER_H