1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _XMLOFF_ATTRLIST_HXX 25 #define _XMLOFF_ATTRLIST_HXX 26 27 #include "sal/config.h" 28 #include "xmloff/dllapi.h" 29 #include <com/sun/star/util/XCloneable.hpp> 30 #include <com/sun/star/xml/sax/SAXParseException.hpp> 31 #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> 32 #include <com/sun/star/xml/sax/SAXException.hpp> 33 #include <com/sun/star/xml/sax/XDocumentHandler.hpp> 34 #include <com/sun/star/xml/sax/XAttributeList.hpp> 35 #include <com/sun/star/xml/sax/XLocator.hpp> 36 #include <com/sun/star/lang/XUnoTunnel.hpp> 37 38 #include <cppuhelper/implbase3.hxx> 39 40 struct SvXMLAttributeList_Impl; 41 42 class XMLOFF_DLLPUBLIC SvXMLAttributeList : public ::cppu::WeakImplHelper3< 43 ::com::sun::star::xml::sax::XAttributeList, 44 ::com::sun::star::util::XCloneable, 45 ::com::sun::star::lang::XUnoTunnel> 46 { 47 SvXMLAttributeList_Impl *m_pImpl; 48 49 public: 50 SvXMLAttributeList(); 51 SvXMLAttributeList( const SvXMLAttributeList& ); 52 SvXMLAttributeList( const ::com::sun::star::uno::Reference< 53 ::com::sun::star::xml::sax::XAttributeList> & rAttrList ); 54 ~SvXMLAttributeList(); 55 56 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); 57 static SvXMLAttributeList* getImplementation( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ) throw(); 58 59 // XUnoTunnel 60 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); 61 62 // ::com::sun::star::xml::sax::XAttributeList 63 virtual sal_Int16 SAL_CALL getLength(void) throw( ::com::sun::star::uno::RuntimeException ); 64 virtual ::rtl::OUString SAL_CALL getNameByIndex(sal_Int16 i) throw( ::com::sun::star::uno::RuntimeException ); 65 virtual ::rtl::OUString SAL_CALL getTypeByIndex(sal_Int16 i) throw( ::com::sun::star::uno::RuntimeException ); 66 virtual ::rtl::OUString SAL_CALL getTypeByName(const ::rtl::OUString& aName) throw( ::com::sun::star::uno::RuntimeException ); 67 virtual ::rtl::OUString SAL_CALL getValueByIndex(sal_Int16 i) throw( ::com::sun::star::uno::RuntimeException ); 68 virtual ::rtl::OUString SAL_CALL getValueByName(const ::rtl::OUString& aName) throw( ::com::sun::star::uno::RuntimeException ); 69 70 // ::com::sun::star::util::XCloneable 71 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() throw( ::com::sun::star::uno::RuntimeException ); 72 73 // methods that are not contained in any interface 74 void AddAttribute( const ::rtl::OUString &sName , const ::rtl::OUString &sValue ); 75 void Clear(); 76 void RemoveAttribute( const ::rtl::OUString sName ); 77 void SetAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & ); 78 void AppendAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & ); 79 void SetValueByIndex( sal_Int16 i, const ::rtl::OUString& rValue ); 80 void RemoveAttributeByIndex( sal_Int16 i ); 81 void RenameAttributeByIndex( sal_Int16 i, const ::rtl::OUString& rNewName ); 82 sal_Int16 GetIndexByName( const ::rtl::OUString& rName ) const; 83 84 private: 85 const ::rtl::OUString sType; // "CDATA" 86 }; 87 88 89 #endif // _XMLOFF_ATTRLIST_HXX 90