00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiSource 00004 * 00005 * Copyright (C) 2007 Philippe Milot <PhilMilot@gmail.com> 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation; either version 2 00010 * of the License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00020 * 02110-1301 USA. 00021 */ 00022 00023 #ifndef _OXML_STYLE_H_ 00024 #define _OXML_STYLE_H_ 00025 00026 // Internal includes 00027 #include <OXML_Types.h> 00028 #include <OXML_ObjectWithAttrProp.h> 00029 00030 // AbiWord includes 00031 #include <ut_types.h> 00032 #include <pd_Document.h> 00033 00034 // External includes 00035 #include <memory> 00036 #include <string> 00037 00038 class IE_Exp_OpenXML; 00039 00040 /* \class OXML_Style 00041 * \brief This class represents a single style in the OpenXML data model. 00042 */ 00043 class OXML_Style : public OXML_ObjectWithAttrProp 00044 { 00045 public: 00050 OXML_Style(const std::string & id, const std::string & name); 00051 virtual ~OXML_Style(); 00052 00053 void setId(const std::string & id) 00054 { m_id = id; } 00055 const std::string & getId() const 00056 { return m_id; } 00057 void setName(const std::string & name) 00058 { m_name = name; setAttribute(PT_NAME_ATTRIBUTE_NAME, name.c_str()); }; 00059 const std::string & getName() const 00060 { return m_name; } 00061 void setBasedOn(const std::string & basedOn) 00062 { m_basedon = basedOn; } 00063 void setFollowedBy(const std::string & followedBy) 00064 { m_followedby = followedBy; } 00065 00066 UT_Error serialize(IE_Exp_OpenXML* exporter); 00067 UT_Error addToPT(PD_Document * pDocument); 00068 00069 private: 00070 std::string m_id; 00071 std::string m_name; 00072 std::string m_basedon; 00073 std::string m_followedby; 00074 }; 00075 00076 typedef std::shared_ptr<OXML_Style> OXML_SharedStyle; 00077 00078 #endif //_OXML_STYLE_H_ 00079