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., 51 Franklin Street, Fifth Floor, Boston, MA 00021 * 02110-1301 USA. 00022 */ 00023 00024 #ifndef _OXML_IMAGE_H_ 00025 #define _OXML_IMAGE_H_ 00026 00027 #include <memory> 00028 #include <string> 00029 00030 #include "ut_types.h" 00031 #include "fg_Graphic.h" 00032 #include "pd_Document.h" 00033 00034 #include "OXML_Types.h" 00035 #include "OXML_ObjectWithAttrProp.h" 00036 00037 00038 class IE_Exp_OpenXML; 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 void setData(const UT_ConstByteBufPtr & data); 00051 void setGraphic(FG_ConstGraphicPtr && fg); 00052 00053 const std::string & getId() const 00054 { 00055 return m_id; 00056 } 00057 00058 UT_Error serialize(IE_Exp_OpenXML* exporter); 00059 UT_Error addToPT(PD_Document * pDocument); 00060 00061 private: 00062 std::string m_id; 00063 std::string m_mimeType; 00064 UT_ConstByteBufPtr m_data; 00065 FG_ConstGraphicPtr m_graphic; 00066 }; 00067 00068 typedef std::shared_ptr<OXML_Image> OXML_SharedImage; 00069 00070 #endif //_OXML_IMAGE_H_ 00071