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: basicupdatemerger.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_BASICUPDATEMERGER_HXX
32 #define CONFIGMGR_BACKEND_BASICUPDATEMERGER_HXX
34 #include <cppuhelper/implbase2.hxx>
35 #include <com/sun/star/configuration/backend/XLayerHandler.hpp>
36 #include <com/sun/star/configuration/backend/XLayer.hpp>
38 #ifndef INCLUDED_VECTOR
40 #define INCLUDED_VECTOR
42 // -----------------------------------------------------------------------------
46 // -----------------------------------------------------------------------------
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 BasicUpdateMerger
: public cppu::WeakImplHelper2
< backenduno::XLayerHandler
, backenduno::XLayer
>
59 BasicUpdateMerger(uno::Reference
< backenduno::XLayer
> const & _xSourceLayer
);
66 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
70 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
73 overrideNode( const rtl::OUString
& aName
, sal_Int16 aAttributes
, sal_Bool bClear
)
74 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
77 addOrReplaceNode( const rtl::OUString
& aName
, sal_Int16 aAttributes
)
78 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
81 addOrReplaceNodeFromTemplate( const rtl::OUString
& aName
, const backenduno::TemplateIdentifier
& aTemplate
, sal_Int16 aAttributes
)
82 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
86 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
89 dropNode( const rtl::OUString
& aName
)
90 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
93 overrideProperty( const rtl::OUString
& aName
, sal_Int16 aAttributes
, const uno::Type
& aType
, sal_Bool bClear
)
94 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
98 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
100 virtual void SAL_CALL
101 setPropertyValue( const uno::Any
& aValue
)
102 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
104 virtual void SAL_CALL
105 setPropertyValueForLocale( const uno::Any
& aValue
, const rtl::OUString
& aLocale
)
106 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
108 virtual void SAL_CALL
109 addProperty( const rtl::OUString
& aName
, sal_Int16 aAttributes
, const uno::Type
& aType
)
110 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
112 virtual void SAL_CALL
113 addPropertyWithValue( const rtl::OUString
& aName
, sal_Int16 aAttributes
, const uno::Any
& aValue
)
114 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
118 virtual void SAL_CALL
119 readData( const uno::Reference
< backenduno::XLayerHandler
>& aHandler
)
120 throw (backenduno::MalformedDataException
, lang::NullPointerException
, lang::WrappedTargetException
, uno::RuntimeException
);
124 /// write the whole update to the output
125 virtual void flushUpdate() = 0;
128 bool isHandling() const { return m_nNesting
!= 0 || !m_aSearchPath
.empty(); }
129 bool isSkipping() const { return m_bSkipping
; }
130 void startSkipping();
132 void findContext(std::vector
<rtl::OUString
> const & _aContext
);
135 uno::Reference
< backenduno::XLayerHandler
> getResultWriter() const { return m_xResultHandler
; };
137 void raiseMalformedDataException(sal_Char
const * pMsg
);
139 void pushLevel(rtl::OUString
const & _aLevel
);
144 uno::Reference
< backenduno::XLayer
> m_xSourceLayer
;
145 uno::Reference
< backenduno::XLayerHandler
> m_xResultHandler
;
146 std::vector
<rtl::OUString
> m_aSearchPath
;
148 sal_Int16 m_nNesting
;
151 // -----------------------------------------------------------------------------
153 // -----------------------------------------------------------------------------
155 } // namespace configmgr