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., 59 Temple Place - Suite 330, Boston, MA 00020 * 02111-1307, USA. 00021 */ 00022 00023 #ifndef _OXML_OBJECTWITHATTRPROP_H_ 00024 #define _OXML_OBJECTWITHATTRPROP_H_ 00025 00026 // Internal includes 00027 #include "OXML_Types.h" 00028 00029 // AbiWord includes 00030 #include <pp_AttrProp.h> 00031 00032 #include <string> 00033 00034 class OXML_ObjectWithAttrProp { 00035 public: 00036 OXML_ObjectWithAttrProp(); 00037 virtual ~OXML_ObjectWithAttrProp(); 00038 00039 UT_Error setAttribute(const gchar * szName, const gchar * szValue); 00040 UT_Error setProperty(const gchar * szName, const gchar * szValue); 00041 UT_Error setProperty(const std::string & szName, const std::string & szValue); 00042 UT_Error getAttribute(const gchar * szName, const gchar *& szValue) const; 00043 UT_Error getProperty(const gchar * szName, const gchar *& szValue) const; 00044 UT_Error setAttributes(const gchar ** attributes); 00045 UT_Error setProperties(const gchar ** properties); 00046 UT_Error appendAttributes(const gchar ** attributes); 00047 UT_Error appendProperties(const gchar ** properties); 00048 const gchar ** getAttributes() const; 00049 const gchar ** getProperties() const; 00050 00051 UT_Error inheritProperties(OXML_ObjectWithAttrProp* parent); 00052 00054 00058 const gchar ** getAttributesWithProps() const; 00059 00060 bool getNthProperty(int i, const gchar* & szName, const gchar* & szValue); 00061 size_t getPropertyCount(); 00062 00063 private: 00064 PP_AttrProp* m_pAttributes; 00065 00066 std::string _generatePropsString() const; 00067 }; 00068 00069 #endif //_OXML_OBJECTWITHATTRPROP_H_ 00070
1.7.1