williamr@4
|
1 |
/*
|
williamr@4
|
2 |
* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@4
|
3 |
* All rights reserved.
|
williamr@4
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@4
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@4
|
8 |
*
|
williamr@4
|
9 |
* Initial Contributors:
|
williamr@4
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@4
|
11 |
*
|
williamr@4
|
12 |
* Contributors:
|
williamr@4
|
13 |
*
|
williamr@4
|
14 |
* Description:
|
williamr@4
|
15 |
*
|
williamr@4
|
16 |
*/
|
williamr@4
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#ifndef NUMBERCONVERSION_H_
|
williamr@2
|
20 |
#define NUMBERCONVERSION_H_
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#include <e32std.h>
|
williamr@2
|
23 |
|
williamr@2
|
24 |
|
williamr@2
|
25 |
class NumberConversion
|
williamr@2
|
26 |
/**
|
williamr@2
|
27 |
Functions for converting numbers between different numbers form different
|
williamr@2
|
28 |
scripts. The scripts supported are those given in enum TDigitType.
|
williamr@2
|
29 |
@publishedAll
|
williamr@2
|
30 |
@released
|
williamr@2
|
31 |
*/
|
williamr@2
|
32 |
{
|
williamr@2
|
33 |
public:
|
williamr@2
|
34 |
enum TDigitMatchType
|
williamr@2
|
35 |
{
|
williamr@2
|
36 |
EMatchSingleTypeOnly,
|
williamr@2
|
37 |
EMatchMultipleTypes
|
williamr@2
|
38 |
};
|
williamr@2
|
39 |
|
williamr@2
|
40 |
IMPORT_C static TInt ConvertFirstNumber(const TDesC& aText, TInt& aLength,
|
williamr@2
|
41 |
TDigitType& aDigitType,
|
williamr@2
|
42 |
TDigitMatchType aDigitMatchType = EMatchMultipleTypes);
|
williamr@2
|
43 |
|
williamr@2
|
44 |
IMPORT_C static TInt PositionAndTypeOfNextNumber(const TDesC& aText,
|
williamr@2
|
45 |
TDigitType& aDigitType, TInt aStartFrom = 0);
|
williamr@2
|
46 |
|
williamr@2
|
47 |
IMPORT_C static void FormatNumber(TDes& aText, TInt aNumber,
|
williamr@2
|
48 |
TDigitType aDigitType);
|
williamr@2
|
49 |
|
williamr@2
|
50 |
IMPORT_C static void FormatDigit(TDes& aText, TInt aNumber, TInt aLeadingZero,
|
williamr@2
|
51 |
TDigitType aDigitType);
|
williamr@2
|
52 |
|
williamr@2
|
53 |
IMPORT_C static void AppendFormatNumber(TDes& aText, TInt aNumber,
|
williamr@2
|
54 |
TDigitType aDigitType);
|
williamr@2
|
55 |
|
williamr@2
|
56 |
IMPORT_C static void ConvertDigits(TDes& aText, TDigitType aDigitType);
|
williamr@2
|
57 |
|
williamr@2
|
58 |
IMPORT_C static TInt LengthOfFormattedNumber(TInt aNumber,
|
williamr@2
|
59 |
TDigitType aDigitType);
|
williamr@2
|
60 |
|
williamr@2
|
61 |
IMPORT_C static TInt LengthOfConvertedText(const TDesC& aText,
|
williamr@2
|
62 |
TDigitType aDigitType);
|
williamr@2
|
63 |
|
williamr@2
|
64 |
IMPORT_C static void Format(TDigitType aDigitType,
|
williamr@2
|
65 |
TRefByValue<TDes> aFmt,...);
|
williamr@2
|
66 |
|
williamr@2
|
67 |
IMPORT_C static TChar ConvertDigit(TChar& aDigit, TDigitType aDigitType);
|
williamr@2
|
68 |
};
|
williamr@2
|
69 |
|
williamr@2
|
70 |
#endif
|