|
1 /* |
|
2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: AiFw internal publisher info |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _AIFWPUBLISHERINFO_INL |
|
20 #define _AIFWPUBLISHERINFO_INL |
|
21 |
|
22 // --------------------------------------------------------------------------- |
|
23 // TAiFwCallback::TAiFwCallback |
|
24 // |
|
25 // --------------------------------------------------------------------------- |
|
26 // |
|
27 inline TAiFwCallback::TAiFwCallback() |
|
28 : iFunction( NULL ), iPtr( NULL ) |
|
29 { |
|
30 } |
|
31 |
|
32 // --------------------------------------------------------------------------- |
|
33 // TAiFwCallback::TAiFwCallback |
|
34 // |
|
35 // --------------------------------------------------------------------------- |
|
36 // |
|
37 inline TAiFwCallback::TAiFwCallback( |
|
38 void (*aFunction)( TAny* aPtr, TInt aResult ), TAny* aPtr ) |
|
39 : iFunction( aFunction ), iPtr( aPtr ) |
|
40 { |
|
41 } |
|
42 |
|
43 // --------------------------------------------------------------------------- |
|
44 // TAiFwCallback::operator= |
|
45 // |
|
46 // --------------------------------------------------------------------------- |
|
47 // |
|
48 inline TAiFwCallback& TAiFwCallback::operator=( const TAiFwCallback& aCb ) |
|
49 { |
|
50 iPtr = aCb.iPtr; |
|
51 iFunction = aCb.iFunction; |
|
52 |
|
53 return *this; |
|
54 } |
|
55 |
|
56 // --------------------------------------------------------------------------- |
|
57 // TAiFwCallback::Callback |
|
58 // |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 inline void TAiFwCallback::Callback( TInt aResult ) const |
|
62 { |
|
63 if ( iFunction ) |
|
64 { |
|
65 (*iFunction)( iPtr, aResult ); |
|
66 } |
|
67 } |
|
68 |
|
69 // --------------------------------------------------------------------------- |
|
70 // TAiFwPublisherInfo::TAiFwPublisherInfo |
|
71 // |
|
72 // --------------------------------------------------------------------------- |
|
73 // |
|
74 inline TAiFwPublisherInfo::TAiFwPublisherInfo() |
|
75 : iInfo( THsPublisherInfo() ), iCb( TAiFwCallback() ), iReason( 0 ) |
|
76 { |
|
77 } |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // TAiFwPublisherInfo::TAiFwPublisherInfo |
|
81 // |
|
82 // --------------------------------------------------------------------------- |
|
83 // |
|
84 inline TAiFwPublisherInfo::TAiFwPublisherInfo( const THsPublisherInfo& aInfo, |
|
85 const TAiFwCallback& aCb, TInt aReason ) |
|
86 : iInfo( aInfo ), iCb( aCb ), iReason( aReason ) |
|
87 { |
|
88 } |
|
89 |
|
90 // --------------------------------------------------------------------------- |
|
91 // TAiFwPublisherInfo::operator= |
|
92 // |
|
93 // --------------------------------------------------------------------------- |
|
94 // |
|
95 inline TAiFwPublisherInfo& TAiFwPublisherInfo::operator=( |
|
96 const TAiFwPublisherInfo& aInfo ) |
|
97 { |
|
98 iInfo = aInfo.iInfo; |
|
99 iCb = aInfo.iCb; |
|
100 iReason = aInfo.iReason; |
|
101 |
|
102 return *this; |
|
103 } |
|
104 |
|
105 // --------------------------------------------------------------------------- |
|
106 // TAiFwPublisherInfo::operator== |
|
107 // |
|
108 // --------------------------------------------------------------------------- |
|
109 // |
|
110 inline TBool TAiFwPublisherInfo::operator==( |
|
111 const THsPublisherInfo& aInfo ) const |
|
112 { |
|
113 return iInfo == aInfo; |
|
114 } |
|
115 |
|
116 // --------------------------------------------------------------------------- |
|
117 // TAiFwPublisherInfo::Info |
|
118 // |
|
119 // --------------------------------------------------------------------------- |
|
120 // |
|
121 inline const THsPublisherInfo& TAiFwPublisherInfo::Info() const |
|
122 { |
|
123 return iInfo; |
|
124 } |
|
125 |
|
126 // --------------------------------------------------------------------------- |
|
127 // TAiFwPublisherInfo::Reason |
|
128 // |
|
129 // --------------------------------------------------------------------------- |
|
130 // |
|
131 inline TInt TAiFwPublisherInfo::Reason() const |
|
132 { |
|
133 return iReason; |
|
134 } |
|
135 |
|
136 // --------------------------------------------------------------------------- |
|
137 // TAiFwPublisherInfo::Callback |
|
138 // |
|
139 // --------------------------------------------------------------------------- |
|
140 // |
|
141 inline void TAiFwPublisherInfo::Callback( TInt aResult ) const |
|
142 { |
|
143 iCb.Callback( aResult ); |
|
144 } |
|
145 |
|
146 #endif // _AIFWPUBLISHERINFO_INL |
|
147 |
|
148 // End of file |