merge the formfield patch from ooo-build
[ooovba.git] / configmgr / source / backend / layerdefaultremover.hxx
blob784b7f7a5337e82a2e33773f2593d70c350295a9
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: layerdefaultremover.hxx,v $
10 * $Revision: 1.6 $
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_XML_LAYERDECORATOR_HXX
32 #define CONFIGMGR_XML_LAYERDECORATOR_HXX
34 #include <cppuhelper/implbase1.hxx>
36 #ifndef INCLUDED_VECTOR
37 #include <vector>
38 #define INCLUDED_VECTOR
39 #endif
41 #include <com/sun/star/configuration/backend/XLayerHandler.hpp>
43 // -----------------------------------------------------------------------------
44 namespace configmgr
46 // -----------------------------------------------------------------------------
47 namespace backend
49 // -----------------------------------------------------------------------------
50 namespace uno = ::com::sun::star::uno;
51 namespace lang = ::com::sun::star::lang;
52 namespace backenduno = ::com::sun::star::configuration::backend;
53 // -----------------------------------------------------------------------------
55 class LayerDefaultRemover : public cppu::WeakImplHelper1<backenduno::XLayerHandler>
57 public:
58 explicit
59 LayerDefaultRemover(uno::Reference< backenduno::XLayerHandler > const & _xResultHandler);
60 virtual ~LayerDefaultRemover();
62 // XLayerHandler
63 public:
64 virtual void SAL_CALL
65 startLayer( )
66 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
68 virtual void SAL_CALL
69 endLayer( )
70 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
72 virtual void SAL_CALL
73 overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
74 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
76 virtual void SAL_CALL
77 addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
78 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
80 virtual void SAL_CALL
81 addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
82 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
84 virtual void SAL_CALL
85 endNode( )
86 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
88 virtual void SAL_CALL
89 dropNode( const rtl::OUString& aName )
90 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
92 virtual void SAL_CALL
93 overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
94 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
96 virtual void SAL_CALL
97 addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
98 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
100 virtual void SAL_CALL
101 addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
102 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
104 virtual void SAL_CALL
105 endProperty( )
106 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
108 virtual void SAL_CALL
109 setPropertyValue( const uno::Any& aValue )
110 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
112 virtual void SAL_CALL
113 setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
114 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
116 private:
117 void playBackNodeStack( bool bPlayProperty=false);
118 void raiseMalformedDataException(sal_Char const * pMsg);
119 inline bool hasPendingProperty();
120 inline void clearPendingProperty();
121 private:
122 uno::Reference< backenduno::XLayerHandler > m_xResultHandler;
123 std::vector<rtl::OUString> m_aNodeStack;
124 struct PropertyStruct
126 rtl::OUString Name;
127 uno::Type Type;
128 }m_aPropName;
130 // -----------------------------------------------------------------------------
131 } // namespace xml
132 // -----------------------------------------------------------------------------
134 } // namespace configmgr
135 #endif