|
1 // Copyright (c) 2004-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 CS_GENEVENT_INL |
|
23 #define CS_GENEVENT_INL |
|
24 |
|
25 using namespace ESock; |
|
26 |
|
27 CEventParamsGranted* CEventParamsGranted::NewL(TUint32 aFamilyId) |
|
28 /** Creates a granted parameter event sub-connection. |
|
29 |
|
30 @return a CEventParamsGranted object pointer if successful, |
|
31 otherwise leaves with system error code. |
|
32 */ |
|
33 { |
|
34 STypeId typeId = STypeId::CreateSTypeId(KEventTypeImplUid, KEventParamsGranted); |
|
35 CEventParamsGranted* self = static_cast<CEventParamsGranted*>(Meta::SMetaDataECom::NewInstanceL(typeId)); |
|
36 self->iFamilyBundle.CreateL(); |
|
37 self->iFamilyBundle.CreateFamilyL(aFamilyId); |
|
38 return self; |
|
39 } |
|
40 |
|
41 CEventParamsGranted::CEventParamsGranted() |
|
42 /** Empty CEventParamsGranted constructor |
|
43 */ |
|
44 { |
|
45 } |
|
46 |
|
47 const XParameterSetBase* CEventParamsGranted::FindParameterSet(TUint32 aFamilyId, TUint aIndex) const |
|
48 /** Find Parameter set. |
|
49 |
|
50 @param aIndex the index number of the parameter to be returned |
|
51 |
|
52 @return pointer to selected XParameterSetBase. */ |
|
53 { |
|
54 return const_cast<RParameterFamilyBundle&>(iFamilyBundle).FindFamily(aFamilyId).GetParameterSetAtIndex(aIndex, RParameterFamily::EGranted); |
|
55 } |
|
56 |
|
57 void CEventParamsGranted::AddParameterSetL(TUint32 aFamilyId, XParameterSetBase* aParameterSet) |
|
58 /** Adds Parameter set. |
|
59 |
|
60 @param aParameterSet parameter set to be added in the list. */ |
|
61 { |
|
62 iFamilyBundle.FindFamily(aFamilyId).AddParameterSetL(aParameterSet, RParameterFamily::EGranted); |
|
63 } |
|
64 |
|
65 TInt CEventParamsGranted::CountParameterSets(TUint32 aFamilyId) |
|
66 /** Gets the number of Parameter set. |
|
67 |
|
68 @return number of Parameter set. */ |
|
69 { |
|
70 return iFamilyBundle.FindFamily(aFamilyId).CountParameterSets(RParameterFamily::EGranted); |
|
71 } |
|
72 |
|
73 |
|
74 //==================================== |
|
75 |
|
76 CEventParamsChanged* CEventParamsChanged::NewL(TUint32 aFamilyId) |
|
77 /** Creates a changed parameter event sub-connection. |
|
78 |
|
79 @return CEventParamsChanged pointer if successful, |
|
80 otherwise leaves with system error code. |
|
81 */ |
|
82 { |
|
83 STypeId typeId = STypeId::CreateSTypeId(KEventTypeImplUid, KEventParamsChanged); |
|
84 CEventParamsChanged* self = static_cast<CEventParamsChanged*>(Meta::SMetaDataECom::NewInstanceL(typeId)); |
|
85 self->iFamilyBundle.CreateL(); |
|
86 self->iFamilyBundle.CreateFamilyL(aFamilyId); |
|
87 return self; |
|
88 } |
|
89 |
|
90 CEventParamsChanged::CEventParamsChanged() |
|
91 : CEventParamsGranted() |
|
92 /** Empty CEventParamsChanged constructor |
|
93 */ |
|
94 { |
|
95 } |
|
96 |
|
97 TInt CEventParamsChanged::Error() const |
|
98 /** Gets Error value. |
|
99 |
|
100 @return error value. */ |
|
101 { |
|
102 return iError; |
|
103 } |
|
104 |
|
105 void CEventParamsChanged::SetError(TInt aError) |
|
106 /** Sets Error value. |
|
107 |
|
108 @param aError error value. */ |
|
109 { |
|
110 iError = aError; |
|
111 } |
|
112 |
|
113 |
|
114 |
|
115 #endif //CS_GENEVENT_INL |
|
116 |