|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __BIOOP_H__ |
|
17 #define __BIOOP_H__ |
|
18 |
|
19 |
|
20 #include <msvapi.h> |
|
21 |
|
22 |
|
23 // package buffer for progress info. |
|
24 typedef TPckgBuf<TBioProgress> TBioProgressBuf; |
|
25 |
|
26 // forward declarations |
|
27 class CBaseScriptParser2; |
|
28 |
|
29 |
|
30 class CBIOOperation : public CMsvOperation |
|
31 /** BIO client MTM Parser Active Object. |
|
32 |
|
33 The BIO client MTM Parser Active Object is responsible for parsing and processing BIO files. |
|
34 This activity was originally carried out in the BIO Server MTM but has been relocated to |
|
35 the Client MTM for Platsec capability reasons. The parsing and processing is carried out |
|
36 in an Active Object rather than synchronously in order to avoid making a UI unresponsive. |
|
37 @internalTechnology |
|
38 @released |
|
39 */ |
|
40 { |
|
41 public: |
|
42 enum TBioOperationState |
|
43 { |
|
44 EBiooWaiting, |
|
45 EBiooCreating, |
|
46 EBiooParsing, |
|
47 EBiooProcessing, |
|
48 EBiooComplete |
|
49 }; |
|
50 enum TBioOperation |
|
51 { |
|
52 EBioParseOnly, |
|
53 EBioParseAndProcess, |
|
54 EBioProcess |
|
55 }; |
|
56 enum TBioMessageState |
|
57 { |
|
58 EBioMsgNotParsed=0, |
|
59 EBioMsgParsed, |
|
60 EBioMsgProcessed |
|
61 }; |
|
62 public: |
|
63 static CBIOOperation* NewL(RFs aRFs, CMsvSession& aSession, CBIODatabase* aBDB, TRequestStatus& aCompletionStatus); |
|
64 ~CBIOOperation(); |
|
65 protected: |
|
66 // from CActive |
|
67 virtual void RunL(); |
|
68 virtual void DoCancel(); |
|
69 virtual TInt RunError(TInt aError); |
|
70 public: |
|
71 // from CMsvOperation |
|
72 virtual const TDesC8& ProgressL(); |
|
73 public: |
|
74 // new functions |
|
75 void StartCommand(const CMsvEntrySelection& aSelection, TInt aCommand, TRequestStatus& aStatus); |
|
76 private: |
|
77 CBIOOperation(RFs aRFs, CMsvSession& aSession, CBIODatabase* aBDB, TRequestStatus& aCompletionStatus); |
|
78 void ConstructL(); |
|
79 // |
|
80 void ParseL(const CMsvEntrySelection& aSelection, TBool aCommit); |
|
81 void CreateParserL(); |
|
82 void StartParserL(); |
|
83 void ExtractMessageBodyL(); |
|
84 void ProcessL(const CMsvEntrySelection& aSelection); |
|
85 void ProcessL(); |
|
86 private: |
|
87 RFs iFs; |
|
88 CBIODatabase* iBioDatabase; |
|
89 TRequestStatus* iReportStatus; |
|
90 TBioProgress iProgress; |
|
91 TBioProgressBuf iProgressBuf; |
|
92 TBool iInOperation; |
|
93 TUid iUid; |
|
94 TBioOperationState iBioOperationState; |
|
95 TBioOperation iBioOperationOperation; |
|
96 TMsvId iCurrentMsvId; |
|
97 // |
|
98 CRegisteredParserDll* iRegisteredParserDll; |
|
99 CBaseScriptParser2* iParser; |
|
100 HBufC* iMessageBody; |
|
101 CMsvEntry* iCurrentEntry; |
|
102 }; |
|
103 |
|
104 |
|
105 #endif // __BIOOP_H__ |