|
1 /* |
|
2 * Copyright (c) 2008 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: The API supports attributes not present in MCS from SAT Api |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MCSDRMOBSERVER_H__ |
|
20 #define __MCSDRMOBSERVER_H__ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <DRMNotifier.h> |
|
24 |
|
25 /** |
|
26 * Interface for updating DRM rights after change. |
|
27 * |
|
28 * @since S60 v5.0 |
|
29 */ |
|
30 class MMcsDrmObserver |
|
31 { |
|
32 |
|
33 public: |
|
34 |
|
35 /** |
|
36 */ |
|
37 virtual void HandleDrmEvent( TUid aUid ) = 0; |
|
38 }; |
|
39 |
|
40 |
|
41 /** |
|
42 * DRM Observer Interface. |
|
43 * @lib mcsmenu.lib |
|
44 * @since S60 v5.0 |
|
45 */ |
|
46 NONSHARABLE_CLASS( CMcsDrmObserver ): |
|
47 public CBase, |
|
48 public MDRMEventObserver |
|
49 { |
|
50 |
|
51 public: |
|
52 |
|
53 /** |
|
54 * Creates an instance of CMcsDrmObserver implementation. |
|
55 * |
|
56 * @since S60 v5.0 |
|
57 * @param aCallBack Reference to notifier interface. |
|
58 */ |
|
59 static CMcsDrmObserver* NewL( |
|
60 MMcsDrmObserver& aObserver, |
|
61 const TDesC& aDRMContentId, |
|
62 TUid aUid, |
|
63 TDRMEventType aDRMEventType ); |
|
64 |
|
65 |
|
66 /** |
|
67 * Destructor. |
|
68 */ |
|
69 virtual ~CMcsDrmObserver(); |
|
70 |
|
71 /** |
|
72 */ |
|
73 TUid Uid(); |
|
74 |
|
75 /** |
|
76 * HandleNotificationL |
|
77 * |
|
78 * Callback function for the event notifications |
|
79 * The MDRMEvent object ownership stays with the notifier, |
|
80 * do not delete it |
|
81 * |
|
82 * @param aEvent : an object of the type MDRMEvent |
|
83 * @since S60Rel2.6 |
|
84 */ |
|
85 void HandleEventL( MDRMEvent* aEvent ); |
|
86 |
|
87 private: |
|
88 /** |
|
89 * Constructor. |
|
90 * |
|
91 * @since S60 v5.0 |
|
92 * @param aObserver Reference to MMcsDrmObserver interface. |
|
93 * @param aUid UID of application |
|
94 * @param aDRMEventType type of an event to register |
|
95 */ |
|
96 CMcsDrmObserver( |
|
97 MMcsDrmObserver& aObserver, |
|
98 TUid aUid, |
|
99 TDRMEventType aDRMEventType ); |
|
100 |
|
101 /** |
|
102 * Symbian 2nd phase constructor. |
|
103 */ |
|
104 void ConstructL( const TDesC& aDRMContentId ); |
|
105 |
|
106 |
|
107 |
|
108 /** |
|
109 */ |
|
110 void RegisterEventObserverL(); |
|
111 |
|
112 /** |
|
113 */ |
|
114 void UnRegisterEventObserver(); |
|
115 |
|
116 |
|
117 private: |
|
118 |
|
119 |
|
120 /** |
|
121 * Interface for notifying changes. |
|
122 * Not own. |
|
123 */ |
|
124 MMcsDrmObserver& iObserver; |
|
125 |
|
126 TUid iAppUid; |
|
127 |
|
128 //Own |
|
129 RBuf8 iContentId; |
|
130 //Own |
|
131 CDRMNotifier* iDRMNotifier; |
|
132 |
|
133 TDRMEventType iDRMEventType; |
|
134 }; |
|
135 |
|
136 #endif // __MCSDRMOBSERVER_H__ |
|
137 |
|
138 // End of File |