00001 /* AbiSource 00002 * 00003 * Copyright (C) 2005 Daniel d'Andrada T. de Carvalho 00004 * <daniel.carvalho@indt.org.br> 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00019 * 02110-1301 USA. 00020 */ 00021 00022 #ifndef _ODI_ABI_DATA_H_ 00023 #define _ODI_ABI_DATA_H_ 00024 00025 #include "ut_compiler.h" 00026 00027 #include <map> 00028 #include <set> 00029 #include <string> 00030 00031 // External includes 00032 ABI_W_NO_CONST_QUAL 00033 #include <gsf/gsf.h> 00034 ABI_W_POP 00035 00036 #include "ut_types.h" 00037 #include "ut_bytebuf.h" 00038 // AbiWord classes 00039 class PD_Document; 00040 class UT_String; 00041 00046 class ODi_Abi_Data { 00047 00048 public: 00049 00050 ODi_Abi_Data(PD_Document* pDocument, GsfInfile* pGsfInfile); 00051 00058 bool addImageDataItem(UT_String& rDataId, const gchar** ppAtts); 00059 00060 bool addObjectDataItem(UT_String& rDataId, const gchar** ppAtts, int& pto_Type); 00061 00062 private: 00063 00064 UT_Error _loadStream(GsfInfile* oo, const char* stream, const UT_ByteBufPtr& buf); 00065 void _splitDirectoryAndFileName(const gchar* pHRef, UT_String& dirName, UT_String& fileName) const; 00066 00067 PD_Document* m_pAbiDocument; 00068 GsfInfile* m_pGsfInfile; 00069 00070 // Stores all added data items id's, given its hrefs. 00071 // Used to avoid adding multiple data items for the same picture. 00072 typedef std::map<std::string, std::string> href_id_map_t; 00073 href_id_map_t m_href_to_id; 00074 00075 public: 00076 std::set< std::string > m_openAnnotationNames; 00077 std::set< std::string > m_rangedAnnotationNames; 00078 }; 00079 00080 #endif //_ODI_ABI_DATA_H_