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/.
10 #ifndef INCLUDED_EXTENSIONS_SOURCE_RESOURCE_RESOURCEINDEXACCESS_HXX
11 #define INCLUDED_EXTENSIONS_SOURCE_RESOURCE_RESOURCEINDEXACCESS_HXX
14 #include <com/sun/star/container/XNameAccess.hpp>
15 #include <com/sun/star/uno/Reference.hxx>
16 #include <com/sun/star/uno/Sequence.hxx>
17 #include <com/sun/star/uno/XInterface.hpp>
18 #include <cppuhelper/implbase.hxx>
21 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{
22 class XComponentContext
;
26 namespace extensions
{ namespace resource
28 /** This class provides access to tools library text resources */
29 class ResourceIndexAccess
: public cppu::WeakImplHelper
< css::container::XNameAccess
>
32 /** The ctor takes a sequence with one element: the name of the resource, e.g. svt */
33 ResourceIndexAccess(css::uno::Sequence
< css::uno::Any
> const& rArgs
, css::uno::Reference
< css::uno::XComponentContext
> const&);
35 // The XNameAccess provides access to one named elements:
36 // "String" returns a XIndexAccess to String resources
37 virtual css::uno::Any SAL_CALL
getByName( const OUString
& aName
) override
;
38 virtual css::uno::Sequence
< OUString
> SAL_CALL
getElementNames( ) override
;
39 virtual sal_Bool SAL_CALL
hasByName( const OUString
& aName
) override
;
41 virtual css::uno::Type SAL_CALL
getElementType( ) override
42 { return cppu::UnoType
<css::uno::XInterface
>::get(); };
43 virtual sal_Bool SAL_CALL
hasElements( ) override
44 { return static_cast<bool>(m_pResMgr
.get()); };
47 // m_pResMgr should never be NULL
48 const std::shared_ptr
<ResMgr
> m_pResMgr
;
53 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */