|
1 // Copyright (c) 2007-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 @internalTechnology |
|
19 @prototype |
|
20 */ |
|
21 |
|
22 #ifndef SYMBIAN_NETMCPRUPS_H |
|
23 #define SYMBIAN_NETMCPRUPS_H |
|
24 |
|
25 #define SYMBIAN_NETWORKING_UPS |
|
26 #ifdef SYMBIAN_NETWORKING_UPS |
|
27 |
|
28 #include "netmcpr.h" |
|
29 |
|
30 |
|
31 namespace NetUps |
|
32 { |
|
33 class CNetUps; |
|
34 } |
|
35 |
|
36 // |
|
37 |
|
38 NONSHARABLE_CLASS(CUpsNetworkMetaConnectionProvider) : public CNetworkMetaConnectionProvider |
|
39 /** |
|
40 CUpsNetworkMetaConnectionProvider |
|
41 |
|
42 UPS specific support in NetMCpr base class. |
|
43 */ |
|
44 { |
|
45 public: |
|
46 static CUpsNetworkMetaConnectionProvider* NewL(ESock::CMetaConnectionProviderFactoryBase& aFactory, |
|
47 const ESock::TProviderInfo& aProviderInfo); |
|
48 |
|
49 public: |
|
50 struct TUpsClientHandleRefCount |
|
51 { |
|
52 TUpsClientHandleRefCount(const Messages::TNodeId& aCommsId, TInt32 aCount) : iCommsId(aCommsId), iCount(aCount) {} |
|
53 |
|
54 Messages::TNodeId iCommsId; |
|
55 TInt32 iCount; |
|
56 }; |
|
57 |
|
58 public: |
|
59 |
|
60 // from CMetaConnectionProviderBase |
|
61 void ShowAccessPointRecordL(CommsDat::CMDBSession* aSession, CommsDat::CCDAccessPointRecord* aApRec); |
|
62 |
|
63 // @TODO PREQ1116 - revisit (see TUpsProcessProviderStatusChange) |
|
64 inline TBool ProviderStatusDown() const; |
|
65 inline void SetProviderStatusDown(TBool aStatus); |
|
66 |
|
67 inline TBool UpsDisabled() const; |
|
68 inline void SetUpsDisabled(TBool aUpsDisabled); |
|
69 |
|
70 inline const TDesC& ApName() const; // retrieve Access Point name |
|
71 inline void SetApNameL(const TDesC& aApName); // store Access Point name |
|
72 inline void FreeApName(); // free Access Point Name storage |
|
73 |
|
74 inline NetUps::CNetUps* NetUps(); |
|
75 inline void SetNetUps(NetUps::CNetUps* aNetUps); |
|
76 |
|
77 inline TBool UpsControlClientPresent(); |
|
78 inline void SetUpsControlClientPresent(); |
|
79 |
|
80 void CloseNetUps(); |
|
81 |
|
82 TBool FindUpsClientHandle(const Messages::TNodeId& aCommsId, TInt32& aIndex, TInt32& aCount); |
|
83 void IncrementUpsClientHandle(const Messages::TNodeId& aCommsId); |
|
84 void DecrementUpsClientHandle(const Messages::TNodeId& aCommsId, TBool& aAllHandlesDeleted); |
|
85 void AddUpsClientCommsIdL(const Messages::TNodeId& aCommsId); |
|
86 |
|
87 protected: |
|
88 CUpsNetworkMetaConnectionProvider(ESock::CMetaConnectionProviderFactoryBase& aFactory, |
|
89 const ESock::TProviderInfo& aProviderInfo, |
|
90 const MeshMachine::TNodeActivityMap& aActivityMap); |
|
91 void ConstructL(); |
|
92 |
|
93 virtual ~CUpsNetworkMetaConnectionProvider(); |
|
94 |
|
95 private: |
|
96 RBuf iApName; // Access Point record name |
|
97 NetUps::CNetUps* iNetUps; |
|
98 TInt iNetUpsRefCount; |
|
99 TUint iProviderStatusDown:1; // Set if TProviderStatusChange "down" has been received |
|
100 // @TODO PREQ1116 - hack - revisit (see TUpsProcessProviderStatusChange) |
|
101 TUint iUpsDisabled:1; // Set if UPS has been disabled ("short circuited") |
|
102 TUint iUpsControlClientPresent:1; // Indicates that the there are multiple UPS clients associated with this Node. |
|
103 |
|
104 RPointerArray<TUpsClientHandleRefCount> iUpsClientHandleRefCount; |
|
105 }; |
|
106 |
|
107 #include "netmcprups.inl" |
|
108 |
|
109 #endif //SYMBIAN_NETWORKING_UPS |
|
110 |
|
111 #endif //SYMBIAN_NETMCPRUPS_H |