|
1 /* |
|
2 * Copyright (c) 2005 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: Client's Results command buffering |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __NSMLRESULTSCONTAINER_H |
|
21 #define __NSMLRESULTSCONTAINER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "smldtd.h" |
|
26 |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CNSmlCmdsBase; |
|
30 class CNSmlFutureReservation; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 class CNSmlResultsContainer : public CBase |
|
34 { |
|
35 // |
|
36 public: // constructor and destructor |
|
37 static CNSmlResultsContainer* NewL( CNSmlCmdsBase* aSyncMLCmds = NULL ); |
|
38 ~CNSmlResultsContainer(); //from CBase |
|
39 public: // new functions |
|
40 // Creates new Results element |
|
41 IMPORT_C TInt CreateNewResultsL( const TDesC8& aMsgRef, const TDesC8& aCmdRef, const SmlTarget_t* aTargetRef, const SmlSource_t* aSourceRef ); |
|
42 // Set CmdID to Results element |
|
43 IMPORT_C void SetCmdIDL( TInt aEntryID, const SmlPcdata_t* aCmdID ); |
|
44 // Add Item element |
|
45 IMPORT_C void AddItemL( TInt aEntryID, const CBufBase& aObject, const TDesC8& aType, const TDesC8& aFormat ); |
|
46 // Set Id of Status ( in CNSmlStatusContainer instance ) |
|
47 IMPORT_C void SetStatusID( TInt aEntryID, TInt aStatusEntryID ); |
|
48 // |
|
49 IMPORT_C void RemoveWritten (TInt aEntryID ); |
|
50 |
|
51 IMPORT_C void Begin(); |
|
52 IMPORT_C TBool NextResultsElement( SmlResults_t*& aResults ); |
|
53 // Get ID of the current element |
|
54 IMPORT_C TInt CurrentEntryID() const; |
|
55 // Any results in container |
|
56 IMPORT_C TBool AnyResults() const; |
|
57 // Get Id of Status ( in CNSmlStatusContainer instance ) |
|
58 IMPORT_C TInt StatusID( TInt aEntryID ) const; |
|
59 // |
|
60 // |
|
61 |
|
62 private: |
|
63 void ConstructL( CNSmlCmdsBase* aSyncMLCmds ); |
|
64 CNSmlResultsContainer(); |
|
65 CNSmlResultsContainer( const CNSmlResultsContainer& aOther ); |
|
66 CNSmlResultsContainer& operator=( const CNSmlResultsContainer& aOther ); |
|
67 |
|
68 void CopyPcdataL( const SmlPcdata_t* aFromPcdata, SmlPcdata_t*& aToPcdata ) const; |
|
69 void RemoveAllWrittenOnes(); |
|
70 void FreeResources( TInt aI ); |
|
71 // Private variables |
|
72 |
|
73 private: //Data |
|
74 struct TResultsData |
|
75 { |
|
76 HBufC8* iMsgRef; |
|
77 HBufC8* iCmdRef; |
|
78 SmlResults_t* iResults; |
|
79 TBool iWasWritten; |
|
80 TInt iStatusRef; |
|
81 }; |
|
82 TInt iArrayInd; |
|
83 CArrayFixFlat<TResultsData>* iResultsArray; |
|
84 //used classes |
|
85 CNSmlCmdsBase* iSyncMLCmds; |
|
86 // Reserved to maintain binary compability |
|
87 CNSmlFutureReservation* iReserved; |
|
88 }; |
|
89 |
|
90 #endif // __NSMLRESULTSCONTAINER_H |