|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Header declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef SEN_CONTEXT_H |
|
26 #define SEN_CONTEXT_H |
|
27 |
|
28 |
|
29 // INCLUDES |
|
30 #include <e32base.h> |
|
31 #include <e32std.h> |
|
32 #include "msencontext.h" |
|
33 #include "senpointermap.h" |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class CSenContextItem; |
|
37 class CSenXmlReader; |
|
38 |
|
39 |
|
40 |
|
41 // TYPE DEFS |
|
42 typedef RSenPointerMap<TDesC8, CSenContextItem> RCtxItemMap; // pointer map is internal: Utils\inc |
|
43 |
|
44 // CLASS DECLARATION |
|
45 /** |
|
46 * This class is ment for INTERNAL use only, never to be |
|
47 * published "as it is". The reason for not to inherit from MSenContext |
|
48 * is here: this allows one to utilize this base class in *children* |
|
49 * of MSenContext, which get ready base for *basic* context implementation |
|
50 * and thus only need to write new methods they define in their own |
|
51 * interface (if it is all that is needed). |
|
52 */ |
|
53 class CSenContext : public CBase //, public MSenContext |
|
54 { |
|
55 public: |
|
56 /** |
|
57 * Standard 2-phased constructor |
|
58 * @param aDirection indicate the initial direction of this message context. |
|
59 * For requests, it is "outbound", and for responses or one way notifications |
|
60 * from some (remote) service) it is "inbound". |
|
61 * @param aXmlReader is a reference to XML parser (not owned) |
|
62 * @return pointer to new context |
|
63 */ |
|
64 IMPORT_C static CSenContext* NewL(SenContext::TContextDirection aDirection); |
|
65 /** |
|
66 * Standard 2-phased constructor |
|
67 * @param aDirection indicate the initial direction of this message context. |
|
68 * For requests, it is "outbound", and for responses or one way notifications |
|
69 * from some (remote) service) it is "inbound". |
|
70 * @return pointer to new context, which is left on cleanup stack. |
|
71 */ |
|
72 IMPORT_C static CSenContext* NewLC(SenContext::TContextDirection aDirection); |
|
73 |
|
74 // Destructor: |
|
75 IMPORT_C virtual ~CSenContext(); |
|
76 |
|
77 // Defined in MSenContext (must remain equal): |
|
78 virtual SenContext::TContextType Type() const; |
|
79 virtual SenContext::TContextDirection Direction() const; |
|
80 virtual TInt Add(const TDesC8& aKey, const TDesC8& aValue); |
|
81 virtual TInt Update(const TDesC8& aKey, const TDesC8& aValue); |
|
82 virtual const TDesC8* GetDesC8L(const TDesC8& aKey); |
|
83 virtual TInt Add(const TDesC8& aKey, TInt aValue); |
|
84 virtual TInt Update(const TDesC8& aKey, TInt aValue); |
|
85 virtual const TInt* GetIntL(const TDesC8& aKey); |
|
86 virtual TInt Add(const TDesC8& aKey, CSenElement* aValue); |
|
87 virtual TInt Update(const TDesC8& aKey, CSenElement* aValue); |
|
88 virtual const CSenElement* GetSenElementL(const TDesC8& aKey); |
|
89 virtual TInt Add(const TDesC8& aKey, TAny* aValue); |
|
90 virtual TInt Update(const TDesC8& aKey, TAny* aValue); |
|
91 virtual TAny* GetAnyL(const TDesC8& aKey); //codescannerwarnings |
|
92 virtual const CSenXmlReader* GetParser(); |
|
93 virtual TInt Remove(const TDesC8& aKey); |
|
94 virtual TInt Count() const; |
|
95 virtual TPtrC8 KeyAtL(TInt aIndex); |
|
96 virtual void Reset(); |
|
97 |
|
98 virtual TInt SetDirection(SenContext::TContextDirection aDirection); |
|
99 |
|
100 |
|
101 |
|
102 protected: |
|
103 IMPORT_C CSenContext(SenContext::TContextDirection aDirection); |
|
104 IMPORT_C void BaseConstructL(); |
|
105 |
|
106 // Data: |
|
107 RCtxItemMap iItems; // owned |
|
108 |
|
109 private: |
|
110 // Data: |
|
111 SenContext::TContextDirection iDirection; |
|
112 |
|
113 }; |
|
114 |
|
115 #endif // SEN_CONTEXT_H |
|
116 |
|
117 // End of File |