|
1 /* |
|
2 * Copyright (c) 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <caf.h> |
|
22 #include "wmdrmagentfactory.h" |
|
23 #include "wmdrmagentimportfile.h" |
|
24 #include "wmdrmagentrightsmanager.h" |
|
25 #include "logfn.h" |
|
26 |
|
27 using namespace ContentAccess; |
|
28 |
|
29 // ============================= LOCAL FUNCTIONS =============================== |
|
30 |
|
31 |
|
32 // ============================ MEMBER FUNCTIONS =============================== |
|
33 |
|
34 // ----------------------------------------------------------------------------- |
|
35 // CWmDrmAgentFactory::CWmDrmAgentFactory |
|
36 // C++ default constructor can NOT contain any code, that |
|
37 // might leave. |
|
38 // ----------------------------------------------------------------------------- |
|
39 // |
|
40 CWmDrmAgentFactory::CWmDrmAgentFactory() |
|
41 { |
|
42 LOGFN( "CWmDrmAgentFactory::CWmDrmAgentFactory" ); |
|
43 } |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // CWmDrmAgentFactory::ConstructL |
|
47 // Symbian 2nd phase constructor can leave. |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 void CWmDrmAgentFactory::ConstructL() |
|
51 { |
|
52 LOGFN( "CWmDrmAgentFactory::ConstructL" ); |
|
53 } |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // CWmDrmAgentFactory::NewL |
|
57 // Two-phased constructor. |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 CWmDrmAgentFactory* CWmDrmAgentFactory::NewL() |
|
61 { |
|
62 LOGFN( "CWmDrmAgentFactory::NewL" ); |
|
63 CWmDrmAgentFactory* self = new( ELeave ) CWmDrmAgentFactory; |
|
64 CleanupStack::PushL( self ); |
|
65 self->ConstructL(); |
|
66 CleanupStack::Pop(); |
|
67 return self; |
|
68 } |
|
69 |
|
70 // ----------------------------------------------------------------------------- |
|
71 // CWmDrmAgentFactory::~CWmDrmAgentFactory |
|
72 // Destructor |
|
73 // ----------------------------------------------------------------------------- |
|
74 // |
|
75 CWmDrmAgentFactory::~CWmDrmAgentFactory() |
|
76 { |
|
77 LOGFN( "CWmDrmAgentFactory::~CWmDrmAgentFactory" ); |
|
78 } |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // CWmDrmAgentFactory::CreateContentBrowserL |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 CAgentContent* CWmDrmAgentFactory::CreateContentBrowserL(const TDesC& aURI, TContentShareMode aShareMode) |
|
85 { |
|
86 LOGFN( "CWmDrmAgentFactory::CreateContentBrowserL" ); |
|
87 return CWmDrmAgentContent::NewL(aURI, aShareMode); |
|
88 } |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CWmDrmAgentFactory::CreateContentBrowserL |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 CAgentContent* CWmDrmAgentFactory::CreateContentBrowserL(RFile& aFile) |
|
95 { |
|
96 LOGFN( "CWmDrmAgentFactory::CreateContentBrowserL (2)" ); |
|
97 return CWmDrmAgentContent::NewL(aFile); |
|
98 } |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // CWmDrmAgentFactory::CreateDataConsumerL |
|
102 // ----------------------------------------------------------------------------- |
|
103 // |
|
104 CAgentData* CWmDrmAgentFactory::CreateDataConsumerL(const TVirtualPathPtr& aVirtualPath, TContentShareMode aShareMode) |
|
105 { |
|
106 LOGFN( "CWmDrmAgentFactory::CreateDataConsumerL" ); |
|
107 return CWmDrmAgentData::NewL(aVirtualPath, aShareMode); |
|
108 } |
|
109 |
|
110 // ----------------------------------------------------------------------------- |
|
111 // CWmDrmAgentFactory::CreateDataConsumerL |
|
112 // ----------------------------------------------------------------------------- |
|
113 // |
|
114 CAgentData* CWmDrmAgentFactory::CreateDataConsumerL(RFile& aFile, const TDesC& aUniqueId) |
|
115 { |
|
116 LOGFN( "CWmDrmAgentFactory::CreateDataConsumerL (2)" ); |
|
117 return CWmDrmAgentData::NewL(aFile, aUniqueId); |
|
118 } |
|
119 |
|
120 // ----------------------------------------------------------------------------- |
|
121 // CWmDrmAgentFactory::CreateManagerL |
|
122 // ----------------------------------------------------------------------------- |
|
123 // |
|
124 CAgentManager* CWmDrmAgentFactory::CreateManagerL() |
|
125 { |
|
126 LOGFN( "CWmDrmAgentFactory::CreateManagerL" ); |
|
127 return CWmDrmAgentManager::NewL(); |
|
128 } |
|
129 |
|
130 // ----------------------------------------------------------------------------- |
|
131 // CWmDrmAgentFactory::CreateImporterL |
|
132 // ----------------------------------------------------------------------------- |
|
133 // |
|
134 CAgentImportFile* CWmDrmAgentFactory::CreateImporterL(const TDesC8& aMimeType, const CMetaDataArray& aMetaDataArray, const TDesC& aOutputDirectory, const TDesC& aSuggestedFileName) |
|
135 { |
|
136 LOGFN( "CWmDrmAgentFactory::CreateImporterL" ); |
|
137 return CWmDrmAgentImportFile::NewL(aMimeType, aMetaDataArray, aOutputDirectory, aSuggestedFileName); |
|
138 } |
|
139 |
|
140 // ----------------------------------------------------------------------------- |
|
141 // CWmDrmAgentFactory::CreateImporterL |
|
142 // ----------------------------------------------------------------------------- |
|
143 // |
|
144 CAgentImportFile* CWmDrmAgentFactory::CreateImporterL(const TDesC8& aMimeType, const CMetaDataArray& aMetaDataArray) |
|
145 { |
|
146 LOGFN( "CWmDrmAgentFactory::CreateImporterL (2)" ); |
|
147 return CWmDrmAgentImportFile::NewL(aMimeType, aMetaDataArray); |
|
148 } |
|
149 |
|
150 // ----------------------------------------------------------------------------- |
|
151 // CWmDrmAgentFactory::CreateImporterL |
|
152 // ----------------------------------------------------------------------------- |
|
153 // |
|
154 CAgentRightsManager* CWmDrmAgentFactory::CreateRightsManagerL() |
|
155 { |
|
156 LOGFN( "CWmDrmAgentFactory::CreateRightsManagerL" ); |
|
157 return CWmDrmAgentRightsManager::NewL(); |
|
158 } |
|
159 |
|
160 |