00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: t -*- */ 00002 00003 /* AbiSource 00004 * 00005 * Copyright (C) 2008 Firat Kiyak <firatkiyak@gmail.com> 00006 * Copyright (C) 2009 Hubert Figuiere 00007 * 00008 * This program is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License 00010 * as published by the Free Software Foundation; either version 2 00011 * of the License, or (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00021 * 02111-1307, USA. 00022 */ 00023 00024 #ifndef _OXML_IMAGE_H_ 00025 #define _OXML_IMAGE_H_ 00026 00027 #include <string> 00028 #include <boost/shared_ptr.hpp> 00029 00030 #include "ut_types.h" 00031 #include "pd_Document.h" 00032 00033 #include "OXML_Types.h" 00034 #include "OXML_ObjectWithAttrProp.h" 00035 00036 00037 class IE_Exp_OpenXML; 00038 class FG_Graphic; 00039 00040 class OXML_Image 00041 : public OXML_ObjectWithAttrProp 00042 { 00043 00044 public: 00045 OXML_Image(); 00046 virtual ~OXML_Image(); 00047 00048 void setId(const std::string & id); 00049 void setMimeType(const std::string & mimeType); 00050 // DOES NOT take ownership of the buffer 00051 void setData(const UT_ByteBuf* data); 00052 void setGraphic(const FG_Graphic * fg); 00053 00054 const std::string & getId() const 00055 { 00056 return m_id; 00057 } 00058 00059 UT_Error serialize(IE_Exp_OpenXML* exporter); 00060 UT_Error addToPT(PD_Document * pDocument); 00061 00062 private: 00063 std::string m_id; 00064 std::string m_mimeType; 00065 const UT_ByteBuf* m_data; 00066 const FG_Graphic * m_graphic; 00067 }; 00068 00069 typedef boost::shared_ptr<OXML_Image> OXML_SharedImage; 00070 00071 #endif //_OXML_IMAGE_H_ 00072
1.7.1