|
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: Interface class for WMDRM DLA UI |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_WMDRMDLAUI_H |
|
20 #define C_WMDRMDLAUI_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class CCoeEnv; |
|
25 class CAknGlobalNote; |
|
26 class MDesCArray; |
|
27 class CGulIcon; |
|
28 |
|
29 /** |
|
30 * Interface for wait note callback. |
|
31 */ |
|
32 class MWmDrmDlaWaitNoteCallback |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Called if user cancels the wait note |
|
38 */ |
|
39 virtual void UserWaitNoteCancellation() = 0; |
|
40 |
|
41 }; |
|
42 |
|
43 /** |
|
44 * WMDRM DLA UI Interface |
|
45 * |
|
46 * @lib wmdrmdlautils.lib |
|
47 * @since S60 v9.1 |
|
48 */ |
|
49 NONSHARABLE_CLASS( CWmDrmDlaUi ) : public CActive |
|
50 { |
|
51 |
|
52 public: |
|
53 |
|
54 /** |
|
55 * This class must have an access to CCoeEnv, |
|
56 * otherwise it will leave with KErrNotSupported |
|
57 */ |
|
58 IMPORT_C static CWmDrmDlaUi* NewL(); |
|
59 IMPORT_C static CWmDrmDlaUi* NewLC(); |
|
60 |
|
61 /** |
|
62 * Destructor. |
|
63 */ |
|
64 virtual ~CWmDrmDlaUi(); |
|
65 |
|
66 /** |
|
67 * Shows error note |
|
68 * |
|
69 * @param aTextResourceId Resource id of the text to be shown |
|
70 * @leave with standard Symbian error code in case of error |
|
71 */ |
|
72 IMPORT_C void ShowErrorNoteL( TInt aTextResourceId ); |
|
73 |
|
74 /** |
|
75 * Shows wait note |
|
76 * |
|
77 * @param aTextResourceId Resource id of the text to be shown |
|
78 * @param aCallback Callback that will be called, |
|
79 * if user cancels the wait note. Can be NULL. |
|
80 * @leave with KErrInUse, if wait note is already shown, otherwise |
|
81 * standard Symbian error code in case of error. |
|
82 */ |
|
83 IMPORT_C void ShowWaitNoteL( TInt aTextResourceId, |
|
84 MWmDrmDlaWaitNoteCallback* aCallback ); |
|
85 |
|
86 /** |
|
87 * Removes wait note |
|
88 */ |
|
89 IMPORT_C void RemoveWaitNote(); |
|
90 |
|
91 /** |
|
92 * Shows list query |
|
93 * |
|
94 * @param aItems Item array to be shown, |
|
95 * ownership is transferred to the list query. |
|
96 * @param aIcons Icon array to be shown, |
|
97 * ownership is transferred to the list query. |
|
98 * @return Index of the user selection or -1, if user cancelled query. |
|
99 * @leave with KErrArgument, if any parameter is NULL, otherwise |
|
100 * standard Symbian error code in case of error. |
|
101 */ |
|
102 IMPORT_C TInt ShowListQueryL( MDesCArray* aItems, |
|
103 CArrayPtr<CGulIcon>* aIcons ); |
|
104 |
|
105 protected: // from base class CActive |
|
106 |
|
107 /** |
|
108 * From CActive Cancels async request. |
|
109 */ |
|
110 void DoCancel(); |
|
111 |
|
112 /** |
|
113 * From CActive Called when async request completes. |
|
114 */ |
|
115 void RunL(); |
|
116 |
|
117 /** |
|
118 * From CActive Called if RunL leaves. |
|
119 */ |
|
120 TInt RunError( TInt aError ); |
|
121 |
|
122 private: |
|
123 |
|
124 CWmDrmDlaUi(); |
|
125 void ConstructL(); |
|
126 void CancelWaitNote(); |
|
127 |
|
128 private: // data |
|
129 |
|
130 //Control environment, not owned |
|
131 CCoeEnv* iCoeEnv; |
|
132 |
|
133 // Path of the resource file |
|
134 HBufC* iWmdrmDlaUtilsResourceFile; |
|
135 |
|
136 // Resource offsets in CoeEnv |
|
137 TInt iWmdrmDlaUtilsResourceFileOffset; |
|
138 |
|
139 CAknGlobalNote* iGlobalNote; |
|
140 TInt iGlobalNoteId; |
|
141 HBufC* iGlobalNoteText; |
|
142 |
|
143 //Not owned |
|
144 MWmDrmDlaWaitNoteCallback* iCallback; |
|
145 |
|
146 }; |
|
147 |
|
148 #endif // C_WMDRMDLAUI_H |