1/*
2**
3** Copyright 2010, The Android Open Source Project
4**
5** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
8**
9**     http://www.apache.org/licenses/LICENSE-2.0
10**
11** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
15** limitations under the License.
16*/
17
18#ifndef _ANDROID_PHONEBOOK_INDEX_H
19#define _ANDROID_PHONEBOOK_INDEX_H
20
21#include <unicode/uiter.h>
22#include <unicode/utypes.h>
23
24namespace android {
25
26/**
27 * A character converter that takes a UNICODE character and produces the
28 * phone book index for it in the specified locale. For example, "a" becomes "A"
29 * and so does A with accents. Conversion rules differ from locale
30 * locale, which is why this function takes locale as an argument.
31 *
32 * @param iter iterator if input characters
33 * @param locale the string representation of the current locale, e.g. "ja"
34 * @param out output buffer
35 * @param size size of the output buffer in bytes. The buffer should be large enough
36 *        to hold the longest phone book index (e.g. a three-char word in Japan).
37 * @param isError will be set to TRUE if an error occurs
38 *
39 * @return number of characters returned
40 */
41int32_t GetPhonebookIndex(UCharIterator * iter, const char * locale, UChar * out, int32_t size,
42        UBool * isError);
43
44}  // namespace android
45
46#endif
47