bump product version to 5.0.4.1
[LibreOffice.git] / connectivity / source / inc / resource / sharedresources.hxx
blobfadbf354822b85ac4bdff321f946a6033963ac84
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_CONNECTIVITY_SOURCE_INC_RESOURCE_SHAREDRESOURCES_HXX
21 #define INCLUDED_CONNECTIVITY_SOURCE_INC_RESOURCE_SHAREDRESOURCES_HXX
23 #include <rtl/ustring.hxx>
24 #include <list>
25 #include <connectivity/dbtoolsdllapi.hxx>
28 namespace connectivity
32 typedef sal_uInt16 ResourceId;
34 /** helper class for accessing resources shared by different libraries
35 in the connectivity module
37 class OOO_DLLPUBLIC_DBTOOLS SharedResources
39 public:
40 SharedResources();
41 ~SharedResources();
43 /** loads a string from the shared resource file
44 @param _nResId
45 the resource ID of the string
46 @return
47 the string from the resource file
49 OUString
50 getResourceString(
51 ResourceId _nResId
52 ) const;
54 /** loads a string from the shared resource file, and replaces
55 a given ASCII pattern with a given string
57 @param _nResId
58 the resource ID of the string to load
59 @param _pAsciiPatternToReplace
60 the ASCII string which is to search in the string. Must not be <NULL/>.
61 @param _rStringToSubstitute
62 the String which should substitute the ASCII pattern.
64 @return
65 the string from the resource file, with applied string substitution
67 OUString
68 getResourceStringWithSubstitution(
69 ResourceId _nResId,
70 const sal_Char* _pAsciiPatternToReplace,
71 const OUString& _rStringToSubstitute
72 ) const;
74 /** loads a string from the shared resource file, and replaces
75 a given ASCII pattern with a given string
77 @param _nResId
78 the resource ID of the string to load
79 @param _pAsciiPatternToReplace1
80 the ASCII string (1) which is to search in the string. Must not be <NULL/>.
81 @param _rStringToSubstitute1
82 the String which should substitute the ASCII pattern (1)
83 @param _pAsciiPatternToReplace2
84 the ASCII string (2) which is to search in the string. Must not be <NULL/>.
85 @param _rStringToSubstitute2
86 the String which should substitute the ASCII pattern (2)
88 @return
89 the string from the resource file, with applied string substitution
91 OUString
92 getResourceStringWithSubstitution(
93 ResourceId _nResId,
94 const sal_Char* _pAsciiPatternToReplace1,
95 const OUString& _rStringToSubstitute1,
96 const sal_Char* _pAsciiPatternToReplace2,
97 const OUString& _rStringToSubstitute2
98 ) const;
100 /** loads a string from the shared resource file, and replaces
101 a given ASCII pattern with a given string
103 @param _nResId
104 the resource ID of the string to load
105 @param _pAsciiPatternToReplace1
106 the ASCII string (1) which is to search in the string. Must not be <NULL/>.
107 @param _rStringToSubstitute1
108 the String which should substitute the ASCII pattern (1)
109 @param _pAsciiPatternToReplace2
110 the ASCII string (2) which is to search in the string. Must not be <NULL/>.
111 @param _rStringToSubstitute2
112 the String which should substitute the ASCII pattern (2)
113 @param _pAsciiPatternToReplace3
114 the ASCII string (3) which is to search in the string. Must not be <NULL/>.
115 @param _rStringToSubstitute3
116 the String which should substitute the ASCII pattern (3)
118 @return
119 the string from the resource file, with applied string substitution
121 OUString
122 getResourceStringWithSubstitution(
123 ResourceId _nResId,
124 const sal_Char* _pAsciiPatternToReplace1,
125 const OUString& _rStringToSubstitute1,
126 const sal_Char* _pAsciiPatternToReplace2,
127 const OUString& _rStringToSubstitute2,
128 const sal_Char* _pAsciiPatternToReplace3,
129 const OUString& _rStringToSubstitute3
130 ) const;
132 /** loads a string from the shared resource file, and replaces a given ASCII pattern with a given string
134 @param _nResId
135 the resource ID of the string to load
136 @param _aStringToSubstitutes
137 A list of substitutions.
139 @return
140 the string from the resource file, with applied string substitution
142 OUString getResourceStringWithSubstitution( ResourceId _nResId,
143 const ::std::list< ::std::pair<const sal_Char* , OUString > >& _rStringToSubstitutes) const;
147 } // namespace connectivity
150 #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_RESOURCE_SHAREDRESOURCES_HXX
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */