/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef __com_sun_star_i18n_XTransliteration_idl__
#define __com_sun_star_i18n_XTransliteration_idl__
#include Transliteration is a character to character conversion but it is
not always a one to one mapping between characters. Transliteration
modules are primarily used by collation, and search and replace
modules to perform approximate search. It can also be used to format
the numbers in different numbering systems. In order to select transliteration modules for different
purposes, they are classified with attributes of
TransliterationType. For Western languages there would be three transliteration
modules available to compare two mixed case strings: upper to lower,
lower to upper, and ignore case. A typical calling sequence of transliteration is
or another one is
Each transliteration module is registered under a different
service name. The convention for the service name is
com.sun.star.i18n.Transliteration.l10n.{implName}. The
{implName} is a unique name used to identify a module. The
implName is used to get a localized name for the transliteration
module. The implName is used in locale data to list the
available transliteration modules for the locale. There are some
transliteration modules that are always available. The names of
those modules are listed as enum
TransliterationModules names. For modules not
listed there it is possible to load them directly by their
implName.
@param aImplName
The module's {implName} under which it is registered with
com.sun.star.i18n.Transliteration.l10n.{implName}.
*/
void loadModuleByImplName( [in] string aImplName,
[in] ::com::sun::star::lang::Locale aLocale );
/** Load a sequence of instances of transliteration modules.
Output of one module is fed as input to the next module in
the sequence. The object created by this call has
TransliterationType CASCADE and IGNORE types.
@param aImplNameList
Only IGNORE type modules can be specified.
*/
void loadModulesByImplNames( [in] sequence This method can be called if the object has
TransliterationType IGNORE attribute. Returns the number of matched code points in any case, even if
strings are not equal, for example: This method is intended for getting corresponding ranges and
can be called if the object has TransliterationType
IGNORE attribute. For example: generic CASE_IGNORE transliterateRange( "a", "i" )
returns {"A","I","a","i"}, transliterateRange( "a", "a" )
returns {"A","A","a","a"}. Use this transliteration to create regular expressions like
[a-i] --> [A-Ia-i].
equals( "a", 0, 1, nMatch1, "aaa", 0, 3, nMatch2 )
returns `FALSE` and nMatch:=1 and nMatch2:=1
equals( "aab", 0, 3, nMatch1, "aaa", 0, 3, nMatch2 )
returns `FALSE` and nMatch:=2 and nMatch2:=2
`FALSE` else.
*/
boolean equals( [in] string aStr1, [in] long nPos1, [in] long nCount1,
[out] long rMatch1,
[in] string aStr2, [in] long nPos2, [in] long nCount2,
[out] long rMatch2 );
/** Transliterate one set of characters to another.
0 if the first substring is equal to the second substring
-1 if the first substring is less than the second substring
*/
long compareSubstring( [in] string aStr1, [in] long nOff1, [in] long nLen1,
[in] string aStr2, [in] long nOff2, [in] long nLen2 );
/** Compare 2 strings as per this transliteration. It translates both
strings before comparing them.
@returns
1 if the first string is greater than the second string
0 if the first string is equal to the second string
-1 if the first string is less than the second string
*/
long compareString( [in] string aStr1, [in] string aStr2 );
};
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */