|
1 // Copyright (c) 1998-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 class COutputter : public CBase |
|
17 { |
|
18 public: |
|
19 static COutputter* NewL(RTest* aTest); |
|
20 ~COutputter(); |
|
21 |
|
22 void SetRFs( RFs* aFs); |
|
23 void SetFilePrefix( TUint aNum ); |
|
24 void SetFileL( const TDesC& leafname, TBool aUnicode=EFalse ); |
|
25 void UnSetFile(); |
|
26 void PrintL( const TDesC8& aText ); |
|
27 void PrintL( const TDesC16& aText ); |
|
28 void Printf( TRefByValue<const TDesC> aFmt,... ); |
|
29 void PrintIfNotNullL( const TDesC& aLabel, const TDesC8& aValue ); |
|
30 void PrintIfNotNullL( const TDesC& aLabel, const TDesC16& aValue ); |
|
31 void PrintListL( const TDesC& aLabel, CDesC8Array& aList ); |
|
32 void PrintListL( const TDesC& aLabel, CDesC16Array& aList ); |
|
33 void PrintDataL( const TDesC8& aData ); |
|
34 |
|
35 private: |
|
36 void ConstructL(); |
|
37 |
|
38 private: |
|
39 TInt iFilesOpen; |
|
40 RFile iFile[4]; |
|
41 RTest* iTest; |
|
42 RFs* iFs; |
|
43 TDes16Overflow* iOverflow; |
|
44 TBuf<9> iPrefix; |
|
45 TBool iUnicode; |
|
46 |
|
47 public: |
|
48 TBool iUseFiles; |
|
49 }; |
|
50 |
|
51 //---------------------------------------------------------------------------------------- |
|
52 |
|
53 typedef TBool(*MsgMatchFn)( CMsvServerEntry* aEntry); |
|
54 |
|
55 //---------------------------------------------------------------------------------------- |
|
56 |
|
57 class CMsgOutputter : public CBase |
|
58 { |
|
59 public: |
|
60 static CMsgOutputter* NewL( COutputter* aPutter, CMsvServerEntry* aEntry ); |
|
61 ~CMsgOutputter(); |
|
62 void DumpL( TMsvId aId, |
|
63 TInt aSummary, |
|
64 TInt aParts, |
|
65 TBool aRecurse, |
|
66 TBool aShowIds, |
|
67 MsgMatchFn aMatch =0); |
|
68 |
|
69 private: |
|
70 CMsgOutputter( COutputter* aPutter, CMsvServerEntry* aEntry ); |
|
71 // void ConstructL(CMsvServer* aServer); |
|
72 |
|
73 void BodyDataL(CMsvStore& aFileStore); |
|
74 void MimeHeaderL(CMsvStore& aFileStore); |
|
75 void HeaderL(CMsvStore& aFileStore); |
|
76 void MultipartDataL(CMsvStore& aFileStore); |
|
77 void SettingsL(const TMsvEntry& aEntry); |
|
78 void Imap4SettingsL(const TMsvEntry& aEntry); |
|
79 void QueuedOpsL( CMsvStore& aFileStore ); |
|
80 |
|
81 TPtrC PriorityString( const TMsvEmailEntry& entry ); |
|
82 TPtrC DisconnectedOpString( const TMsvEmailEntry& entry ); |
|
83 TPtrC TypeString( const TMsvEmailEntry& entry ); |
|
84 void FlagsString( TBuf<8>&other, const TMsvEmailEntry& entry ); |
|
85 void IMAP4FlagsString( TBuf<7>&other, const TMsvEmailEntry& entry ); |
|
86 TPtrC SubscribeTypeString( TFolderSubscribeType aType ); |
|
87 TPtrC SyncTypeString( TFolderSyncType aType ); |
|
88 TPtrC OffLineOpTypeString(CImOffLineOperation::TOffLineOpType op); |
|
89 TPtrC GetMailOptionsString( TImap4GetMailOptions aOpts ); |
|
90 |
|
91 void OutputPartsL(TBuf<5>& aStreams); |
|
92 void RemoveRichtextFormatting(TDes& aSourceLine); |
|
93 |
|
94 void DumpRecurseL(); |
|
95 |
|
96 private: |
|
97 // passed in on init |
|
98 COutputter* iPutter; |
|
99 |
|
100 // created in constructor |
|
101 CMsvServerEntry* iEntry; |
|
102 TMsvId iMsgId; |
|
103 |
|
104 // behaviour flags |
|
105 TInt iSummary; |
|
106 TInt iParts; |
|
107 TBool iRecurse; |
|
108 TBool iShowIds; |
|
109 MsgMatchFn iMatch; |
|
110 |
|
111 // context info |
|
112 TInt iDepth; // depth into the recursion |
|
113 |
|
114 // statistics info |
|
115 TInt iEntryCount; |
|
116 TInt iFileCount; |
|
117 |
|
118 public: |
|
119 enum |
|
120 { |
|
121 ENone = 0, |
|
122 EToScreen, |
|
123 EToOneFile, |
|
124 EToMultipleFiles |
|
125 }; |
|
126 |
|
127 }; |
|
128 |
|
129 //---------------------------------------------------------------------------------------- |