|
1 // Copyright (c) 2001-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 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalAll |
|
19 */ |
|
20 |
|
21 #ifndef __GPRSCONTEXT_H |
|
22 #define __GPRSCONTEXT_H |
|
23 |
|
24 #include "gprs.h" |
|
25 |
|
26 class CATGprsContextActivate; |
|
27 class CATGprsContextDeactivate; |
|
28 class CATGprsContextDelete; |
|
29 class CATGPRSSetConfig; |
|
30 class CATGPRSGetConfig; |
|
31 class CATIO; |
|
32 class CATInit; |
|
33 class CPhoneGlobals; |
|
34 |
|
35 |
|
36 class CGprsQoS; |
|
37 class CGprsQoSEntry; |
|
38 class CGprsContext :public CSubSessionExtBase |
|
39 /** |
|
40 This class implements the RPacketContext API. |
|
41 CGprsContext inherits from CSubSessionExtBase. It is intended for CGprs usage. |
|
42 @internalComponent |
|
43 */ |
|
44 { |
|
45 public: |
|
46 static CGprsContext* NewL(CGprs* aParent, CATIO* aIo, CATInit* aInit, CPhoneGlobals* aPhoneGlobals, const TName& aName, TInt aCid, RPacketContext::TContextConfigGPRS* aContextConfigGPRS); |
|
47 |
|
48 virtual TInt ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,const TDataPackage& aPackage); |
|
49 virtual TReqMode ReqModeL(const TInt aIpc); |
|
50 virtual CTelObject* OpenNewObjectByNameL(const TDesC& aName); |
|
51 virtual CTelObject* OpenNewObjectL(TDes& aNewName); |
|
52 virtual TInt CancelService(const TInt aIpc, const TTsyReqHandle aTsyReqHandle); |
|
53 virtual void Init(); |
|
54 virtual TInt RegisterNotification(const TInt aIpc); |
|
55 virtual TInt DeregisterNotification(const TInt aIpc); |
|
56 virtual TInt NumberOfSlotsL(const TInt aIpc); |
|
57 |
|
58 void ContextInfo(RPacketService::TContextInfo* aInfo); |
|
59 RPacketService::TContextInfo* ContextInfo(); |
|
60 void SetContextInfo(const RPacketService::TContextInfo* aContextInfo); |
|
61 TDes* ContextName(); |
|
62 RPacketContext::TContextConfigGPRS* Config(); |
|
63 void SetConfig(const RPacketContext::TContextConfigGPRS* aContextInfo); |
|
64 TInt Cid(); |
|
65 CGprs* Parent(); |
|
66 |
|
67 void GenerateNewProfileName(TDes& aName); |
|
68 void RemoveQoSProfileIfFound(CGprsQoS* aProfile); |
|
69 protected: |
|
70 void ConstructL(const TName& aName, RPacketContext::TContextConfigGPRS* aContextConfigGPRS); |
|
71 CGprsContext(CGprs* aParent, CATIO* iIo, CATInit* iInit, CPhoneGlobals* iPhoneGlobals, TInt aCid); |
|
72 virtual ~CGprsContext(); |
|
73 |
|
74 private: |
|
75 TInt SetConfig(const TTsyReqHandle aTsyReqHandle,const TDesC8* aConfig); |
|
76 TInt SetConfigCancel(const TTsyReqHandle aTsyReqHandle); |
|
77 TInt GetConfig(const TTsyReqHandle aTsyReqHandle,TDes8* aConfig); |
|
78 TInt GetConfigCancel(const TTsyReqHandle aTsyReqHandle); |
|
79 TInt NotifyConfigChanged(const TTsyReqHandle aTsyReqHandle, TDes8* aConfig); |
|
80 TInt NotifyConfigChangedCancel(const TTsyReqHandle aTsyReqHandle); |
|
81 TInt Activate(const TTsyReqHandle aTsyReqHandle); |
|
82 TInt ActivateCancel(const TTsyReqHandle aTsyReqHandle); |
|
83 TInt Deactivate(const TTsyReqHandle aTsyReqHandle); |
|
84 TInt DeactivateCancel(const TTsyReqHandle aTsyReqHandle); |
|
85 TInt Delete(const TTsyReqHandle aTsyReqHandle); |
|
86 TInt DeleteCancel(const TTsyReqHandle aTsyReqHandle); |
|
87 TInt LoanCommPort(const TTsyReqHandle aTsyReqHandle,RCall::TCommPort* aDataPort); |
|
88 TInt LoanCommPortCancel(const TTsyReqHandle aTsyReqHandle); |
|
89 TInt RecoverCommPort(const TTsyReqHandle aTsyReqHandle); |
|
90 TInt RecoverCommPortCancel(const TTsyReqHandle aTsyReqHandle); |
|
91 TInt GetStatus(const TTsyReqHandle aTsyReqHandle,RPacketContext::TContextStatus* aContextStatus); |
|
92 TInt NotifyStatusChange(const TTsyReqHandle aTsyReqHandle,RPacketContext::TContextStatus* aContextStatus); |
|
93 TInt NotifyStatusChangeCancel(const TTsyReqHandle aTsyReqHandle); |
|
94 TInt GetDataVolumeTransferred(const TTsyReqHandle aTsyReqHandle,RPacketContext::TDataVolume* aVolume); |
|
95 TInt NotifyDataTransferred(const TTsyReqHandle aTsyReqHandle, RPacketContext::TDataVolume* aVolume, RPacketContext::TNotifyDataTransferredRequest* aData); |
|
96 TInt NotifyDataTransferredCancel(const TTsyReqHandle aTsyReqHandle); |
|
97 TInt GetLastErrorCause(const TTsyReqHandle aTsyReqHandle,TInt* aError); |
|
98 |
|
99 private: |
|
100 TBool ShouldNotProcessIpcCall(TInt aIpc); |
|
101 TBool ShouldNotProcessIpcCallWhenComportIsLoaned(TInt aIpc); |
|
102 private: |
|
103 TDblQue<CGprsQoSEntry> iProfiles; //< List of profiles |
|
104 TInt iGprsQoSProfileCount; // |
|
105 RPacketService::TContextInfo iInfo; //< Internal state. Context information. |
|
106 RPacketContext::TContextConfigGPRS iConfigGPRS; //< Internal state. Context configuration. |
|
107 TInt iCid; //< Internal state. Context number. |
|
108 CATGprsContextActivate* iATGprsContextActivate; //< Pointer to context activation AT command object. |
|
109 CATGprsContextDeactivate* iATGprsContextDeactivate; //< Pointer to context deactivation AT command object. |
|
110 CATGprsContextDelete* iATGprsContextDelete; //< Pointer to context deletion AT command object. |
|
111 CATGPRSSetConfig* iATGPRSSetConfig; //< Pointer to context configuration AT command object. |
|
112 CATGPRSGetConfig* iATGPRSGetConfig; //< Pointer to context configuration AT command object. |
|
113 CGprs* iParent; //< Pointer to context parent. |
|
114 CATIO* iIo; //< Pointer to communication object. |
|
115 CATInit* iInit; //< Pointer to AT phone init. |
|
116 CPhoneGlobals* iPhoneGlobals; //< Pointer to global wide phone states. |
|
117 }; |
|
118 |
|
119 |
|
120 |
|
121 class CGprsQoS; |
|
122 class CGprsQoSEntry : public CBase |
|
123 /** |
|
124 This class contains a CGprsQoS pointer. It is intended to |
|
125 be part of CGprsContext's linked list of qos profiles |
|
126 CGprsQoSEntry inherits from CBase. This class is only intended to be part of the TDblQue list |
|
127 that CGprsContext has. |
|
128 @internalComponent |
|
129 */ |
|
130 { |
|
131 friend class CGprsContext; |
|
132 public: |
|
133 CGprsQoSEntry(CGprsQoS* aProfile); |
|
134 ~CGprsQoSEntry(); |
|
135 void Deque(); |
|
136 public: |
|
137 CGprsQoS* iProfile; //< Pointer to a qos profile |
|
138 private: |
|
139 TDblQueLink iLink; //< Link object. |
|
140 }; |
|
141 |
|
142 #endif |