Update ooo320-m1
[ooovba.git] / connectivity / source / inc / resource / sharedresources.hxx
blobe315808c59388e97a1a670d46887459ba9efda3e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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>
38 #include <list>
39 #include "connectivity/dbtoolsdllapi.hxx"
41 //........................................................................
42 namespace connectivity
44 //........................................................................
46 typedef sal_uInt16 ResourceId;
47 //====================================================================
48 //= SharedResources
49 //====================================================================
50 /** helper class for accessing resources shared by different libraries
51 in the connectivity module
53 class OOO_DLLPUBLIC_DBTOOLS SharedResources
55 public:
56 SharedResources();
57 ~SharedResources();
59 /** loads a string from the shared resource file
60 @param _nResId
61 the resource ID of the string
62 @return
63 the string from the resource file
65 ::rtl::OUString
66 getResourceString(
67 ResourceId _nResId
68 ) const;
70 /** loads a string from the shared resource file, and replaces
71 a given ASCII pattern with a given string
73 @param _nResId
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.
80 @return
81 the string from the resource file, with applied string substitution
83 ::rtl::OUString
84 getResourceStringWithSubstitution(
85 ResourceId _nResId,
86 const sal_Char* _pAsciiPatternToReplace,
87 const ::rtl::OUString& _rStringToSubstitute
88 ) const;
90 /** loads a string from the shared resource file, and replaces
91 a given ASCII pattern with a given string
93 @param _nResId
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)
104 @return
105 the string from the resource file, with applied string substitution
107 ::rtl::OUString
108 getResourceStringWithSubstitution(
109 ResourceId _nResId,
110 const sal_Char* _pAsciiPatternToReplace1,
111 const ::rtl::OUString& _rStringToSubstitute1,
112 const sal_Char* _pAsciiPatternToReplace2,
113 const ::rtl::OUString& _rStringToSubstitute2
114 ) const;
116 /** loads a string from the shared resource file, and replaces
117 a given ASCII pattern with a given string
119 @param _nResId
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)
134 @return
135 the string from the resource file, with applied string substitution
137 ::rtl::OUString
138 getResourceStringWithSubstitution(
139 ResourceId _nResId,
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
146 ) const;
148 /** loads a string from the shared resource file, and replaces a given ASCII pattern with a given string
150 @param _nResId
151 the resource ID of the string to load
152 @param _aStringToSubstitutes
153 A list of substitutions.
155 @return
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