|
1 // Copyright (c) 2006-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 the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Definition of Subsession base object |
|
15 // |
|
16 // |
|
17 |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @internalTechnology |
|
23 */ |
|
24 |
|
25 #ifndef __LBSSUBSESSIONBASE_H__ |
|
26 #define __LBSSUBSESSIONBASE_H__ |
|
27 |
|
28 #include <e32base.h> |
|
29 |
|
30 // forward classes |
|
31 class CSecureServerBase; |
|
32 |
|
33 /** |
|
34 @internalTechnology |
|
35 @released |
|
36 |
|
37 Interface for release resource |
|
38 */ |
|
39 class MRelease |
|
40 { |
|
41 public: |
|
42 virtual void VirtualRelease() = 0; // THIS MUST delete any implementation! |
|
43 }; |
|
44 |
|
45 /** |
|
46 @internalTechnology |
|
47 |
|
48 MRelease interface function pointer |
|
49 */ |
|
50 typedef void (MRelease::* TReleaseFunc)(); |
|
51 |
|
52 |
|
53 /** |
|
54 @internalTechnology |
|
55 @released |
|
56 |
|
57 static class for push the resource needed to be released to stack |
|
58 */ |
|
59 class CleanupVirtualRelease |
|
60 { |
|
61 public: |
|
62 inline static void PushL(MRelease& aRef); |
|
63 private: |
|
64 static void Release(TAny *aPtr); |
|
65 }; |
|
66 |
|
67 void CleanupVirtualReleasePushL(MRelease& aRef); |
|
68 |
|
69 |
|
70 /** |
|
71 @internalTechnology |
|
72 @released |
|
73 @see MRelease |
|
74 |
|
75 /** |
|
76 @internalTechnology |
|
77 @released |
|
78 @see MRelease |
|
79 |
|
80 MRelease based Interface, interface for subsession |
|
81 */ |
|
82 class MSubSessionImpl : public MRelease |
|
83 { |
|
84 public: |
|
85 virtual void DispatchL(const RMessage2& aMessage) = 0; |
|
86 virtual void DispatchError(const RMessage2& aMessage, TInt aError) = 0; |
|
87 virtual void CreateSubSessionL(const RMessage2& aMessage, const CSecureServerBase* aServer) = 0; |
|
88 virtual void CloseSubSession() = 0; |
|
89 }; |
|
90 |
|
91 /** |
|
92 @internalTechnology |
|
93 @released |
|
94 @see MSubSessionImpl |
|
95 |
|
96 Subsession base object |
|
97 */ |
|
98 class CSubSessionBase : public CObject |
|
99 { |
|
100 public: |
|
101 /** Panic type for subsession objects */ |
|
102 enum TSubSessionBasePanic |
|
103 { |
|
104 EDispatchLNotOverriden = 1, |
|
105 EDispatchErrorNotOverriden = 2, |
|
106 ECreateSubSessionLNotOverriden = 3, |
|
107 ECloseSubSessionNotOverriden = 4 |
|
108 }; |
|
109 public: |
|
110 CSubSessionBase(); |
|
111 virtual ~CSubSessionBase(); |
|
112 MSubSessionImpl* GetImplL(const RMessage2& aMessage); |
|
113 void SetImpl(MSubSessionImpl* aImpl); |
|
114 MSubSessionImpl* Impl(); |
|
115 protected: |
|
116 void Panic(const TSubSessionBasePanic aPanic); |
|
117 protected: |
|
118 // property - later derived class may wish to acess so protected, not private |
|
119 /** Generic interface pointer to subsession implemetations */ |
|
120 MSubSessionImpl* iImpl; |
|
121 }; |
|
122 |
|
123 |
|
124 #endif // __LBSSUBSESSIONBASE_H__ |