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 .
20 #ifndef INCLUDED_COMPHELPER_OFFICERESOURCEBUNDLE_HXX
21 #define INCLUDED_COMPHELPER_OFFICERESOURCEBUNDLE_HXX
23 #include <comphelper/comphelperdllapi.h>
25 #include <com/sun/star/uno/XComponentContext.hpp>
26 #include <rtl/ustring.hxx>
35 //= OfficeResourceBundle
37 class ResourceBundle_Impl
;
38 /** wraps the css::resource::OfficeResourceAccess service
40 class COMPHELPER_DLLPUBLIC OfficeResourceBundle
43 ::std::unique_ptr
< ResourceBundle_Impl
> m_pImpl
;
46 /** constructs a resource bundle with the resource bundle given as 8-bit ASCII name
48 This is a convenience constructor only, it does nothing different than the constructor
49 taking an unicode string.
52 the component context to operate in
53 @param _bundleBaseName
54 the base name of the resource file which should be accessed (*without* the SUPD!)
55 @throws css::lang::NullPointerException
56 if the given component context is <NULL/>
59 const css::uno::Reference
< css::uno::XComponentContext
>& _context
,
60 const sal_Char
* _bundleBaseAsciiName
63 /** destroys the instance
65 ~OfficeResourceBundle();
67 /** loads the string with the given resource id from the resource bundle
69 the id of the string to load
71 the requested resource string. If no string with the given id exists in the resource bundle,
72 an empty string is returned. In a non-product version, an OSL_ENSURE will notify you of this
75 OUString
loadString( sal_Int32 _resourceId
) const;
77 /** determines whether the resource bundle has a string with the given id
79 the id of the string whose existence is to be checked
81 <TRUE/> if and only if a string with the given ID exists in the resource
84 bool hasString( sal_Int32 _resourceId
) const;
88 } // namespace comphelper
91 #endif // INCLUDED_COMPHELPER_OFFICERESOURCEBUNDLE_HXX
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */