|
1 // Copyright (c) 2003-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 // Base classes for agents that require commdb access. |
|
15 // This file contains the APIs required to implement an agent for Symbian OS that accesses commdb. |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @publishedPartner |
|
22 @deprecated since v9.5. Use MCPRs/CPRs/SCPRs instead of agents. |
|
23 */ |
|
24 |
|
25 #if !defined(__CAGENTBASE_H__) |
|
26 #define __CAGENTBASE_H__ |
|
27 |
|
28 #include <comms-infras/nifagt.h> |
|
29 #include <comms-infras/dbaccess.h> |
|
30 #include <comms-infras/dialogprocessor.h> |
|
31 #include <comms-infras/cnetworkcontrollerbase.h> |
|
32 |
|
33 class CAgentDialogProcessor; |
|
34 |
|
35 /** |
|
36 * Base class for agents that access commdb and use overrides |
|
37 * |
|
38 * @publishedPartner |
|
39 * @deprecated since v9.5. Use MCPRs/CPRs/SCPRs instead of agents. |
|
40 */ |
|
41 class CAgentBase : public CNifAgentBase, public MServiceChangeObserver, public MDialogProcessorObserver, public MNetworkControllerObserver |
|
42 { |
|
43 friend class CAgentDialogProcessor; |
|
44 |
|
45 public: |
|
46 IMPORT_C virtual ~CAgentBase(); |
|
47 protected: |
|
48 IMPORT_C void ConstructL(); |
|
49 IMPORT_C CAgentBase(); |
|
50 public: |
|
51 |
|
52 // implementation of the CNifAgentBase interface |
|
53 IMPORT_C virtual void Reconnect(); |
|
54 IMPORT_C virtual void CancelReconnect(); |
|
55 IMPORT_C virtual void Authenticate(TDes& aUsername, TDes& aPassword); |
|
56 IMPORT_C virtual void CancelAuthenticate(); |
|
57 IMPORT_C virtual void RequestNotificationOfServiceChangeL(MAgentSessionNotify* aSession); |
|
58 IMPORT_C virtual void CancelRequestNotificationOfServiceChange(MAgentSessionNotify* aSession); |
|
59 IMPORT_C virtual void SetConnectionSettingsL(const TConnectionSettings& aSettings); |
|
60 IMPORT_C virtual TConnectionSettings& ConnectionSettingsL(); |
|
61 IMPORT_C virtual void SetOverridesL(CStoreableOverrideSettings* aOverrideSettings); |
|
62 IMPORT_C virtual CStoreableOverrideSettings* OverridesL(); |
|
63 IMPORT_C virtual TBool IsActive() const; |
|
64 |
|
65 // implementation of the MDialogProcessorObserver interface |
|
66 IMPORT_C virtual void MDPOAuthenticateComplete(TInt aError); |
|
67 |
|
68 // implementation of the MServiceChangeObserver interface |
|
69 IMPORT_C virtual void ServiceChangeNotification(TUint32 aId, const TDesC& aType); |
|
70 |
|
71 // implementation of the MNetworkControllerObserver interface |
|
72 IMPORT_C virtual void SelectComplete(const TDesC& aName); |
|
73 IMPORT_C virtual void SelectComplete(TInt aError); |
|
74 IMPORT_C virtual void ReconnectComplete(TInt aError); |
|
75 |
|
76 |
|
77 protected: |
|
78 IMPORT_C virtual TInt DoReadInt(const TDesC& aField, TUint32& aValue,const RMessagePtr2* aMessage); |
|
79 IMPORT_C virtual TInt DoWriteInt(const TDesC& aField, TUint32 aValue,const RMessagePtr2* aMessage); |
|
80 IMPORT_C virtual TInt DoReadDes(const TDesC& aField, TDes8& aValue,const RMessagePtr2* aMessage); |
|
81 IMPORT_C virtual TInt DoWriteDes(const TDesC& aField, const TDesC8& aValue,const RMessagePtr2* aMessage); |
|
82 IMPORT_C virtual TInt DoReadDes(const TDesC& aField, TDes16& aValue,const RMessagePtr2* aMessage); |
|
83 IMPORT_C virtual TInt DoWriteDes(const TDesC& aField, const TDesC16& aValue,const RMessagePtr2* aMessage); |
|
84 IMPORT_C virtual TInt DoReadBool(const TDesC& aField, TBool& aValue,const RMessagePtr2* aMessage); |
|
85 IMPORT_C virtual TInt DoWriteBool(const TDesC& aField, TBool aValue,const RMessagePtr2* aMessage); |
|
86 IMPORT_C virtual HBufC* DoReadLongDesLC(const TDesC& aField,const RMessagePtr2* aMessage); |
|
87 |
|
88 IMPORT_C virtual TInt DoCheckReadCapability( const TDesC& aField, const RMessagePtr2* aMessage ); |
|
89 IMPORT_C virtual TInt DoCheckWriteCapability( const TDesC& aField, const RMessagePtr2* aMessage ); |
|
90 |
|
91 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
92 public: |
|
93 IMPORT_C virtual TUint32 GetBearerInfo() const; |
|
94 #endif //SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
95 |
|
96 |
|
97 |
|
98 private: |
|
99 static TInt AuthenticateCb(TAny* aThisPtr); |
|
100 inline CDialogProcessor* DialogProcessor() { return iDlgPrc; }; |
|
101 |
|
102 protected: |
|
103 CCommsDbAccess* iDatabase; //< for commdb access |
|
104 CDialogProcessor* iDlgPrc; //< pointer to the dialog processor for prompting the user |
|
105 CStoreableOverrideSettings* iOverrides; //< application specified overrides for the settings in commdb (either these or TConnectionPreferences should be set, I think depending on which API the client is using (RConnection/RGenericAgent)??) |
|
106 RPointerArray<MAgentSessionNotify> iServiceChangeNotification; //< pointers to CNifSessions for notification of service change |
|
107 CAsyncCallBack* iAuthenticateCallback; //< [*** to do ***] |
|
108 TInt iAuthenticateError; //< the error code, if any, generated during authentication |
|
109 TConnectionSettings iSettings; //< the settings for this connection |
|
110 }; |
|
111 |
|
112 #endif |
|
113 |