1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 #include <rtl/ustring.hxx>
24 #include <ucbhelper/providerhelper.hxx>
25 #include <com/sun/star/container/XContainerListener.hpp>
26 #include <com/sun/star/container/XContainer.hpp>
27 #include <com/sun/star/lang/XComponent.hpp>
28 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
29 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 // URL scheme. This is the scheme the provider will be able to create
34 // contents for. The UCB will select the provider ( i.e. in order to create
35 // contents ) according to this scheme.
37 #define MYUCP_URL_SCHEME "vnd.sun.star.help"
38 inline constexpr OUString MYUCP_CONTENT_TYPE
= u
"application/vnd.sun.star.xmlhelp"_ustr
; // UCB Content Type.
42 typedef cppu::ImplInheritanceHelper
< ::ucbhelper::ContentProviderImplHelper
, css::container::XContainerListener
, css::lang::XComponent
> ContentProvider_Base
;
43 class ContentProvider
: public ContentProvider_Base
46 explicit ContentProvider(
47 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
49 virtual ~ContentProvider() override
;
52 virtual OUString SAL_CALL
getImplementationName() override
;
53 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
54 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
57 virtual css::uno::Reference
< css::ucb::XContent
> SAL_CALL
queryContent(
58 const css::uno::Reference
< css::ucb::XContentIdentifier
>& Identifier
) override
;
60 // Additional interfaces
68 addEventListener( const css::uno::Reference
< css::lang::XEventListener
>& ) override
{}
71 removeEventListener( const css::uno::Reference
< css::lang::XEventListener
>& ) override
{}
73 // XContainerListener ( derive from XEventListener )
76 disposing( const css::lang::EventObject
& /*Source*/ ) override
82 elementInserted( const css::container::ContainerEvent
& ) override
{}
85 elementRemoved( const css::container::ContainerEvent
& ) override
{}
88 elementReplaced( const css::container::ContainerEvent
& Event
) override
;
90 // Non-interface methods.
94 std::unique_ptr
<Databases
> m_pDatabases
;
95 css::uno::Reference
<css::container::XContainer
> m_xContainer
;
101 static void subst( OUString
& instpath
);
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */