loader.h
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
00035 namespace gcu {
00036
00037 class Document;
00038 class Loader;
00039
00040 typedef struct {
00041 Loader *loader;
00042 bool read;
00043 bool write;
00044 bool supports2D;
00045 bool supports3D;
00046 bool supportsCrystals;
00047 } LoaderStruct;
00048
00049 class Loader
00050 {
00051 public:
00052 Loader ();
00053 virtual ~Loader ();
00054
00055
00056 static void Init ();
00057 static bool GetFirstLoader (std::map<std::string, LoaderStruct>::iterator &it);
00058 static bool GetNextLoader (std::map<std::string, LoaderStruct>::iterator &it);
00059 static Loader *GetLoader (char const *mime_type);
00060 static Loader *GetSaver (char const *mime_type);
00061
00062
00063 virtual bool Read (Document *doc, GsfInput *in, char const *mime_type, IOContext *io);
00064 virtual bool Write (Document *doc, GsfOutput *out, char const *mime_type, IOContext *io);
00065
00066 protected:
00067 void AddMimeType (const char *mime_type);
00068 void RemoveMimeType (const char *mime_type);
00069
00070 private:
00071 static bool Inited;
00072
00073 protected:
00074 std::list<std::string> MimeTypes;
00075 };
00076
00077 }
00078
00079 #endif // GCU_LOADER_H