merge the formfield patch from ooo-build
[ooovba.git] / configmgr / source / backend / emptylayerimpl.hxx
blob3c57face40cb6b2ab4ae650aabce731161e159ee
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: emptylayerimpl.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_BACKEND_EMPTYLAYERIMPL_HXX
32 #define CONFIGMGR_BACKEND_EMPTYLAYERIMPL_HXX
34 #include <cppuhelper/implbase1.hxx>
35 #include <com/sun/star/configuration/backend/XLayerHandler.hpp>
36 #include <com/sun/star/configuration/backend/XLayer.hpp>
38 // -----------------------------------------------------------------------------
39 namespace configmgr
41 // -----------------------------------------------------------------------------
42 namespace backend
44 // -----------------------------------------------------------------------------
45 namespace uno = ::com::sun::star::uno;
46 namespace lang = ::com::sun::star::lang;
47 namespace backenduno = ::com::sun::star::configuration::backend;
48 // -----------------------------------------------------------------------------
50 class EmptyLayer : public cppu::WeakImplHelper1<backenduno::XLayer>
52 public:
53 virtual ~EmptyLayer();
55 // XLayer
56 public:
57 virtual void SAL_CALL
58 readData( const uno::Reference< backenduno::XLayerHandler >& aHandler )
59 throw (backenduno::MalformedDataException, lang::NullPointerException, lang::WrappedTargetException, uno::RuntimeException);
61 // -----------------------------------------------------------------------------
63 class RequireEmptyLayer : public cppu::WeakImplHelper1<backenduno::XLayerHandler>
65 public:
66 RequireEmptyLayer();
67 virtual ~RequireEmptyLayer();
69 bool wasEmpty() const { return m_bEmpty; }
70 bool wasInvalid() const { return m_bInvalid; }
71 // XLayerHandler
72 public:
73 virtual void SAL_CALL
74 startLayer( )
75 throw (backenduno::MalformedDataException, uno::RuntimeException);
77 virtual void SAL_CALL
78 endLayer( )
79 throw (backenduno::MalformedDataException, uno::RuntimeException);
81 virtual void SAL_CALL
82 overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
83 throw (backenduno::MalformedDataException, uno::RuntimeException);
85 virtual void SAL_CALL
86 addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
87 throw (backenduno::MalformedDataException, uno::RuntimeException);
89 virtual void SAL_CALL
90 addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
91 throw (backenduno::MalformedDataException, uno::RuntimeException);
93 virtual void SAL_CALL
94 endNode( )
95 throw (backenduno::MalformedDataException, uno::RuntimeException);
97 virtual void SAL_CALL
98 dropNode( const rtl::OUString& aName )
99 throw (backenduno::MalformedDataException, uno::RuntimeException);
101 virtual void SAL_CALL
102 overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
103 throw (backenduno::MalformedDataException, uno::RuntimeException);
105 virtual void SAL_CALL
106 addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
107 throw (backenduno::MalformedDataException, uno::RuntimeException);
109 virtual void SAL_CALL
110 addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
111 throw (backenduno::MalformedDataException, uno::RuntimeException);
113 virtual void SAL_CALL
114 endProperty( )
115 throw (backenduno::MalformedDataException, uno::RuntimeException);
117 virtual void SAL_CALL
118 setPropertyValue( const uno::Any& aValue )
119 throw (backenduno::MalformedDataException, uno::RuntimeException);
121 virtual void SAL_CALL
122 setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
123 throw (backenduno::MalformedDataException, uno::RuntimeException);
125 private:
126 void failNotEmpty() { fail("layer is not empty"); }
127 void fail(sal_Char const * pMsg);
129 private:
130 bool m_bStarted;
131 bool m_bInvalid;
132 bool m_bEmpty;
134 // -----------------------------------------------------------------------------
135 } // namespace xml
136 // -----------------------------------------------------------------------------
138 } // namespace configmgr
139 #endif