1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: emptylayerimpl.hxx,v $
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 // -----------------------------------------------------------------------------
41 // -----------------------------------------------------------------------------
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
>
53 virtual ~EmptyLayer();
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
>
67 virtual ~RequireEmptyLayer();
69 bool wasEmpty() const { return m_bEmpty
; }
70 bool wasInvalid() const { return m_bInvalid
; }
75 throw (backenduno::MalformedDataException
, uno::RuntimeException
);
79 throw (backenduno::MalformedDataException
, uno::RuntimeException
);
82 overrideNode( const rtl::OUString
& aName
, sal_Int16 aAttributes
, sal_Bool bClear
)
83 throw (backenduno::MalformedDataException
, uno::RuntimeException
);
86 addOrReplaceNode( const rtl::OUString
& aName
, sal_Int16 aAttributes
)
87 throw (backenduno::MalformedDataException
, uno::RuntimeException
);
90 addOrReplaceNodeFromTemplate( const rtl::OUString
& aName
, const backenduno::TemplateIdentifier
& aTemplate
, sal_Int16 aAttributes
)
91 throw (backenduno::MalformedDataException
, uno::RuntimeException
);
95 throw (backenduno::MalformedDataException
, uno::RuntimeException
);
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
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
);
126 void failNotEmpty() { fail("layer is not empty"); }
127 void fail(sal_Char
const * pMsg
);
134 // -----------------------------------------------------------------------------
136 // -----------------------------------------------------------------------------
138 } // namespace configmgr