|
1 /* |
|
2 * Copyright (c) 2006-2007 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: DRM Rights Information Handling |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <drmutility.h> |
|
21 #include <drmrightsinfo.h> |
|
22 #include <drmasyncobserver.h> |
|
23 |
|
24 #include "drmrightsinfoimpl.h" |
|
25 |
|
26 // ============================= LOCAL FUNCTIONS =============================== |
|
27 |
|
28 // ============================ MEMBER FUNCTIONS =============================== |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // CDrmRightsInfo::CDrmRightsInfo |
|
32 // C++ default constructor can NOT contain any code, that |
|
33 // might leave. |
|
34 // ----------------------------------------------------------------------------- |
|
35 // |
|
36 DRM::CDrmRightsInfo::CDrmRightsInfo() |
|
37 { |
|
38 } |
|
39 |
|
40 // ----------------------------------------------------------------------------- |
|
41 // CDrmRightsInfo::ConstructL |
|
42 // Symbian 2nd phase constructor can leave. |
|
43 // ----------------------------------------------------------------------------- |
|
44 // |
|
45 void DRM::CDrmRightsInfo::ConstructL() |
|
46 { |
|
47 iImplementation = DRM::CDrmRightsInfoImpl::NewL(); |
|
48 iUtility = DRM::CDrmUtility::NewL(); |
|
49 } |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // CDrmRightsInfo::NewL |
|
53 // Two-phased constructor. |
|
54 // ----------------------------------------------------------------------------- |
|
55 // |
|
56 EXPORT_C DRM::CDrmRightsInfo* DRM::CDrmRightsInfo::NewL() |
|
57 { |
|
58 DRM::CDrmRightsInfo* self( NewLC() ); |
|
59 |
|
60 CleanupStack::Pop( self ); |
|
61 |
|
62 return self; |
|
63 } |
|
64 |
|
65 |
|
66 // ----------------------------------------------------------------------------- |
|
67 // CDrmRightsInfo::NewLC |
|
68 // Two-phased constructor. |
|
69 // ----------------------------------------------------------------------------- |
|
70 // |
|
71 EXPORT_C DRM::CDrmRightsInfo* DRM::CDrmRightsInfo::NewLC() |
|
72 { |
|
73 DRM::CDrmRightsInfo* self( new( ELeave ) CDrmRightsInfo ); |
|
74 |
|
75 CleanupStack::PushL( self ); |
|
76 self->ConstructL(); |
|
77 |
|
78 return self; |
|
79 } |
|
80 |
|
81 |
|
82 // Destructor |
|
83 DRM::CDrmRightsInfo::~CDrmRightsInfo() |
|
84 { |
|
85 delete iImplementation; |
|
86 delete iUtility; |
|
87 } |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // CDrmRightsInfo::GetUtility |
|
91 // (other items were commented in a header). |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 EXPORT_C DRM::CDrmUtility& DRM::CDrmRightsInfo::GetUtility() const |
|
95 { |
|
96 return *iUtility; |
|
97 } |
|
98 |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // CDrmRightsInfo::CheckRightsL |
|
102 // Syncronous method |
|
103 // ----------------------------------------------------------------------------- |
|
104 // |
|
105 EXPORT_C void DRM::CDrmRightsInfo::CheckRightsL( |
|
106 const TDesC& aUniqueId, |
|
107 ContentAccess::TIntent aIntent, |
|
108 DRM::TDrmRightsInfo& aDetails ) |
|
109 { |
|
110 iImplementation->CheckRightsL( aUniqueId, aIntent, aDetails ); |
|
111 } |
|
112 |
|
113 // ----------------------------------------------------------------------------- |
|
114 // CDrmRightsInfo::CheckRightsL |
|
115 // Asyncronous method |
|
116 // ----------------------------------------------------------------------------- |
|
117 // |
|
118 EXPORT_C TInt DRM::CDrmRightsInfo::CheckRightsAsyncL( |
|
119 const TDesC& aUniqueId, |
|
120 ContentAccess::TIntent aIntent, |
|
121 DRM::TDrmRightsInfo& aDetails, |
|
122 DRM::MDrmAsyncObserver& aObserver ) |
|
123 { |
|
124 TInt operation = iImplementation->CheckRightsAsyncL( aUniqueId, |
|
125 aIntent, |
|
126 aDetails, |
|
127 aObserver ); |
|
128 return operation; |
|
129 } |
|
130 |
|
131 // ----------------------------------------------------------------------------- |
|
132 // CDrmRightsInfo::CancelOperation |
|
133 // Cancels the operation |
|
134 // (other items were commented in a header). |
|
135 // ----------------------------------------------------------------------------- |
|
136 // |
|
137 EXPORT_C TInt DRM::CDrmRightsInfo::CancelOperation( TInt aOperationId ) |
|
138 { |
|
139 return iImplementation->CancelOperation( aOperationId ); |
|
140 } |
|
141 |
|
142 // End of File |