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: importmergehandler.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_IMPORTMERGEHANDLER_HXX
32 #define CONFIGMGR_BACKEND_IMPORTMERGEHANDLER_HXX
34 #include "basicimporthandler.hxx"
36 // -----------------------------------------------------------------------------
40 // -----------------------------------------------------------------------------
43 // -----------------------------------------------------------------------------
44 namespace uno
= ::com::sun::star::uno
;
45 namespace lang
= ::com::sun::star::lang
;
46 namespace backenduno
= ::com::sun::star::configuration::backend
;
47 // -----------------------------------------------------------------------------
49 class ImportMergeHandler
: public BasicImportHandler
54 merge
, // merge as update into existing data
55 copy
, // reset existing data first -> copy imported data
56 no_overwrite
// copy/merge only if no data is in the layer
60 ImportMergeHandler(uno::Reference
< backenduno::XBackend
> const & xTargetBackend
, Mode mode
,
61 rtl::OUString
const & aEntity
= rtl::OUString(), sal_Bool
const & bNotify
= sal_False
);
67 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
71 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
74 overrideNode( const rtl::OUString
& aName
, sal_Int16 aAttributes
, sal_Bool bClear
)
75 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
78 addOrReplaceNode( const rtl::OUString
& aName
, sal_Int16 aAttributes
)
79 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
82 addOrReplaceNodeFromTemplate( const rtl::OUString
& aName
, const backenduno::TemplateIdentifier
& aTemplate
, sal_Int16 aAttributes
)
83 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
87 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
90 dropNode( const rtl::OUString
& aName
)
91 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
94 overrideProperty( const rtl::OUString
& aName
, sal_Int16 aAttributes
, const uno::Type
& aType
, sal_Bool bClear
)
95 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
99 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
101 virtual void SAL_CALL
102 setPropertyValue( const uno::Any
& aValue
)
103 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
105 virtual void SAL_CALL
106 setPropertyValueForLocale( const uno::Any
& aValue
, const rtl::OUString
& aLocale
)
107 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
109 virtual void SAL_CALL
110 addProperty( const rtl::OUString
& aName
, sal_Int16 aAttributes
, const uno::Type
& aType
)
111 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
113 virtual void SAL_CALL
114 addPropertyWithValue( const rtl::OUString
& aName
, sal_Int16 aAttributes
, const uno::Any
& aValue
)
115 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
117 bool isStarted() const;
119 void failNotStarted();
121 uno::Reference
< backenduno::XUpdateHandler
> getOutputHandler();
123 uno::Reference
< backenduno::XUpdateHandler
> createOutputHandler();
125 uno::Reference
< backenduno::XUpdateHandler
> m_xOutputHandler
;
128 // -----------------------------------------------------------------------------
130 // -----------------------------------------------------------------------------
132 } // namespace configmgr