1 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 2 3 /* AbiSource 4 * 5 * Copyright (C) 2007 Philippe Milot <PhilMilot@gmail.com> 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 20 * 02110-1301 USA. 21 */ 22 23 #ifndef _OXML_STYLE_H_ 24 #define _OXML_STYLE_H_ 25 26 // Internal includes 27 #include <OXML_Types.h> 28 #include <OXML_ObjectWithAttrProp.h> 29 30 // AbiWord includes 31 #include <ut_types.h> 32 #include <pd_Document.h> 33 34 // External includes 35 #include <string> 36 #include <boost/shared_ptr.hpp> 37 38 class IE_Exp_OpenXML; 39 40 /* \class OXML_Style 41 * \brief This class represents a single style in the OpenXML data model. 42 */ 43 class OXML_Style : public OXML_ObjectWithAttrProp 44 { 45 public: 46 /*! 47 \param id The unique identifier for a valid OpenXML style. 48 \param name The unique identifier for a style in the AbiWord piecetable. 49 */ 50 OXML_Style(const std::string & id, const std::string & name); 51 virtual ~OXML_Style(); 52 setId(const std::string & id)53 void setId(const std::string & id) 54 { m_id = id; } getId()55 const std::string & getId() const 56 { return m_id; } setName(const std::string & name)57 void setName(const std::string & name) 58 { m_name = name; setAttribute(PT_NAME_ATTRIBUTE_NAME, name.c_str()); }; getName()59 const std::string & getName() const 60 { return m_name; } setBasedOn(const std::string & basedOn)61 void setBasedOn(const std::string & basedOn) 62 { m_basedon = basedOn; } setFollowedBy(const std::string & followedBy)63 void setFollowedBy(const std::string & followedBy) 64 { m_followedby = followedBy; } 65 66 UT_Error serialize(IE_Exp_OpenXML* exporter); 67 UT_Error addToPT(PD_Document * pDocument); 68 69 private: 70 std::string m_id; 71 std::string m_name; 72 std::string m_basedon; 73 std::string m_followedby; 74 }; 75 76 typedef boost::shared_ptr<OXML_Style> OXML_SharedStyle; 77 78 #endif //_OXML_STYLE_H_ 79 80