|
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 // SIPSCPR_subconparams.cpp |
|
15 // SIP extension parameters definition |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @publishedAll |
|
22 */ |
|
23 |
|
24 #include <ecom/ecom.h> |
|
25 #include <comms-infras/metatypearray.h> |
|
26 #include <comms-infras/metatypevariablelen.h> |
|
27 //#include <ecom/implementationproxy.h> |
|
28 #include <comms-infras/metabuffer.h> |
|
29 #include <cs_subconevents.h> |
|
30 |
|
31 #include "SIP_subconparams.h" |
|
32 #include "SIP_subconevents.h" |
|
33 |
|
34 //-========================================================= |
|
35 // Data/functions required for instantiating ECOM Plugin |
|
36 //-========================================================= |
|
37 /* const TImplementationProxy ImplementationTable[] = |
|
38 { |
|
39 IMPLEMENTATION_PROXY_ENTRY(KSubConSIPParametersUid, CSIPSubConnExtensionParamsFactory::NewL), |
|
40 IMPLEMENTATION_PROXY_ENTRY(KSubConSIPEventsUid, CSIPSubConnExtensionEventsFactory::NewL) |
|
41 }; |
|
42 |
|
43 |
|
44 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) |
|
45 { |
|
46 aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); |
|
47 |
|
48 return ImplementationTable; |
|
49 } |
|
50 */ |
|
51 |
|
52 //-========================================================= |
|
53 // SIP Extension Events & Paramemeters follow |
|
54 //-========================================================= |
|
55 |
|
56 START_ATTRIBUTE_TABLE( CSubConSIPResponseEvent, KSubConSIPEventsUid, KSubConSIPResponseEventType ) |
|
57 REGISTER_ATTRIBUTE( CSubConSIPResponseEvent, iResponse, TMetaNumber) |
|
58 END_ATTRIBUTE_TABLE() |
|
59 |
|
60 START_ATTRIBUTE_TABLE( CSubConSIPAuthenticationRequiredEvent, KSubConSIPEventsUid, KSubConSIPAuthenticationRequiredEventType ) |
|
61 REGISTER_ATTRIBUTE( CSubConSIPAuthenticationRequiredEvent, iRealm, TMetaBuf8) |
|
62 END_ATTRIBUTE_TABLE() |
|
63 |
|
64 START_ATTRIBUTE_TABLE( CSubConSIPNotificationEvent, KSubConSIPEventsUid, KSubConSIPNotificationEventType ) |
|
65 REGISTER_ATTRIBUTE( CSubConSIPNotificationEvent, iNotification, TMetaBuf8) |
|
66 END_ATTRIBUTE_TABLE() |
|
67 |
|
68 START_ATTRIBUTE_TABLE( CSubConSIPInviteParamSet, KSubConSIPParametersUid, KSubConSIPInviteParamsType ) |
|
69 REGISTER_ATTRIBUTE( CSubConSIPInviteParamSet, iReqUri, TMetaBuf8 ) |
|
70 REGISTER_ATTRIBUTE( CSubConSIPInviteParamSet, iFrom, TMetaBuf8 ) |
|
71 REGISTER_ATTRIBUTE( CSubConSIPInviteParamSet, iTo, TMetaBuf8 ) |
|
72 REGISTER_ATTRIBUTE( CSubConSIPInviteParamSet, iContact, TMetaBuf8 ) |
|
73 REGISTER_ATTRIBUTE( CSubConSIPInviteParamSet, iContentType, TMetaBuf8 ) |
|
74 REGISTER_ATTRIBUTE( CSubConSIPInviteParamSet, iContentSubType, TMetaBuf8 ) |
|
75 REGISTER_ATTRIBUTE( CSubConSIPInviteParamSet, iContent, TMetaBuf8 ) |
|
76 END_ATTRIBUTE_TABLE() |
|
77 |
|
78 START_ATTRIBUTE_TABLE( CSubConSIPSubscribeParamSet, KSubConSIPParametersUid, KSubConSIPSubscribeParamsType ) |
|
79 REGISTER_ATTRIBUTE( CSubConSIPSubscribeParamSet, iReqUri, TMetaBuf8 ) |
|
80 REGISTER_ATTRIBUTE( CSubConSIPSubscribeParamSet, iFrom, TMetaBuf8 ) |
|
81 REGISTER_ATTRIBUTE( CSubConSIPSubscribeParamSet, iTo, TMetaBuf8 ) |
|
82 REGISTER_ATTRIBUTE( CSubConSIPSubscribeParamSet, iContact, TMetaBuf8 ) |
|
83 REGISTER_ATTRIBUTE( CSubConSIPSubscribeParamSet, iEventType, TMetaBuf8 ) |
|
84 REGISTER_ATTRIBUTE( CSubConSIPSubscribeParamSet, iAcceptType, TMetaBuf8 ) |
|
85 REGISTER_ATTRIBUTE( CSubConSIPSubscribeParamSet, iAcceptSubType, TMetaBuf8 ) |
|
86 REGISTER_ATTRIBUTE( CSubConSIPSubscribeParamSet, iExpires, TMeta<TInt> ) |
|
87 REGISTER_ATTRIBUTE( CSubConSIPSubscribeParamSet, iAutoRefresh, TMeta<TBool> ) |
|
88 END_ATTRIBUTE_TABLE() |
|
89 |
|
90 START_ATTRIBUTE_TABLE( CSubConSIPAuthenticateParamSet, KSubConSIPParametersUid, KSubConSIPAuthenticateParamsType ) |
|
91 REGISTER_ATTRIBUTE( CSubConSIPAuthenticateParamSet, iUserName, TMetaBuf8 ) |
|
92 REGISTER_ATTRIBUTE( CSubConSIPAuthenticateParamSet, iPassword, TMetaBuf8 ) |
|
93 REGISTER_ATTRIBUTE( CSubConSIPAuthenticateParamSet, iRealm, TMetaBuf8 ) |
|
94 END_ATTRIBUTE_TABLE() |
|
95 |
|
96 |
|
97 CSubConExtensionParameterSet* CSIPSubConnExtensionParamsFactory::NewL(TAny* aConstructionParameters) |
|
98 { |
|
99 TInt32 type = reinterpret_cast<TInt32>(aConstructionParameters); |
|
100 switch (type) |
|
101 { |
|
102 case KSubConSIPInviteParamsType: |
|
103 return new (ELeave) CSubConSIPInviteParamSet; |
|
104 case KSubConSIPSubscribeParamsType: |
|
105 return new (ELeave) CSubConSIPSubscribeParamSet; |
|
106 case KSubConSIPAuthenticateParamsType: |
|
107 return new (ELeave) CSubConSIPAuthenticateParamSet; |
|
108 default: |
|
109 User::Leave(KErrNotFound); |
|
110 } |
|
111 return NULL; |
|
112 } |
|
113 |
|
114 CSubConSIPInviteParamSet::~CSubConSIPInviteParamSet() |
|
115 { |
|
116 // Cleanup the Memory associated with it |
|
117 iReqUri.Close(); |
|
118 iFrom.Close(); |
|
119 iTo.Close(); |
|
120 iContact.Close(); |
|
121 iContentType.Close(); |
|
122 iContentSubType.Close(); |
|
123 iContent.Close(); |
|
124 } |
|
125 |
|
126 CSubConSIPSubscribeParamSet::~CSubConSIPSubscribeParamSet() |
|
127 { |
|
128 // Cleanup the Memory associated with it |
|
129 iReqUri.Close(); |
|
130 iFrom.Close(); |
|
131 iTo.Close(); |
|
132 iContact.Close(); |
|
133 iEventType.Close(); |
|
134 iAcceptType.Close(); |
|
135 iAcceptSubType.Close(); |
|
136 } |
|
137 |
|
138 CSubConSIPAuthenticateParamSet::~CSubConSIPAuthenticateParamSet() |
|
139 { |
|
140 iUserName.Close(); |
|
141 iPassword.Close(); |
|
142 iRealm.Close(); |
|
143 } |
|
144 |
|
145 |
|
146 CSubConNotificationEvent* CSIPSubConnExtensionEventsFactory::NewL(TAny* aConstructionParameters) |
|
147 { |
|
148 TInt32 type = reinterpret_cast<TInt32>(aConstructionParameters); |
|
149 switch (type) |
|
150 { |
|
151 case KSubConSIPResponseEventType: |
|
152 return new (ELeave) CSubConSIPResponseEvent; |
|
153 case KSubConSIPAuthenticationRequiredEventType: |
|
154 return new (ELeave) CSubConSIPAuthenticationRequiredEvent; |
|
155 case KSubConSIPNotificationEventType: |
|
156 return new (ELeave) CSubConSIPNotificationEvent; |
|
157 default: |
|
158 User::Leave(KErrNotFound); |
|
159 } |
|
160 return NULL; |
|
161 } |
|
162 |
|
163 CSubConSIPResponseEvent::~CSubConSIPResponseEvent() |
|
164 { |
|
165 } |
|
166 |
|
167 CSubConSIPAuthenticationRequiredEvent::~CSubConSIPAuthenticationRequiredEvent() |
|
168 { |
|
169 iRealm.Close(); |
|
170 } |
|
171 |
|
172 CSubConSIPNotificationEvent::~CSubConSIPNotificationEvent() |
|
173 { |
|
174 iNotification.Close(); |
|
175 } |