merge the formfield patch from ooo-build
[ooovba.git] / xmloff / source / forms / attriblistmerge.hxx
blob43c905dc8cb755a1779faeaaa77593382eba44c1
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: attriblistmerge.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _XMLOFF_FORMS_ATTRIBLISTMERGE_HXX_
32 #define _XMLOFF_FORMS_ATTRIBLISTMERGE_HXX_
34 #include <comphelper/stl_types.hxx>
35 #include <cppuhelper/implbase1.hxx>
36 #include <osl/mutex.hxx>
37 #include <com/sun/star/xml/sax/XAttributeList.hpp>
39 //.........................................................................
40 namespace xmloff
42 //.........................................................................
44 //=====================================================================
45 //= OAttribListMerger
46 //=====================================================================
47 typedef ::cppu::WeakImplHelper1 < ::com::sun::star::xml::sax::XAttributeList
48 > OAttribListMerger_Base;
49 /** implements the XAttributeList list by merging different source attribute lists
51 <p>Currently, the time behavious is O(n), though it would be possible to change it to O(log n).</p>
53 class OAttribListMerger : public OAttribListMerger_Base
55 protected:
56 ::osl::Mutex m_aMutex;
57 DECLARE_STL_VECTOR( ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >, AttributeListArray );
58 AttributeListArray m_aLists;
60 ~OAttribListMerger() { }
62 public:
63 OAttribListMerger() { }
65 // attribute list handling
66 // (very thinn at the moment ... only adding lists is allowed ... add more if you need it :)
67 void addList(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rList);
69 // XAttributeList
70 virtual sal_Int16 SAL_CALL getLength( ) throw(::com::sun::star::uno::RuntimeException);
71 virtual ::rtl::OUString SAL_CALL getNameByIndex( sal_Int16 i ) throw(::com::sun::star::uno::RuntimeException);
72 virtual ::rtl::OUString SAL_CALL getTypeByIndex( sal_Int16 i ) throw(::com::sun::star::uno::RuntimeException);
73 virtual ::rtl::OUString SAL_CALL getTypeByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
74 virtual ::rtl::OUString SAL_CALL getValueByIndex( sal_Int16 i ) throw(::com::sun::star::uno::RuntimeException);
75 virtual ::rtl::OUString SAL_CALL getValueByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
77 protected:
78 sal_Bool seekToIndex(sal_Int16 _nGlobalIndex, ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rSubList, sal_Int16& _rLocalIndex);
79 sal_Bool seekToName(const ::rtl::OUString& _rName, ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rSubList, sal_Int16& _rLocalIndex);
83 //.........................................................................
84 } // namespace xmloff
85 //.........................................................................
87 #endif // _XMLOFF_FORMS_ATTRIBLISTMERGE_HXX_