45
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include"glxdrmutilitywrapper_p.h"
|
|
19 |
#include"glxdrmutility.h"
|
|
20 |
|
|
21 |
#include <QString>
|
|
22 |
#include <QDir>
|
|
23 |
|
|
24 |
GlxDRMUtilityWrapperPrivate::GlxDRMUtilityWrapperPrivate(GlxDRMUtilityWrapper* DRMUtilityWrapper)
|
|
25 |
{
|
|
26 |
iDRMUtilityWrapper = DRMUtilityWrapper;
|
|
27 |
iDRMUtility = CGlxDRMUtility::InstanceL();
|
|
28 |
}
|
|
29 |
/*
|
|
30 |
* Destructor
|
|
31 |
*/
|
|
32 |
GlxDRMUtilityWrapperPrivate::~GlxDRMUtilityWrapperPrivate()
|
|
33 |
{
|
|
34 |
if(iDRMUtility)
|
|
35 |
{
|
|
36 |
iDRMUtility->Close();
|
|
37 |
}
|
|
38 |
}
|
|
39 |
|
|
40 |
/**
|
|
41 |
* Check whether DRM rights are valid for specified item
|
|
42 |
* is called before right is consumed and for all items (focused or unfocused).
|
|
43 |
*/
|
|
44 |
bool GlxDRMUtilityWrapperPrivate::ItemRightsValidityCheck(QString aUri, bool aCheckViewRights)
|
|
45 |
{
|
|
46 |
QString filepath(QDir::toNativeSeparators(aUri));
|
|
47 |
TPtrC16 str(reinterpret_cast<const TUint16*> (filepath.utf16()));
|
|
48 |
HBufC* uri = str.Alloc();
|
|
49 |
TBool checkViewRight = aCheckViewRights?ETrue:EFalse;
|
|
50 |
bool ret = iDRMUtility->ItemRightsValidityCheckL(*uri,checkViewRight);
|
|
51 |
return ret;
|
|
52 |
}
|
|
53 |
|
|
54 |
///**
|
|
55 |
// * Check whether DRM rights are valid for specified item
|
|
56 |
// * is called before right is consumed and for all items (focused or unfocused).
|
|
57 |
// */
|
|
58 |
//bool GlxDRMUtilityWrapperPrivate::ItemRightsValidityCheckL(RFile& aFileHandle, TBool aCheckViewRights)
|
|
59 |
// {
|
|
60 |
//
|
|
61 |
// }
|
|
62 |
//
|
|
63 |
///**
|
|
64 |
// * Check whether DRM rights are valid for specified item
|
|
65 |
// * If the rights were just consumed, then allow to display
|
|
66 |
// * Otherwise, obtain current rights
|
|
67 |
// * is called after right is consumed and for only focused/displayed item.
|
|
68 |
// */
|
|
69 |
//bool GlxDRMUtilityWrapperPrivate::DisplayItemRightsCheckL(const TDesC& aUri, TBool aCheckViewRights)
|
|
70 |
// {
|
|
71 |
//
|
|
72 |
// }
|
|
73 |
//
|
|
74 |
///**
|
|
75 |
// * Check whether DRM rights are valid for specified item
|
|
76 |
// * If the rights were just consumed, then allow to display
|
|
77 |
// * Otherwise, obtain current rights
|
|
78 |
// * is called after right is consumed and for only focused/displayed item.
|
|
79 |
// */
|
|
80 |
//bool GlxDRMUtilityWrapperPrivate::DisplayItemRightsCheckL(RFile& aFileHandle, TBool aCheckViewRights)
|
|
81 |
// {
|
|
82 |
//
|
|
83 |
// }
|
|
84 |
//
|
|
85 |
/**
|
|
86 |
* Consume rights for specified item
|
|
87 |
* Caches item so that a client has right to display the item
|
|
88 |
*/
|
|
89 |
bool GlxDRMUtilityWrapperPrivate::ConsumeRights(QString aUri)
|
|
90 |
{
|
|
91 |
QString filepath(QDir::toNativeSeparators(aUri));
|
|
92 |
TPtrC16 str(reinterpret_cast<const TUint16*> (filepath.utf16()));
|
|
93 |
HBufC* uri = str.Alloc();
|
|
94 |
bool ret = iDRMUtility->ConsumeRightsL(*uri);
|
|
95 |
return ret;
|
|
96 |
}
|
|
97 |
//
|
|
98 |
///**
|
|
99 |
// * Consume rights for specified item
|
|
100 |
// * Caches item so that a client has right to display the item
|
|
101 |
// */
|
|
102 |
//bool GlxDRMUtilityWrapperPrivate::ConsumeRightsL(RFile& aFileHandle)
|
|
103 |
// {
|
|
104 |
//
|
|
105 |
// }
|
|
106 |
//
|
|
107 |
///**
|
|
108 |
// * Clears Last Consumed Uri
|
|
109 |
// */
|
|
110 |
//void GlxDRMUtilityWrapperPrivate::ClearLastConsumedItemUriL()
|
|
111 |
// {
|
|
112 |
//
|
|
113 |
// }
|
|
114 |
//
|
|
115 |
///**
|
|
116 |
// * Test whether a media item is OMA DRM 2.0 protected and has an associated
|
|
117 |
// * info URL.
|
|
118 |
// */
|
|
119 |
//bool GlxDRMUtilityWrapperPrivate::CanShowInfoOnlineL(const TDesC& aUri)
|
|
120 |
// {
|
|
121 |
//
|
|
122 |
// }
|
|
123 |
//
|
|
124 |
///**
|
|
125 |
// * Open the associated info URL for a media item in the browser.
|
|
126 |
// */
|
|
127 |
//void GlxDRMUtilityWrapperPrivate::ShowInfoOnlineL(const TDesC& aUri)
|
|
128 |
// {
|
|
129 |
//
|
|
130 |
// }
|
|
131 |
//
|
|
132 |
///**
|
|
133 |
// * Test whether a media item can be set as automated content. *
|
|
134 |
// */
|
|
135 |
//bool GlxDRMUtilityWrapperPrivate::CanSetAsAutomatedL(const TDesC& aUri, TGlxDrmAutomatedType aType)
|
|
136 |
// {
|
|
137 |
//
|
|
138 |
// }
|
|
139 |
//
|
|
140 |
///**
|
|
141 |
// * Set a media item as automated content.
|
|
142 |
// */
|
|
143 |
//void GlxDRMUtilityWrapperPrivate::SetAsAutomatedL(const TDesC& aUri, TGlxDrmAutomatedType aType)
|
|
144 |
// {
|
|
145 |
//
|
|
146 |
// }
|
|
147 |
//
|
|
148 |
///**
|
|
149 |
// * Show DRM details for specified item.
|
|
150 |
// */
|
|
151 |
//void GlxDRMUtilityWrapperPrivate::ShowDRMDetailsPaneL(const TDesC& aUri)
|
|
152 |
// {
|
|
153 |
//
|
|
154 |
// }
|
|
155 |
//
|
|
156 |
///**
|
|
157 |
// * Show DRM details for specified item.
|
|
158 |
// */
|
|
159 |
//void GlxDRMUtilityWrapperPrivate::ShowDRMDetailsPaneL(RFile& aFileHandle)
|
|
160 |
// {
|
|
161 |
//
|
|
162 |
// }
|
|
163 |
//
|
|
164 |
///**
|
|
165 |
// * Ask DRM manager if file is forward locked
|
|
166 |
// */
|
|
167 |
//bool GlxDRMUtilityWrapperPrivate::IsForwardLockedL(const TDesC& aUri)
|
|
168 |
// {
|
|
169 |
//
|
|
170 |
// }
|
|
171 |
//
|
|
172 |
/**
|
|
173 |
* Show rights info
|
|
174 |
*/
|
|
175 |
void GlxDRMUtilityWrapperPrivate::ShowRightsInfo(QString aUri)
|
|
176 |
{
|
|
177 |
QString filepath(QDir::toNativeSeparators(aUri));
|
|
178 |
TPtrC16 str(reinterpret_cast<const TUint16*> (filepath.utf16()));
|
|
179 |
HBufC* uri = str.Alloc();
|
|
180 |
iDRMUtility->ShowRightsInfoL(*uri);
|
|
181 |
}
|
|
182 |
|
|
183 |
///**
|
|
184 |
// * Show rights info
|
|
185 |
// */
|
|
186 |
//void GlxDRMUtilityWrapperPrivate::ShowRightsInfoL(RFile& aFileHandle)
|
|
187 |
// {
|
|
188 |
//
|
|
189 |
// }
|
|
190 |
//
|
|
191 |
///**
|
|
192 |
// * Get size of thumbnail to be requested for DRM invalid item
|
|
193 |
// */
|
|
194 |
//TSize GlxDRMUtilityWrapperPrivate::DRMThumbnailSize(TSize& aSize)
|
|
195 |
// {
|
|
196 |
//
|
|
197 |
// }
|