13 * |
13 * |
14 * Description: Collection of content plugin helper functions |
14 * Description: Collection of content plugin helper functions |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
|
18 // System includes |
18 |
19 |
19 #include <aicontentpublisher.h> |
20 // User includes |
|
21 #include <hscontentpublisher.h> |
|
22 |
20 #include "caiplugintool.h" |
23 #include "caiplugintool.h" |
21 |
24 |
|
25 // ======== MEMBER FUNCTIONS ======== |
|
26 |
|
27 // ---------------------------------------------------------------------------- |
|
28 // CAiPluginTool::CAiPluginTool |
|
29 // |
|
30 // ---------------------------------------------------------------------------- |
|
31 // |
22 CAiPluginTool::CAiPluginTool() |
32 CAiPluginTool::CAiPluginTool() |
23 { |
33 { |
24 } |
34 } |
25 |
35 |
|
36 // ---------------------------------------------------------------------------- |
|
37 // CAiPluginTool::NewL |
|
38 // |
|
39 // ---------------------------------------------------------------------------- |
|
40 // |
26 CAiPluginTool* CAiPluginTool::NewL() |
41 CAiPluginTool* CAiPluginTool::NewL() |
27 { |
42 { |
28 CAiPluginTool* self = new ( ELeave ) CAiPluginTool(); |
43 CAiPluginTool* self = new ( ELeave ) CAiPluginTool(); |
29 CleanupStack::PushL( self ); |
44 CleanupStack::PushL( self ); |
30 self->ConstructL(); |
45 self->ConstructL(); |
31 CleanupStack::Pop( self ); |
46 CleanupStack::Pop( self ); |
32 return self; |
47 return self; |
33 } |
48 } |
34 |
49 |
|
50 // ---------------------------------------------------------------------------- |
|
51 // CAiPluginTool::ConstructL |
|
52 // |
|
53 // ---------------------------------------------------------------------------- |
|
54 // |
35 void CAiPluginTool::ConstructL() |
55 void CAiPluginTool::ConstructL() |
36 { |
56 { |
37 } |
57 } |
38 |
58 |
|
59 // ---------------------------------------------------------------------------- |
|
60 // CAiPluginTool::Release |
|
61 // |
|
62 // ---------------------------------------------------------------------------- |
|
63 // |
39 void CAiPluginTool::Release() |
64 void CAiPluginTool::Release() |
40 { |
65 { |
41 delete this; |
66 delete this; |
42 } |
67 } |
43 |
68 |
44 const TAiPublisherInfo* CAiPluginTool::PublisherInfoL( |
69 // ---------------------------------------------------------------------------- |
45 CAiContentPublisher& aContentPublisher ) |
70 // CAiPluginTool::ContentItemIterator |
|
71 // |
|
72 // ---------------------------------------------------------------------------- |
|
73 // |
|
74 MAiContentItemIterator* CAiPluginTool::ContentItemIterator( |
|
75 CHsContentPublisher& aContentPublisher, |
|
76 CHsContentPublisher::TProperty aType ) |
46 { |
77 { |
47 const TAiPublisherInfo* result = NULL; |
78 return static_cast< MAiContentItemIterator* >( |
48 MAiPropertyExtension* propExt = PropertyExt( aContentPublisher ); |
79 aContentPublisher.GetProperty( aType ) ); |
49 if ( propExt ) |
|
50 { |
|
51 result = propExt->PublisherInfoL(); |
|
52 } |
|
53 return result; |
|
54 } |
80 } |
55 |
81 |
56 MAiContentItemIterator* CAiPluginTool::ContentItemIteratorL( |
|
57 CAiContentPublisher& aContentPublisher, |
|
58 TInt aContentType ) |
|
59 { |
|
60 MAiContentItemIterator* result = NULL; |
|
61 MAiPropertyExtension* propExt = PropertyExt( aContentPublisher ); |
|
62 if ( propExt ) |
|
63 { |
|
64 TAny* prop = NULL; |
|
65 prop = propExt->GetPropertyL( aContentType ); |
|
66 if ( prop ) |
|
67 { |
|
68 result = static_cast<MAiContentItemIterator*>( prop ); |
|
69 } |
|
70 } |
|
71 return result; |
|
72 } |
|
73 |
|
74 MAiPropertyExtension* CAiPluginTool::PropertyExt( |
|
75 CAiContentPublisher& aContentPublisher ) |
|
76 { |
|
77 return static_cast<MAiPropertyExtension*>( |
|
78 aContentPublisher.Extension( KExtensionUidProperty ) ); |
|
79 } |
|
80 |
|
81 MAiEventHandlerExtension* CAiPluginTool::EventHandlerExt( |
|
82 CAiContentPublisher& aContentPublisher ) |
|
83 { |
|
84 return static_cast<MAiEventHandlerExtension*>( |
|
85 aContentPublisher.Extension( KExtensionUidEventHandler ) ); |
|
86 } |
|
87 |
|
88 // End of File. |
82 // End of File. |
89 |
83 |
90 |
|