1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sharedresources.hxx,v $
10 * $Revision: 1.3.56.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef CONNECTIVITY_SHAREDRESOURCES_HXX
32 #define CONNECTIVITY_SHAREDRESOURCES_HXX
34 /** === begin UNO includes === **/
35 /** === end UNO includes === **/
37 #include <rtl/ustring.hxx>
39 #include "connectivity/dbtoolsdllapi.hxx"
41 //........................................................................
42 namespace connectivity
44 //........................................................................
46 typedef sal_uInt16 ResourceId
;
47 //====================================================================
49 //====================================================================
50 /** helper class for accessing resources shared by different libraries
51 in the connectivity module
53 class OOO_DLLPUBLIC_DBTOOLS SharedResources
59 /** loads a string from the shared resource file
61 the resource ID of the string
63 the string from the resource file
70 /** loads a string from the shared resource file, and replaces
71 a given ASCII pattern with a given string
74 the resource ID of the string to load
75 @param _pAsciiPatternToReplace
76 the ASCII string which is to search in the string. Must not be <NULL/>.
77 @param _rStringToSubstitute
78 the String which should substitute the ASCII pattern.
81 the string from the resource file, with applied string substitution
84 getResourceStringWithSubstitution(
86 const sal_Char
* _pAsciiPatternToReplace
,
87 const ::rtl::OUString
& _rStringToSubstitute
90 /** loads a string from the shared resource file, and replaces
91 a given ASCII pattern with a given string
94 the resource ID of the string to load
95 @param _pAsciiPatternToReplace1
96 the ASCII string (1) which is to search in the string. Must not be <NULL/>.
97 @param _rStringToSubstitute1
98 the String which should substitute the ASCII pattern (1)
99 @param _pAsciiPatternToReplace2
100 the ASCII string (2) which is to search in the string. Must not be <NULL/>.
101 @param _rStringToSubstitute2
102 the String which should substitute the ASCII pattern (2)
105 the string from the resource file, with applied string substitution
108 getResourceStringWithSubstitution(
110 const sal_Char
* _pAsciiPatternToReplace1
,
111 const ::rtl::OUString
& _rStringToSubstitute1
,
112 const sal_Char
* _pAsciiPatternToReplace2
,
113 const ::rtl::OUString
& _rStringToSubstitute2
116 /** loads a string from the shared resource file, and replaces
117 a given ASCII pattern with a given string
120 the resource ID of the string to load
121 @param _pAsciiPatternToReplace1
122 the ASCII string (1) which is to search in the string. Must not be <NULL/>.
123 @param _rStringToSubstitute1
124 the String which should substitute the ASCII pattern (1)
125 @param _pAsciiPatternToReplace2
126 the ASCII string (2) which is to search in the string. Must not be <NULL/>.
127 @param _rStringToSubstitute2
128 the String which should substitute the ASCII pattern (2)
129 @param _pAsciiPatternToReplace3
130 the ASCII string (3) which is to search in the string. Must not be <NULL/>.
131 @param _rStringToSubstitute3
132 the String which should substitute the ASCII pattern (3)
135 the string from the resource file, with applied string substitution
138 getResourceStringWithSubstitution(
140 const sal_Char
* _pAsciiPatternToReplace1
,
141 const ::rtl::OUString
& _rStringToSubstitute1
,
142 const sal_Char
* _pAsciiPatternToReplace2
,
143 const ::rtl::OUString
& _rStringToSubstitute2
,
144 const sal_Char
* _pAsciiPatternToReplace3
,
145 const ::rtl::OUString
& _rStringToSubstitute3
148 /** loads a string from the shared resource file, and replaces a given ASCII pattern with a given string
151 the resource ID of the string to load
152 @param _aStringToSubstitutes
153 A list of substitutions.
156 the string from the resource file, with applied string substitution
158 ::rtl::OUString
getResourceStringWithSubstitution( ResourceId _nResId
,
159 const ::std::list
< ::std::pair
<const sal_Char
* , ::rtl::OUString
> > _aStringToSubstitutes
) const;
162 //........................................................................
163 } // namespace connectivity
164 //........................................................................
166 #endif // CONNECTIVITY_SHAREDRESOURCES_HXX