|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Constructs text to speech descriptor. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TPHCNTTXTTOSPEECH_H |
|
20 #define TPHCNTTXTTOSPEECH_H |
|
21 |
|
22 #include <e32std.h> |
|
23 |
|
24 /** |
|
25 * Constructs text to speech descriptor. |
|
26 * Converts data from contact to text to speech descriptor. |
|
27 * |
|
28 * @lib PhoneCntFinder |
|
29 * @since S60 v3.1 |
|
30 */ |
|
31 class TPhCntTxtToSpeech |
|
32 { |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Constructor. |
|
37 * |
|
38 * @since S60 v3.1 |
|
39 * @param aFirstName First name from contact. |
|
40 * @param aSecondName aSecondName from contact. |
|
41 * @param aLastName Last name from contact. |
|
42 * @param aCompanyName Company name from contact. |
|
43 * @param aFirstNamePronunciation First name pronunciation from contact. |
|
44 * @param aLastNamePronunciation Last name pronunciation from contact. |
|
45 * @param aCompanyNamePronunciation Company name pronunciation from contact. |
|
46 * @param aCurrentLanguage Current language in use. |
|
47 */ |
|
48 TPhCntTxtToSpeech( |
|
49 const TDesC& aFirstName, |
|
50 const TDesC& aSecondName, |
|
51 const TDesC& aLastName, |
|
52 const TDesC& aCompanyName, |
|
53 const TDesC& aFirstNamePronunciation, |
|
54 const TDesC& aLastNamePronunciation, |
|
55 const TDesC& aCompanyNamePronunciation, |
|
56 TLanguage aCurrentLanguage |
|
57 ); |
|
58 |
|
59 /** |
|
60 * Constructs txt to speech string from contact field data, |
|
61 * given in constructor. |
|
62 * |
|
63 * @since S60 v3.1 |
|
64 * @param aTxtToSpeech Creates instance of txt to speech. May be null. |
|
65 */ |
|
66 void GetTextToSpeechL( HBufC*& aTxtToSpeech ) const; |
|
67 |
|
68 private: |
|
69 |
|
70 HBufC* AllocAndTrimL( const TDesC& aText ) const; |
|
71 |
|
72 TBool SwapNameOrder() const; |
|
73 |
|
74 HBufC* GetTrimmedNameLC( |
|
75 const TDesC& aWritenName, |
|
76 const TDesC& aNamePronunciation ) const; |
|
77 |
|
78 TInt CalculateTxtToSpeechLength( const HBufC* const aComponent, const HBufC* const aComponent2 ) const; |
|
79 |
|
80 private: // data |
|
81 |
|
82 /** |
|
83 * Contact field data. |
|
84 * Not own. |
|
85 */ |
|
86 const TDesC& iFirstName; |
|
87 const TDesC& iSecondName; |
|
88 const TDesC& iLastName; |
|
89 const TDesC& iCompanyName; |
|
90 const TDesC& iFirstNamePronunciation; |
|
91 const TDesC& iLastNamePronunciation; |
|
92 const TDesC& iCompanyNamePronunciation; |
|
93 TLanguage iCurrentLanguage; |
|
94 }; |
|
95 |
|
96 #endif // TPHCNTTXTTOSPEECH_H |