merge the formfield patch from ooo-build
[ooovba.git] / configmgr / source / backend / layerupdatemerger.hxx
blob751c5b7274d66ae9cfbbc89271ef71e73407d51f
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: layerupdatemerger.hxx,v $
10 * $Revision: 1.8 $
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 CONFIGMGR_BACKEND_LAYERUPDATEMERGER_HXX
32 #define CONFIGMGR_BACKEND_LAYERUPDATEMERGER_HXX
34 #include "basicupdatemerger.hxx"
35 #include "layerupdate.hxx"
36 #include <rtl/ref.hxx>
37 // -----------------------------------------------------------------------------
39 namespace configmgr
41 // -----------------------------------------------------------------------------
42 namespace backend
44 // -----------------------------------------------------------------------------
45 class NodeUpdate;
46 class PropertyUpdate;
48 class LayerUpdateMerger : protected BasicUpdateMerger
50 public:
51 static uno::Reference< backenduno::XLayer > getMergedLayer(uno::Reference< backenduno::XLayer > const & _xSourceLayer, LayerUpdate const & _aLayerUpdate)
52 { return new LayerUpdateMerger(_xSourceLayer, _aLayerUpdate); }
54 public:
55 explicit
56 LayerUpdateMerger( uno::Reference< backenduno::XLayer > const & _xSourceLayer, LayerUpdate const & _aLayerUpdate);
58 ~LayerUpdateMerger();
61 // XLayerHandler overrides
62 protected:
63 virtual void SAL_CALL
64 startLayer( )
65 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
67 virtual void SAL_CALL
68 endLayer( )
69 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
71 virtual void SAL_CALL
72 overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
73 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
75 virtual void SAL_CALL
76 addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
77 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
79 virtual void SAL_CALL
80 addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
81 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
83 virtual void SAL_CALL
84 endNode( )
85 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
87 virtual void SAL_CALL
88 dropNode( const rtl::OUString& aName )
89 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
91 virtual void SAL_CALL
92 overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
93 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
95 virtual void SAL_CALL
96 endProperty( )
97 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
99 virtual void SAL_CALL
100 setPropertyValue( const uno::Any& aValue )
101 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
103 virtual void SAL_CALL
104 setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
105 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
107 virtual void SAL_CALL
108 addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
109 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
111 virtual void SAL_CALL
112 addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
113 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
115 // BasicUpdateMerger
116 virtual void flushUpdate();
117 private:
118 void malformedUpdate(sal_Char const * pMsg);
119 private:
120 LayerUpdate m_aLayerUpdate;
121 rtl::Reference<NodeUpdate> m_xCurrentNode;
122 rtl::Reference<PropertyUpdate> m_xCurrentProp;
124 // -----------------------------------------------------------------------------
125 } // namespace xml
126 // -----------------------------------------------------------------------------
128 } // namespace configmgr
129 #endif