|
1 /* |
|
2 * Copyright (c) 2005 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: Collection of content plugin helper functions |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <aicontentpublisher.h> |
|
20 #include "caiplugintool.h" |
|
21 |
|
22 CAiPluginTool::CAiPluginTool() |
|
23 { |
|
24 } |
|
25 |
|
26 CAiPluginTool* CAiPluginTool::NewL() |
|
27 { |
|
28 CAiPluginTool* self = new ( ELeave ) CAiPluginTool(); |
|
29 CleanupStack::PushL( self ); |
|
30 self->ConstructL(); |
|
31 CleanupStack::Pop( self ); |
|
32 return self; |
|
33 } |
|
34 |
|
35 void CAiPluginTool::ConstructL() |
|
36 { |
|
37 } |
|
38 |
|
39 void CAiPluginTool::Release() |
|
40 { |
|
41 delete this; |
|
42 } |
|
43 |
|
44 const TAiPublisherInfo* CAiPluginTool::PublisherInfoL( |
|
45 CAiContentPublisher& aContentPublisher ) |
|
46 { |
|
47 const TAiPublisherInfo* result = NULL; |
|
48 MAiPropertyExtension* propExt = PropertyExt( aContentPublisher ); |
|
49 if ( propExt ) |
|
50 { |
|
51 result = propExt->PublisherInfoL(); |
|
52 } |
|
53 return result; |
|
54 } |
|
55 |
|
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. |
|
89 |
|
90 |