|
1 /* |
|
2 * Copyright (c) 2010 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 * Msv operation for drm view closing |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef C_DRMMSGWATCHEROBSERVER_H |
|
21 #define C_DRMMSGWATCHEROBSERVER_H |
|
22 |
|
23 |
|
24 |
|
25 #include <msvapi.h> // CMsvOperation |
|
26 #include <AknServerApp.h> // MAknServerAppExitObserver |
|
27 #include <AknLaunchAppService.h> // app service |
|
28 #include <DocumentHandler.h> // Document handler |
|
29 |
|
30 class CDocumentHandler; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * CDrmMsgWatcherObserver |
|
36 * Simple operation class which watches a service (drm), |
|
37 * completing when that thread closes. |
|
38 * |
|
39 * The passed CMsvSession is not used (merely required to base-construct |
|
40 * a CMsvOperation). |
|
41 */ |
|
42 NONSHARABLE_CLASS( CDrmMsgWatcherObserver ) : public CMsvOperation, public MAknServerAppExitObserver |
|
43 { |
|
44 public: |
|
45 |
|
46 static CDrmMsgWatcherObserver* NewL( |
|
47 CMsvSession& aMsvSession, |
|
48 TInt aPriority, |
|
49 TRequestStatus& aObserverRequestStatus, |
|
50 TUid aMtm, |
|
51 CAiwGenericParamList* aParamList ); |
|
52 |
|
53 |
|
54 static CDrmMsgWatcherObserver* NewL( |
|
55 CMsvSession& aMsvSession, |
|
56 TInt aPriority, |
|
57 TRequestStatus& aObserverRequestStatus, |
|
58 TUid aMtm, |
|
59 const TDesC& aFileName, |
|
60 TDataType& aDataType ); |
|
61 |
|
62 /** |
|
63 * C++ constructor |
|
64 */ |
|
65 CDrmMsgWatcherObserver( |
|
66 CMsvSession& aMsvSession, |
|
67 TInt aPriority, |
|
68 TRequestStatus& aObserverRequestStatus, |
|
69 TUid aMtm ); |
|
70 |
|
71 /** |
|
72 * Destructor. |
|
73 */ |
|
74 ~CDrmMsgWatcherObserver(); |
|
75 |
|
76 private: // From MApaServerAppExitObserver |
|
77 void HandleServerAppExit( TInt aReason ); |
|
78 |
|
79 protected: |
|
80 |
|
81 |
|
82 /** |
|
83 * From CMsvOperation |
|
84 */ |
|
85 virtual const TDesC8& ProgressL(); |
|
86 |
|
87 /** |
|
88 * From CMsvOperation |
|
89 */ |
|
90 virtual const TDesC8& FinalProgress(); |
|
91 |
|
92 /** |
|
93 * From CActive |
|
94 */ |
|
95 virtual void RunL(); |
|
96 |
|
97 /** |
|
98 * From CActive |
|
99 */ |
|
100 virtual void DoCancel(); |
|
101 |
|
102 /** |
|
103 * |
|
104 */ |
|
105 void Start(); |
|
106 |
|
107 private: |
|
108 void ConstructL( CAiwGenericParamList* aParamList ); |
|
109 void ConstructL( const TDesC& aFileName, TDataType& aDataType ); |
|
110 |
|
111 /** |
|
112 * Completes observer with the completion code |
|
113 * @param aCode: Completion code |
|
114 */ |
|
115 void CompleteObserver( TInt aCode ); |
|
116 |
|
117 |
|
118 protected:// Data |
|
119 HBufC8* iProgress; |
|
120 |
|
121 private: |
|
122 CAknLaunchAppService* iService; |
|
123 CDocumentHandler* iDocHandler; |
|
124 |
|
125 }; |
|
126 |
|
127 #endif // C_DRMMSGWATCHEROBSERVER_H |
|
128 |
|
129 // End of file |