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: basicimporthandler.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_BASICIMPORTHANDLER_HXX
32 #define CONFIGMGR_BACKEND_BASICIMPORTHANDLER_HXX
34 #include <cppuhelper/implbase1.hxx>
35 #include <com/sun/star/configuration/backend/XLayerHandler.hpp>
36 #include <com/sun/star/configuration/backend/XBackend.hpp>
38 // -----------------------------------------------------------------------------
42 // -----------------------------------------------------------------------------
45 // -----------------------------------------------------------------------------
46 namespace uno
= ::com::sun::star::uno
;
47 namespace lang
= ::com::sun::star::lang
;
48 namespace backenduno
= ::com::sun::star::configuration::backend
;
49 // -----------------------------------------------------------------------------
51 class BasicImportHandler
: public cppu::WeakImplHelper1
< backenduno::XLayerHandler
>
55 BasicImportHandler(){}
57 BasicImportHandler(uno::Reference
< backenduno::XBackend
> const & xBackend
,rtl::OUString
const & aEntity
= rtl::OUString(), const sal_Bool
& bNofity
= sal_False
);
58 ~BasicImportHandler();
60 // XLayerHandler subset - call these implementations from your derived class implementations
64 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
68 throw (backenduno::MalformedDataException
, lang::WrappedTargetException
, uno::RuntimeException
);
71 bool hasComponent() const { return m_aComponentName
.getLength() != 0; }
72 bool hasEntity() const { return m_aEntity
.getLength() != 0; }
74 rtl::OUString
getComponent() const { return m_aComponentName
; }
75 rtl::OUString
getEntity() const { return m_aEntity
; }
76 uno::Reference
< backenduno::XBackend
> getBackend() const { return m_xBackend
; }
78 bool startComponent( const rtl::OUString
& aName
);
80 void raiseMalformedDataException(sal_Char
const * pMsg
);
81 /** If True, notification should be send to backend
83 sal_Bool m_bSendNotification
;
85 uno::Reference
< backenduno::XBackend
> const m_xBackend
;
86 rtl::OUString m_aComponentName
;
87 rtl::OUString
const m_aEntity
;
90 // -----------------------------------------------------------------------------
92 // -----------------------------------------------------------------------------
94 } // namespace configmgr