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 COMPHELPER_OFFICE_RESOURCE_BUNDLE_HXX
21 #define COMPHELPER_OFFICE_RESOURCE_BUNDLE_HXX
23 #include <comphelper/comphelperdllapi.h>
25 #include <com/sun/star/uno/XComponentContext.hpp>
26 #include <rtl/ustring.hxx>
30 //........................................................................
33 //........................................................................
35 //====================================================================
36 //= OfficeResourceBundle
37 //====================================================================
38 class ResourceBundle_Impl
;
39 /** wraps the <type scope="com::sun::star::resource">OfficeResourceAccess</type> service
41 class COMPHELPER_DLLPUBLIC OfficeResourceBundle
44 ::std::auto_ptr
< ResourceBundle_Impl
> m_pImpl
;
47 /** constructs a resource bundle with the resource bundle given as 8-bit ASCII name
49 This is a convenience constructor only, it does nothing different than the constructor
50 taking an unicode string.
53 the component context to operate in
54 @param _bundleBaseName
55 the base name of the resource file which should be accessed (*without* the SUPD!)
56 @raises ::com::sun::star::lang::NullPointerException
57 if the given component context is <NULL/>
60 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& _context
,
61 const sal_Char
* _bundleBaseAsciiName
64 /** destroys the instance
66 ~OfficeResourceBundle();
68 /** loads the string with the given resource id from the resource bundle
70 the id of the string to load
72 the requested resource string. If no string with the given id exists in the resource bundle,
73 an empty string is returned. In a non-product version, an OSL_ENSURE will notify you of this
76 OUString
loadString( sal_Int32 _resourceId
) const;
78 /** determines whether the resource bundle has a string with the given id
80 the id of the string whose existence is to be checked
82 <TRUE/> if and only if a string with the given ID exists in the resource
85 bool hasString( sal_Int32 _resourceId
) const;
88 //........................................................................
89 } // namespace comphelper
90 //........................................................................
92 #endif // COMPHELPER_OFFICE_RESOURCE_BUNDLE_HXX
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */