|
1 // Copyright (c) 2005-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 // Reference SubConnection Provider class definition. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 #if !defined(__REFERENCESCPR_SUBCONNPROV_H__) |
|
24 #define __REFERENCESCPR_SUBCONNPROV_H__ |
|
25 |
|
26 |
|
27 #include <comms-infras/ss_subconnprov.h> |
|
28 #include <comms-infras/commsdebugutility.h> |
|
29 |
|
30 |
|
31 #ifdef __FLOG_ACTIVE |
|
32 // CommsDebugUtility logging tags. Use them to enable tracing for ReferenceSCPR |
|
33 _LIT8(KReferenceLogTag1,"SubConnProvd"); |
|
34 _LIT8(KReferenceLogTag2,"Reference"); |
|
35 #endif |
|
36 |
|
37 |
|
38 |
|
39 class CReferenceSubConnectionProvider : public CSubConnectionProviderBase, public MConnectionDataClient |
|
40 /** |
|
41 CReferenceSubConnectionProvider is a reference implementation for a reserved subconnection, |
|
42 that is: a subconnection explicitly requested by a client openning an RSubConnection |
|
43 in ECreateNew mode. Typically reserved and shared subconnection providers, although represent the |
|
44 same layer/technology, require different implementations of CSubConnectionProviderBase. |
|
45 This example code takes that into account and provides two separate classes for reserved and |
|
46 shared subconnections respectivelly. Should the implementation differ little or not differ at all, |
|
47 developers are encouraged to introduce inheritance between the two types or implement just one |
|
48 universal CSubConnectionProviderBase subclass, if sensible. |
|
49 The following should be read like a class diagram for a CSubConnectionProviderBase: |
|
50 =================================================================================== |
|
51 |
|
52 [MSubConnectionControlClient] |
|
53 LAYER N-1 ^ |
|
54 | |
|
55 [MSubConnectionDataClient]<-n- n [MSubConnectionDataClient]<-n- |
|
56 | | /\ | |
|
57 LAYER N 1 1 is a 1 |
|
58 | | || | |
|
59 [ServiceAccessPoint]<-n--1-[CSubConnectionProviderBase]-1-----n->[CConnectionProviderBase] |
|
60 | |
|
61 n |
|
62 | |
|
63 1 |
|
64 LAYER N+1 v |
|
65 [CSubConnectionProviderBase] |
|
66 ==================================================================================== |
|
67 @internalComponent |
|
68 @released since v9.2 |
|
69 */ |
|
70 { |
|
71 public: |
|
72 |
|
73 //-========================================================= |
|
74 // MConnectionDataClient methods |
|
75 //-========================================================= |
|
76 virtual void Notify(TNotify aNotifyType, CConnectionProviderBase* aConnProvider, TInt aError, const CConNotificationEvent* aConNotificationEvent); |
|
77 virtual void AttachToNext(CSubConnectionProviderBase* aSubConnProvider); |
|
78 virtual void ConnectionGoingDown(CConnectionProviderBase& aConnProvider); |
|
79 virtual void ConnectionError(TInt aStage, TInt aError); |
|
80 |
|
81 |
|
82 |
|
83 //-========================================================= |
|
84 // CSubConnectionProviderBase methods |
|
85 //-========================================================= |
|
86 virtual void DoDataClientJoiningL(MSubConnectionDataClient& aDataClient); |
|
87 virtual void DoDataClientLeaving(MSubConnectionDataClient& aDataClient); |
|
88 virtual void DoControlClientJoiningL(MSubConnectionControlClient& aControlClient); |
|
89 virtual void DoControlClientLeaving(MSubConnectionControlClient& aControlClient); |
|
90 virtual void DoSourceAddressUpdate(MSubConnectionDataClient& aDataClient, const TSockAddr& aSource); |
|
91 virtual void DoDestinationAddressUpdate(MSubConnectionDataClient& aDataClient, const TSockAddr& aDestination); |
|
92 virtual void DoDataClientRouted(MSubConnectionDataClient& aDataClient, const TSockAddr& aSource, const TSockAddr& aDestination, const TDesC8& aConnectionInfo); |
|
93 virtual void DoParametersAboutToBeSetL(CSubConParameterBundle& aParameterBundle); |
|
94 virtual TInt DoControl(TUint aOptionLevel, TUint aOptionName, TDes8& aOption); |
|
95 virtual CConnDataTransfer& DoDataTransferL(); |
|
96 virtual MConnectionDataClient* DoSelfConnectionDataClient(); |
|
97 virtual void DoStartL(); |
|
98 virtual void DoStop(); |
|
99 virtual CSubConnectionProviderBase* DoNextLayer(); |
|
100 |
|
101 |
|
102 protected: |
|
103 |
|
104 //-========================================================= |
|
105 // Custom methods |
|
106 //-========================================================= |
|
107 friend class CReferenceSubConnectionProviderFactory; |
|
108 |
|
109 CReferenceSubConnectionProvider(CSubConnectionProviderFactoryBase& aFactory, |
|
110 CConnectionProviderBase& aConnProvider); |
|
111 static CReferenceSubConnectionProvider* NewL(CSubConnectionProviderFactoryBase& aFactory, |
|
112 CConnectionProviderBase& aConnProvider); |
|
113 void ConstructL(); |
|
114 virtual ~CReferenceSubConnectionProvider(); |
|
115 |
|
116 public: |
|
117 __FLOG_DECLARATION_MEMBER; |
|
118 |
|
119 }; |
|
120 |
|
121 #endif // __REFERENCESCPR_SUBCONNPROV_H__ |