2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2006-12-13 15:24:33 +00:00
|
|
|
/*************************************************************************
|
|
|
|
|
*
|
2008-04-10 10:46:47 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2006-12-13 15:24:33 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2006-12-13 15:24:33 +00:00
|
|
|
*
|
2008-04-10 10:46:47 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2006-12-13 15:24:33 +00:00
|
|
|
*
|
2008-04-10 10:46:47 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2006-12-13 15:24:33 +00:00
|
|
|
*
|
2008-04-10 10:46:47 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
|
* only, as published by the Free Software Foundation.
|
2006-12-13 15:24:33 +00:00
|
|
|
*
|
2008-04-10 10:46:47 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2006-12-13 15:24:33 +00:00
|
|
|
*
|
2008-04-10 10:46:47 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
|
* for a copy of the LGPLv3 License.
|
2006-12-13 15:24:33 +00:00
|
|
|
*
|
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef CONNECTIVITY_SHAREDRESOURCES_HXX
|
|
|
|
|
#define CONNECTIVITY_SHAREDRESOURCES_HXX
|
|
|
|
|
|
|
|
|
|
/** === begin UNO includes === **/
|
|
|
|
|
/** === end UNO includes === **/
|
|
|
|
|
|
|
|
|
|
#include <rtl/ustring.hxx>
|
2008-12-10 13:41:25 +00:00
|
|
|
#include <list>
|
2008-12-30 13:32:01 +00:00
|
|
|
#include "connectivity/dbtoolsdllapi.hxx"
|
2006-12-13 15:24:33 +00:00
|
|
|
|
|
|
|
|
//........................................................................
|
|
|
|
|
namespace connectivity
|
|
|
|
|
{
|
|
|
|
|
//........................................................................
|
|
|
|
|
|
2008-10-01 12:28:29 +00:00
|
|
|
typedef sal_uInt16 ResourceId;
|
2006-12-13 15:24:33 +00:00
|
|
|
//====================================================================
|
|
|
|
|
//= SharedResources
|
|
|
|
|
//====================================================================
|
|
|
|
|
/** helper class for accessing resources shared by different libraries
|
|
|
|
|
in the connectivity module
|
|
|
|
|
*/
|
2008-12-30 13:32:01 +00:00
|
|
|
class OOO_DLLPUBLIC_DBTOOLS SharedResources
|
2006-12-13 15:24:33 +00:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
SharedResources();
|
|
|
|
|
~SharedResources();
|
|
|
|
|
|
|
|
|
|
/** loads a string from the shared resource file
|
|
|
|
|
@param _nResId
|
|
|
|
|
the resource ID of the string
|
|
|
|
|
@return
|
|
|
|
|
the string from the resource file
|
|
|
|
|
*/
|
|
|
|
|
::rtl::OUString
|
2008-10-01 12:28:29 +00:00
|
|
|
getResourceString(
|
2006-12-13 15:24:33 +00:00
|
|
|
ResourceId _nResId
|
2008-10-01 12:28:29 +00:00
|
|
|
) const;
|
2006-12-13 15:24:33 +00:00
|
|
|
|
|
|
|
|
/** loads a string from the shared resource file, and replaces
|
|
|
|
|
a given ASCII pattern with a given string
|
|
|
|
|
|
|
|
|
|
@param _nResId
|
|
|
|
|
the resource ID of the string to load
|
|
|
|
|
@param _pAsciiPatternToReplace
|
|
|
|
|
the ASCII string which is to search in the string. Must not be <NULL/>.
|
|
|
|
|
@param _rStringToSubstitute
|
|
|
|
|
the String which should substitute the ASCII pattern.
|
|
|
|
|
|
|
|
|
|
@return
|
|
|
|
|
the string from the resource file, with applied string substitution
|
|
|
|
|
*/
|
|
|
|
|
::rtl::OUString
|
|
|
|
|
getResourceStringWithSubstitution(
|
|
|
|
|
ResourceId _nResId,
|
|
|
|
|
const sal_Char* _pAsciiPatternToReplace,
|
|
|
|
|
const ::rtl::OUString& _rStringToSubstitute
|
2008-10-01 12:28:29 +00:00
|
|
|
) const;
|
2006-12-13 15:24:33 +00:00
|
|
|
|
|
|
|
|
/** loads a string from the shared resource file, and replaces
|
|
|
|
|
a given ASCII pattern with a given string
|
|
|
|
|
|
|
|
|
|
@param _nResId
|
|
|
|
|
the resource ID of the string to load
|
|
|
|
|
@param _pAsciiPatternToReplace1
|
|
|
|
|
the ASCII string (1) which is to search in the string. Must not be <NULL/>.
|
|
|
|
|
@param _rStringToSubstitute1
|
|
|
|
|
the String which should substitute the ASCII pattern (1)
|
|
|
|
|
@param _pAsciiPatternToReplace2
|
|
|
|
|
the ASCII string (2) which is to search in the string. Must not be <NULL/>.
|
|
|
|
|
@param _rStringToSubstitute2
|
|
|
|
|
the String which should substitute the ASCII pattern (2)
|
|
|
|
|
|
|
|
|
|
@return
|
|
|
|
|
the string from the resource file, with applied string substitution
|
|
|
|
|
*/
|
|
|
|
|
::rtl::OUString
|
|
|
|
|
getResourceStringWithSubstitution(
|
|
|
|
|
ResourceId _nResId,
|
|
|
|
|
const sal_Char* _pAsciiPatternToReplace1,
|
|
|
|
|
const ::rtl::OUString& _rStringToSubstitute1,
|
|
|
|
|
const sal_Char* _pAsciiPatternToReplace2,
|
|
|
|
|
const ::rtl::OUString& _rStringToSubstitute2
|
2008-10-01 12:28:29 +00:00
|
|
|
) const;
|
2006-12-13 15:24:33 +00:00
|
|
|
|
|
|
|
|
/** loads a string from the shared resource file, and replaces
|
|
|
|
|
a given ASCII pattern with a given string
|
|
|
|
|
|
|
|
|
|
@param _nResId
|
|
|
|
|
the resource ID of the string to load
|
|
|
|
|
@param _pAsciiPatternToReplace1
|
|
|
|
|
the ASCII string (1) which is to search in the string. Must not be <NULL/>.
|
|
|
|
|
@param _rStringToSubstitute1
|
|
|
|
|
the String which should substitute the ASCII pattern (1)
|
|
|
|
|
@param _pAsciiPatternToReplace2
|
|
|
|
|
the ASCII string (2) which is to search in the string. Must not be <NULL/>.
|
|
|
|
|
@param _rStringToSubstitute2
|
|
|
|
|
the String which should substitute the ASCII pattern (2)
|
|
|
|
|
@param _pAsciiPatternToReplace3
|
|
|
|
|
the ASCII string (3) which is to search in the string. Must not be <NULL/>.
|
|
|
|
|
@param _rStringToSubstitute3
|
|
|
|
|
the String which should substitute the ASCII pattern (3)
|
|
|
|
|
|
|
|
|
|
@return
|
|
|
|
|
the string from the resource file, with applied string substitution
|
|
|
|
|
*/
|
|
|
|
|
::rtl::OUString
|
|
|
|
|
getResourceStringWithSubstitution(
|
|
|
|
|
ResourceId _nResId,
|
|
|
|
|
const sal_Char* _pAsciiPatternToReplace1,
|
|
|
|
|
const ::rtl::OUString& _rStringToSubstitute1,
|
|
|
|
|
const sal_Char* _pAsciiPatternToReplace2,
|
|
|
|
|
const ::rtl::OUString& _rStringToSubstitute2,
|
|
|
|
|
const sal_Char* _pAsciiPatternToReplace3,
|
|
|
|
|
const ::rtl::OUString& _rStringToSubstitute3
|
2008-10-01 12:28:29 +00:00
|
|
|
) const;
|
2008-12-10 13:41:25 +00:00
|
|
|
|
|
|
|
|
/** loads a string from the shared resource file, and replaces a given ASCII pattern with a given string
|
|
|
|
|
|
|
|
|
|
@param _nResId
|
|
|
|
|
the resource ID of the string to load
|
|
|
|
|
@param _aStringToSubstitutes
|
|
|
|
|
A list of substitutions.
|
|
|
|
|
|
|
|
|
|
@return
|
|
|
|
|
the string from the resource file, with applied string substitution
|
|
|
|
|
*/
|
|
|
|
|
::rtl::OUString getResourceStringWithSubstitution( ResourceId _nResId,
|
|
|
|
|
const ::std::list< ::std::pair<const sal_Char* , ::rtl::OUString > > _aStringToSubstitutes) const;
|
2006-12-13 15:24:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//........................................................................
|
|
|
|
|
} // namespace connectivity
|
|
|
|
|
//........................................................................
|
|
|
|
|
|
|
|
|
|
#endif // CONNECTIVITY_SHAREDRESOURCES_HXX
|
|
|
|
|
|
2010-10-27 13:11:31 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|