|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef __RIGHTSOBJECT_H__ |
|
23 #define __RIGHTSOBJECT_H__ |
|
24 |
|
25 #include <f32file.h> |
|
26 #include <caf/caf.h> |
|
27 |
|
28 class RReadStream; |
|
29 class RWriteStream; |
|
30 |
|
31 using namespace ContentAccess; |
|
32 |
|
33 namespace ReferenceTestAgent |
|
34 { |
|
35 class CIntent; |
|
36 |
|
37 class CRightsObject : public CBase |
|
38 { |
|
39 public: |
|
40 static CRightsObject* NewL(); |
|
41 IMPORT_C static CRightsObject* NewL(RReadStream& aStream, TBool aHaveDeleteKey); |
|
42 virtual ~CRightsObject(); |
|
43 |
|
44 IMPORT_C const TDesC8& Cid(); |
|
45 IMPORT_C TInt EvaluateIntent(TIntent aIntent); |
|
46 IMPORT_C void ExecuteIntentL(TIntent aIntent); |
|
47 IMPORT_C void MergeL(CRightsObject& aRightsObject); |
|
48 IMPORT_C void WriteDescription(RFile& aFile); |
|
49 IMPORT_C void ExternalizeL(RWriteStream& aStream); |
|
50 IMPORT_C void SetDeleteKeyL(const TDesC8& aDeleteKey); |
|
51 IMPORT_C const TDesC8& DeleteKey(); |
|
52 |
|
53 void AddIntentL(CIntent* aIntent); |
|
54 void AddVersionL(const TDesC8& aVersion); |
|
55 void AddUidL(const TDesC8& aUid); |
|
56 void AddKeyValueL(const TDesC8& aKeyValue); |
|
57 void AddCountL(const TDesC8& aCount); |
|
58 private: |
|
59 CRightsObject(); |
|
60 CRightsObject(TBool aForwardLock, TBool aPending, TInt aPendingDelay); |
|
61 void ConstructL(const TDesC8& aCid); |
|
62 void InternalizeL(RReadStream& aStream, TBool aHaveDeleteKey); |
|
63 |
|
64 TBool Pending(); |
|
65 TBool ForwardLock(); |
|
66 TInt PendingDelay(); |
|
67 const RStreamablePtrArray <CIntent>& IntentArray() const; |
|
68 |
|
69 private: |
|
70 RStreamablePtrArray <CIntent> iIntents; |
|
71 HBufC8* iCid; |
|
72 |
|
73 TBool iForwardLock; |
|
74 TBool iPending; |
|
75 TInt iPendingDelay; |
|
76 HBufC8* iDeleteKey; |
|
77 HBufC8* iVersion; |
|
78 HBufC8* iKeyValue; |
|
79 HBufC8* iCount; |
|
80 }; |
|
81 } |
|
82 |
|
83 #endif |
|
84 |