bump product version to 4.2.0.1
[LibreOffice.git] / include / comphelper / officeresourcebundle.hxx
blob29279ab5b5c60240b598d238b9868e77a656daf1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
28 #include <memory>
30 //........................................................................
31 namespace comphelper
33 //........................................................................
35 //====================================================================
36 //= OfficeResourceBundle
37 //====================================================================
38 class ResourceBundle_Impl;
39 /** wraps the com::sun::star::resource::OfficeResourceAccess service
41 class COMPHELPER_DLLPUBLIC OfficeResourceBundle
43 private:
44 ::std::auto_ptr< ResourceBundle_Impl > m_pImpl;
46 public:
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.
52 @param _context
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/>
59 OfficeResourceBundle(
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
69 @param _resourceId
70 the id of the string to load
71 @return
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
74 then.
76 OUString loadString( sal_Int32 _resourceId ) const;
78 /** determines whether the resource bundle has a string with the given id
79 @param _resourceId
80 the id of the string whose existence is to be checked
81 @return
82 <TRUE/> if and only if a string with the given ID exists in the resource
83 bundle.
85 bool hasString( sal_Int32 _resourceId ) const;
88 //........................................................................
89 } // namespace comphelper
90 //........................................................................
92 #endif // INCLUDED_COMPHELPER_OFFICERESOURCEBUNDLE_HXX
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */