|
1 /* |
|
2 * Copyright (c) 2003-2007 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: User dictionary interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 #ifndef _PTI_USERDICENTRY_H |
|
33 #define _PTI_USERDICENTRY_H |
|
34 |
|
35 // INCLUDES |
|
36 #include <e32base.h> |
|
37 |
|
38 // CONSTANTS |
|
39 const TInt KMaxUserDictionaryEntrySize = 100; |
|
40 |
|
41 /** |
|
42 * An interface class for accessing items in user dictionary. |
|
43 */ |
|
44 class MPtiUserDictionaryEntry |
|
45 { |
|
46 public: |
|
47 /** |
|
48 * Returns a pointer to the word held by this user dictionary entry. |
|
49 * |
|
50 * @since S60 V2.6 |
|
51 * @return A pointer to user dictionary word. |
|
52 */ |
|
53 virtual TPtrC Word() const = 0; |
|
54 |
|
55 /** |
|
56 * Returns a pointer to latin alphabet "reading" version for this user |
|
57 * dictionary entry. Needed for Japanese input. |
|
58 * |
|
59 * @since S60 V2.6 |
|
60 * @return A pointer to reading word |
|
61 */ |
|
62 virtual TPtrC Reading() const = 0; // Needed for Japanese input. |
|
63 |
|
64 /** |
|
65 * Sets word for this user dictionary entry. This version also |
|
66 * sets reading text. |
|
67 * |
|
68 * @param aWord A descriptor containing word to be set. |
|
69 * @param aReading A descriptor containing reading text for aWord. |
|
70 * @since S60 V2.6 |
|
71 */ |
|
72 virtual void SetWord(TDesC& aWord, TDesC& aReading) = 0; |
|
73 |
|
74 /** |
|
75 * Sets word for this user dictionary entry. This version |
|
76 * sets reading text to same value as "word": |
|
77 * |
|
78 * @param aWord A descriptor containing word to be set. |
|
79 * @since S60 V2.6 |
|
80 */ |
|
81 virtual void SetWord(TDesC& aWord) = 0; |
|
82 }; |
|
83 |
|
84 |
|
85 /** |
|
86 * This is implementation of MPtiUserDictionaryEntry interface |
|
87 * for latin languages (or any other language, which needs |
|
88 * only one component (=word) for user dictionary entry). |
|
89 * Implementation of Reading() method is same as implementation of |
|
90 * Word() method. |
|
91 */ |
|
92 class TPtiUserDictionaryEntry : public MPtiUserDictionaryEntry |
|
93 { |
|
94 public: |
|
95 inline TPtiUserDictionaryEntry(); |
|
96 inline TPtiUserDictionaryEntry(const TDesC& aWord); |
|
97 |
|
98 inline TPtrC Word() const; |
|
99 inline TPtrC Reading() const; |
|
100 inline void SetWord(TDesC& aWord, TDesC& aReading); |
|
101 inline void SetWord(TDesC& aWord); |
|
102 |
|
103 private: |
|
104 TBuf<KMaxUserDictionaryEntrySize> iEntry; |
|
105 }; |
|
106 |
|
107 #include "PtiUserDicEntry.inl" |
|
108 |
|
109 #endif |
|
110 |
|
111 // End of file |
|
112 |