<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>The Gnome Chemistry Utils: loader.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_3f1a4fbcec42af7c381c8030b930461d.html">libs</a> » <a class="el" href="dir_4dc46c636cfd3997b28f6cceab9d70bd.html">gcu</a> </div> </div> <div class="contents"> <h1>loader.h</h1><a href="loader_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- C++ -*-</span> <a name="l00002"></a>00002 <a name="l00003"></a>00003 <span class="comment">/* </span> <a name="l00004"></a>00004 <span class="comment"> * Gnome Chemistry Utils</span> <a name="l00005"></a>00005 <span class="comment"> * gcu/loader.h</span> <a name="l00006"></a>00006 <span class="comment"> *</span> <a name="l00007"></a>00007 <span class="comment"> * Copyright (C) 2007-2009 Jean Bréfort <jean.brefort@normalesup.org></span> <a name="l00008"></a>00008 <span class="comment"> *</span> <a name="l00009"></a>00009 <span class="comment"> * This program is free software; you can redistribute it and/or </span> <a name="l00010"></a>00010 <span class="comment"> * modify it under the terms of the GNU General Public License as </span> <a name="l00011"></a>00011 <span class="comment"> * published by the Free Software Foundation; either version 2 of the</span> <a name="l00012"></a>00012 <span class="comment"> * License, or (at your option) any later version.</span> <a name="l00013"></a>00013 <span class="comment"> *</span> <a name="l00014"></a>00014 <span class="comment"> * This program is distributed in the hope that it will be useful,</span> <a name="l00015"></a>00015 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00016"></a>00016 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> <a name="l00017"></a>00017 <span class="comment"> * GNU General Public License for more details.</span> <a name="l00018"></a>00018 <span class="comment"> *</span> <a name="l00019"></a>00019 <span class="comment"> * You should have received a copy of the GNU General Public License</span> <a name="l00020"></a>00020 <span class="comment"> * along with this program; if not, write to the Free Software</span> <a name="l00021"></a>00021 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301</span> <a name="l00022"></a>00022 <span class="comment"> * USA</span> <a name="l00023"></a>00023 <span class="comment"> */</span> <a name="l00024"></a>00024 <a name="l00025"></a>00025 <span class="preprocessor">#ifndef GCU_LOADER_H</span> <a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define GCU_LOADER_H</span> <a name="l00027"></a>00027 <span class="preprocessor"></span> <a name="l00028"></a>00028 <span class="preprocessor">#include <list></span> <a name="l00029"></a>00029 <span class="preprocessor">#include <map></span> <a name="l00030"></a>00030 <span class="preprocessor">#include <string></span> <a name="l00031"></a>00031 <span class="preprocessor">#ifdef GOFFICE_HAS_GLOBAL_HEADER</span> <a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor"># include <goffice/goffice.h></span> <a name="l00033"></a>00033 <span class="preprocessor">#else</span> <a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor"># include <goffice/app/io-context.h></span> <a name="l00035"></a>00035 <span class="preprocessor">#endif</span> <a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#include <gcu/goffice-compat.h></span> <a name="l00037"></a>00037 <span class="preprocessor">#include <gsf/gsf-input.h></span> <a name="l00038"></a>00038 <span class="preprocessor">#include <gsf/gsf-output.h></span> <a name="l00039"></a>00039 <a name="l00041"></a>00041 <span class="keyword">namespace </span>gcu { <a name="l00042"></a>00042 <a name="l00043"></a>00043 <span class="keyword">class </span>Document; <a name="l00044"></a>00044 <span class="keyword">class </span>Loader; <a name="l00045"></a>00045 <a name="l00051"></a><a class="code" href="structgcu_1_1LoaderStruct.html">00051</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ <a name="l00055"></a><a class="code" href="structgcu_1_1LoaderStruct.html#a71f24ab12c243f1041710c51e0e911e6">00055</a> <a class="code" href="classgcu_1_1Loader.html" title="class used to implement serialization engines.">Loader</a> *loader; <a name="l00059"></a><a class="code" href="structgcu_1_1LoaderStruct.html#ae7df66e17d55854e276fef8027d520cb">00059</a> <span class="keywordtype">bool</span> read; <a name="l00063"></a><a class="code" href="structgcu_1_1LoaderStruct.html#a0b74e5a4e2f4f812dd5a6a476d461a38">00063</a> <span class="keywordtype">bool</span> write; <a name="l00067"></a><a class="code" href="structgcu_1_1LoaderStruct.html#a998fdce18ac7a6912d150c4865708ac2">00067</a> <span class="keywordtype">bool</span> supports2D; <a name="l00071"></a><a class="code" href="structgcu_1_1LoaderStruct.html#a43335f620d5716ce7a13b87ef703ae8a">00071</a> <span class="keywordtype">bool</span> supports3D; <a name="l00075"></a><a class="code" href="structgcu_1_1LoaderStruct.html#a6d549b406b8cd798ca82708496d8b858">00075</a> <span class="keywordtype">bool</span> supportsCrystals; <a name="l00079"></a><a class="code" href="structgcu_1_1LoaderStruct.html#aa7b55415556c9f0d8fa019f213058733">00079</a> <span class="keywordtype">bool</span> supportsSpectra; <a name="l00080"></a>00080 } <a class="code" href="structgcu_1_1LoaderStruct.html">LoaderStruct</a>; <a name="l00081"></a>00081 <a name="l00147"></a><a class="code" href="classgcu_1_1Loader.html">00147</a> <span class="keyword">class </span><a class="code" href="classgcu_1_1Loader.html" title="class used to implement serialization engines.">Loader</a> <a name="l00148"></a>00148 { <a name="l00149"></a>00149 <span class="keyword">public</span>: <a name="l00154"></a>00154 <a class="code" href="classgcu_1_1Loader.html#a69799b1df7ba819a59923023886a1ce6">Loader</a> (); <a name="l00159"></a>00159 <span class="keyword">virtual</span> <a class="code" href="classgcu_1_1Loader.html#a7fd44366c449021558b3dffa7157aef3">~Loader</a> (); <a name="l00160"></a>00160 <a name="l00161"></a>00161 <span class="comment">// static methods</span> <a name="l00166"></a>00166 <span class="comment"></span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classgcu_1_1Loader.html#aeccea675f75e66a6aa930ec92bfb624c">Init</a> (); <a name="l00175"></a>00175 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classgcu_1_1Loader.html#aeef5ea41aacf0f7b95ac3c965737535b">GetFirstLoader</a> (std::map<std::string, LoaderStruct>::iterator &it); <a name="l00182"></a>00182 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classgcu_1_1Loader.html#ad2ad56c39863ec7b82959b79b9479303">GetNextLoader</a> (std::map<std::string, LoaderStruct>::iterator &it); <a name="l00187"></a>00187 <span class="keyword">static</span> <a class="code" href="classgcu_1_1Loader.html" title="class used to implement serialization engines.">Loader</a> *<a class="code" href="classgcu_1_1Loader.html#aa77a287a17dee7ec63008b8cbaaf195d">GetLoader</a> (<span class="keywordtype">char</span> <span class="keyword">const</span> *mime_type); <a name="l00192"></a>00192 <span class="keyword">static</span> <a class="code" href="classgcu_1_1Loader.html" title="class used to implement serialization engines.">Loader</a> *<a class="code" href="classgcu_1_1Loader.html#a53c5dba360861091155b645c9db83b32">GetSaver</a> (<span class="keywordtype">char</span> <span class="keyword">const</span> *mime_type); <a name="l00193"></a>00193 <a name="l00194"></a>00194 <span class="comment">// virtual methods</span> <a name="l00206"></a>00206 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classgcu_1_1Loader.html#ac7bf5f4ede3bfd9be1390e7cf949d140">Read</a> (<a class="code" href="classgcu_1_1Document.html">Document</a> *doc, GsfInput *in, <span class="keywordtype">char</span> <span class="keyword">const</span> *mime_type, IOContext *io); <a name="l00218"></a>00218 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classgcu_1_1Loader.html#acee683aa2f1b76dea9e793dc1f609413">Write</a> (<a class="code" href="classgcu_1_1Document.html">Document</a> *doc, GsfOutput *out, <span class="keywordtype">char</span> <span class="keyword">const</span> *mime_type, IOContext *io); <a name="l00219"></a>00219 <a name="l00220"></a>00220 <span class="keyword">protected</span>: <a name="l00226"></a>00226 <span class="keywordtype">void</span> <a class="code" href="classgcu_1_1Loader.html#ac972a854361fe7430a7cd7b2cf2bab57">AddMimeType</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *mime_type); <a name="l00232"></a>00232 <span class="keywordtype">void</span> <a class="code" href="classgcu_1_1Loader.html#a5d75ed95d04deae7a80e21e958c5f27d">RemoveMimeType</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *mime_type); <a name="l00233"></a>00233 <a name="l00234"></a>00234 <span class="keyword">private</span>: <a name="l00235"></a>00235 <span class="keyword">static</span> <span class="keywordtype">bool</span> Inited; <a name="l00236"></a>00236 <a name="l00237"></a>00237 <span class="keyword">protected</span>: <a name="l00241"></a><a class="code" href="classgcu_1_1Loader.html#af8b3620a51ddd6ee9359b57e4d26cb65">00241</a> std::list<std::string> <a class="code" href="classgcu_1_1Loader.html#af8b3620a51ddd6ee9359b57e4d26cb65">MimeTypes</a>; <a name="l00242"></a>00242 }; <a name="l00243"></a>00243 <a name="l00244"></a>00244 } <a name="l00245"></a>00245 <a name="l00246"></a>00246 <span class="preprocessor">#endif // GCU_LOADER_H</span> </pre></div></div> <hr size="1"/><address style="text-align: right;"><small>Generated on Sun Sep 6 18:33:53 2009 for The Gnome Chemistry Utils by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> </body> </html>