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