|
1 /* |
|
2 * Copyright (c) 2008 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: DB Engine |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 #ifndef C_CDBMANAGEMENT_H |
|
30 #define C_CDBMANAGEMENT_H |
|
31 |
|
32 // CLASS DECLARATION |
|
33 class CPtiEngine; |
|
34 class CAknFepSharedDataInterface; |
|
35 class CAknFepManager; |
|
36 |
|
37 // CONSTANTS |
|
38 const TInt KErrorMsgMaxLength = 60; |
|
39 /** |
|
40 * CDBManagement |
|
41 * User DB management view's DB Engine |
|
42 * |
|
43 * |
|
44 * @lib peninputhwrboxcn.lib |
|
45 * @since S60 v5.0 |
|
46 */ |
|
47 class CDBManagement : public CBase |
|
48 { |
|
49 |
|
50 public: |
|
51 |
|
52 /** |
|
53 * Symbian constructor. |
|
54 * |
|
55 * @since S60 v5.0 |
|
56 * @return Pointer to created CDBManagement object |
|
57 */ |
|
58 static CDBManagement* NewL( CAknFepManager* aFepManager ); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 * |
|
63 * @since S60 v5.0 |
|
64 * @return None |
|
65 */ |
|
66 virtual ~CDBManagement(); |
|
67 |
|
68 /** |
|
69 * Add phrase to DB. |
|
70 * |
|
71 * @since S60 v5.0 |
|
72 * @param aPhraseAdd the phrase to be added to DB |
|
73 * @return ETrue if the phrase is added to DB successfully, otherwise EFalse. |
|
74 */ |
|
75 TBool AddPhraseToDB( const TDesC& aPhraseAdd ); |
|
76 |
|
77 /** |
|
78 * Edit phrase from DB. |
|
79 * |
|
80 * @since S60 v5.0 |
|
81 * @param aPhraseOld the phrase to be edited before |
|
82 * @param aPhraseNew the phrase to be edited after |
|
83 * @return ETrue if the phrase is edited from DB successfully, otherwise EFalse. |
|
84 */ |
|
85 TBool EditPhraseFromDB( const TDesC& aPhraseOld, |
|
86 const TDesC& aPhraseNew ); |
|
87 |
|
88 /** |
|
89 * Remove phrase from DB. |
|
90 * |
|
91 * @since S60 v5.0 |
|
92 * @param aPhraseRemove the phrase to be removed |
|
93 * @return ETrue if the phrase is remove from DB successfully, otherwise EFalse. |
|
94 */ |
|
95 TBool RemovePhraseFromDB( const TDesC& aPhraseRemove ); |
|
96 |
|
97 /** |
|
98 * Get phrases from DB. |
|
99 * |
|
100 * @since S60 v5.0 |
|
101 * @param aPhraseGet the phrases are getde from DB |
|
102 * @return ETrue if the phrases are geted from DB successfully, otherwise EFalse. |
|
103 */ |
|
104 TBool GetPhraseFromDBL( CDesCArray& aPhraseGet); |
|
105 |
|
106 /** |
|
107 * Get Error Message. |
|
108 * |
|
109 * @since S60 v5.0 |
|
110 * @param aErrMsg the Error Message |
|
111 * @return None. |
|
112 */ |
|
113 void GetErrMsg( TDes& aErrMsg ); |
|
114 |
|
115 /** |
|
116 * Check the input pharese. |
|
117 * |
|
118 * @since S60 v5.0 |
|
119 * @param aPhraseInput the phrase to be checked |
|
120 * @return ETrue if the input phrase are checked successfully, otherwise EFalse. |
|
121 */ |
|
122 TBool InputPhraseCheck( TDes& aPhraseInput ); |
|
123 |
|
124 private: |
|
125 |
|
126 /** |
|
127 * C++ constructor |
|
128 * |
|
129 * @since S60 v5.0 |
|
130 * @return None |
|
131 */ |
|
132 CDBManagement(); |
|
133 |
|
134 /** |
|
135 * Second phase constructor. |
|
136 * |
|
137 * @since S60 v5.0 |
|
138 * @return Pointer to created CDBManagement object |
|
139 */ |
|
140 void ConstructL( CAknFepManager* aFepManager ); |
|
141 |
|
142 /** |
|
143 * set language |
|
144 * |
|
145 * @since S60 v5.0 |
|
146 * @return none. |
|
147 */ |
|
148 void ActivateLanguageL(); |
|
149 |
|
150 /** |
|
151 * set language |
|
152 * |
|
153 * @since S60 v5.0 |
|
154 * @return none. |
|
155 */ |
|
156 void ActivateLanguageOfFepL(); |
|
157 |
|
158 /** |
|
159 * set language |
|
160 * |
|
161 * @since S60 v5.0 |
|
162 * @return none. |
|
163 */ |
|
164 void ActivateLanguage(); |
|
165 |
|
166 /** |
|
167 * set input mode |
|
168 * |
|
169 * @since S60 v5.0 |
|
170 * @return ETrue if set input mode successfully, otherwise EFalse. |
|
171 */ |
|
172 TBool SetInputMode( CPtiEngine* aPtiEngine ); |
|
173 |
|
174 /** |
|
175 * get db error message |
|
176 * |
|
177 * @since S60 v5.0 |
|
178 * @return none. |
|
179 */ |
|
180 void GetDBErrMsg( TInt aErrCode ); |
|
181 |
|
182 private: //private data |
|
183 |
|
184 /** |
|
185 * CAknFepSharedDataInterface objcet |
|
186 * Own |
|
187 */ |
|
188 CAknFepSharedDataInterface* iAknFepSharedDataInterface; |
|
189 |
|
190 /** |
|
191 * CAknFepSharedDataInterface objcet |
|
192 * Own |
|
193 */ |
|
194 CPtiEngine* iPtiEngine; |
|
195 |
|
196 /** |
|
197 * CAknFepSharedDataInterface objcet |
|
198 * not Own |
|
199 */ |
|
200 CPtiEngine* iPtiEngineOfFep; |
|
201 |
|
202 /** |
|
203 * CAknFepSharedDataInterface objcet |
|
204 * not Own |
|
205 */ |
|
206 CAknFepManager* iFepManager; |
|
207 |
|
208 /** |
|
209 * Error message info |
|
210 */ |
|
211 TBuf<KErrorMsgMaxLength> iErrMsg; |
|
212 }; |
|
213 |
|
214 #endif // C_CDBMANAGEMENT_H |