merge the formfield patch from ooo-build
[ooovba.git] / configmgr / source / backend / layerupdatehandler.hxx
blob93bd4a30e591f0b9016e314793c228d21fa97eb8
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: layerupdatehandler.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_LAYERUPDATEHANDLER_HXX
32 #define CONFIGMGR_BACKEND_LAYERUPDATEHANDLER_HXX
34 #include "sal/config.h"
36 #include "boost/utility.hpp"
38 #include "updatesvc.hxx"
39 #include "layerupdatebuilder.hxx"
40 #include "utility.hxx"
42 // -----------------------------------------------------------------------------
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 // -----------------------------------------------------------------------------
54 class LayerUpdateBuilder;
56 class LayerUpdateHandler: private boost::noncopyable, public UpdateService
58 public:
59 explicit
60 LayerUpdateHandler(uno::Reference< uno::XComponentContext > const & _xContext);
62 ~LayerUpdateHandler();
64 // XUpdateHandler
65 virtual void SAL_CALL
66 startUpdate( )
67 throw ( backenduno::MalformedDataException, lang::IllegalAccessException,
68 lang::WrappedTargetException, uno::RuntimeException);
70 virtual void SAL_CALL
71 endUpdate( )
72 throw ( backenduno::MalformedDataException, lang::IllegalAccessException,
73 lang::WrappedTargetException, uno::RuntimeException);
75 virtual void SAL_CALL
76 modifyNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, sal_Bool bReset )
77 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
79 virtual void SAL_CALL
80 addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
81 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
83 virtual void SAL_CALL
84 addOrReplaceNodeFromTemplate( const rtl::OUString& aName, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aTemplate )
85 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
87 virtual void SAL_CALL
88 endNode( )
89 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
91 virtual void SAL_CALL
92 removeNode( const rtl::OUString& aName )
93 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
95 virtual void SAL_CALL
96 modifyProperty( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, const uno::Type& aType )
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 resetPropertyValue( )
109 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
111 virtual void SAL_CALL
112 resetPropertyValueForLocale( const rtl::OUString& aLocale )
113 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
115 virtual void SAL_CALL
116 endProperty( )
117 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
119 virtual void SAL_CALL
120 resetProperty( const rtl::OUString& aName )
121 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
123 virtual void SAL_CALL
124 addOrReplaceProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
125 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
127 virtual void SAL_CALL
128 addOrReplacePropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
129 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
131 virtual void SAL_CALL
132 removeProperty( const rtl::OUString& aName )
133 throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
135 private:
136 LayerUpdateBuilder & getUpdateBuilder();
138 void checkBuilder(bool _bForProperty = false);
140 void raiseMalformedDataException(sal_Char const * pMsg);
141 void raiseNodeChangedBeforeException(sal_Char const * pMsg);
142 void raisePropChangedBeforeException(sal_Char const * pMsg);
143 void raisePropExistsException(sal_Char const * pMsg);
145 private:
146 LayerUpdateBuilder m_aBuilder;
148 // -----------------------------------------------------------------------------
149 } // namespace xml
150 // -----------------------------------------------------------------------------
152 } // namespace configmgr
153 #endif