15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 // INCLUDE FILES |
19 // INCLUDE FILES |
20 #include <stringloader.h> |
20 #include <StringLoader.h> |
21 #include <aknglobalconfirmationquery.h> |
21 #include <AknGlobalConfirmationQuery.h> |
22 #include <avkon.hrh> // EAknSoftkeyNo |
22 #include <avkon.hrh> // EAknSoftkeyNo |
23 #include <aknglobalnote.h> |
23 #include <AknGlobalNote.h> |
24 |
24 |
25 #include <aknmediatorfacade.h> |
25 #include <AknMediatorFacade.h> |
26 #include <featmgr.h> |
26 #include <featmgr.h> |
27 #include <aknsddata.h> |
27 #include <aknSDData.h> |
28 #include <drmutility.rsg> |
28 #include <drmutility.rsg> |
29 |
29 |
30 #include "drmutilitysecondarydisplay.h" |
30 #include "drmutilitysecondarydisplay.h" |
31 #include "drmutilityinfonotewrapper.h" |
31 #include "DrmUtilityInfoNoteWrapper.h" |
32 |
32 |
33 // ============================= LOCAL FUNCTIONS =============================== |
33 // ============================= LOCAL FUNCTIONS =============================== |
34 |
34 |
35 // ============================ MEMBER FUNCTIONS =============================== |
35 // ============================ MEMBER FUNCTIONS =============================== |
36 |
36 |
38 // CDrmUtilityInfoNoteWrapper::CDrmUtilityInfoNoteWrapper |
38 // CDrmUtilityInfoNoteWrapper::CDrmUtilityInfoNoteWrapper |
39 // C++ default constructor can NOT contain any code, that |
39 // C++ default constructor can NOT contain any code, that |
40 // might leave. |
40 // might leave. |
41 // ----------------------------------------------------------------------------- |
41 // ----------------------------------------------------------------------------- |
42 // |
42 // |
43 DRM::CDrmUtilityInfoNoteWrapper::CDrmUtilityInfoNoteWrapper() |
43 DRM::CDrmUtilityInfoNoteWrapper::CDrmUtilityInfoNoteWrapper() |
44 : CActive( EPriorityStandard ) |
44 : CActive( EPriorityStandard ) |
45 { |
45 { |
46 CActiveScheduler::Add( this ); |
46 CActiveScheduler::Add( this ); |
47 } |
47 } |
48 |
48 |
61 // Two-phased constructor. |
61 // Two-phased constructor. |
62 // ----------------------------------------------------------------------------- |
62 // ----------------------------------------------------------------------------- |
63 // |
63 // |
64 DRM::CDrmUtilityInfoNoteWrapper* DRM::CDrmUtilityInfoNoteWrapper::NewLC() |
64 DRM::CDrmUtilityInfoNoteWrapper* DRM::CDrmUtilityInfoNoteWrapper::NewLC() |
65 { |
65 { |
66 DRM::CDrmUtilityInfoNoteWrapper* self( |
66 DRM::CDrmUtilityInfoNoteWrapper* self( |
67 new (ELeave) CDrmUtilityInfoNoteWrapper() ); |
67 new (ELeave) CDrmUtilityInfoNoteWrapper() ); |
68 CleanupStack::PushL( self ); |
68 CleanupStack::PushL( self ); |
69 self->ConstructL(); |
69 self->ConstructL(); |
70 return self; |
70 return self; |
71 } |
71 } |
93 |
93 |
94 // ----------------------------------------------------------------------------- |
94 // ----------------------------------------------------------------------------- |
95 // CDrmUtilityInfoNoteWrapper::ShowNoteL |
95 // CDrmUtilityInfoNoteWrapper::ShowNoteL |
96 // ----------------------------------------------------------------------------- |
96 // ----------------------------------------------------------------------------- |
97 // |
97 // |
98 void DRM::CDrmUtilityInfoNoteWrapper::ShowNoteL( TAknGlobalNoteType aType , |
98 void DRM::CDrmUtilityInfoNoteWrapper::ShowNoteL( TAknGlobalNoteType aType , |
99 const TDesC& aNoteText, |
99 const TDesC& aNoteText, |
100 TInt aResourceId, |
100 TInt aResourceId, |
101 const TDesC& aString, |
101 const TDesC& aString, |
102 TInt aValue ) |
102 TInt aValue ) |
103 { |
103 { |
104 RProcess myProcess; |
104 RProcess myProcess; |
105 TUid myProcessUid( KNullUid ); |
105 TUid myProcessUid( KNullUid ); |
106 |
106 |
107 // Convert primary display resource ID to Cover Ui |
107 // Convert primary display resource ID to Cover Ui |
108 // do nothing if not found |
108 // do nothing if not found |
109 if ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) && |
109 if ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) && |
110 EvaluateCoverResourceId( aResourceId ) ) |
110 EvaluateCoverResourceId( aResourceId ) ) |
111 { |
111 { |
112 RThread().Process( myProcess ); |
112 RThread().Process( myProcess ); |
113 myProcessUid = myProcess.Identity(); |
113 myProcessUid = myProcess.Identity(); |
114 |
114 |
115 TUtilitySDData utilityData; |
115 TUtilitySDData utilityData; |
116 // First field is DrmUtility's Uid |
116 // First field is DrmUtility's Uid |
117 utilityData.iUtilityUid = KUidCoverUiCategoryDrmUtility; |
117 utilityData.iUtilityUid = KUidCoverUiCategoryDrmUtility; |
118 // ProcessId which uses DrmUtility |
118 // ProcessId which uses DrmUtility |
119 utilityData.iHandlerProcessId = myProcessUid; |
119 utilityData.iHandlerProcessId = myProcessUid; |
120 if ( aNoteText.Compare( KNullDesC ) ) |
120 if ( aNoteText.Compare( KNullDesC ) ) |
121 { |
121 { |
122 // If there is filename given, it's always in the PrimaryString |
122 // If there is filename given, it's always in the PrimaryString |
123 utilityData.iStringParam.Append( aString ); |
123 utilityData.iStringParam.Append( aString ); |
124 } |
124 } |
125 if ( aValue > -1 ) |
125 if ( aValue > -1 ) |
126 { |
126 { |
127 // If there is filename given, it's always in the PrimaryString |
127 // If there is filename given, it's always in the PrimaryString |
128 utilityData.iStringParam.Append( aValue ); |
128 utilityData.iStringParam.Append( aValue ); |
129 } |
129 } |
130 |
130 |
131 TUtilitySDDataPckg pckg( utilityData ); |
131 TUtilitySDDataPckg pckg( utilityData ); |
132 CAknSDData* sd( CAknSDData::NewL( KUidCoverUiCategoryDrmUtility, |
132 CAknSDData* sd( CAknSDData::NewL( KUidCoverUiCategoryDrmUtility, |
133 aResourceId, |
133 aResourceId, |
134 pckg ) ); |
134 pckg ) ); |
135 iNote->SetSecondaryDisplayData( sd ); // ownership to notifier client |
135 iNote->SetSecondaryDisplayData( sd ); // ownership to notifier client |
136 } |
136 } |
137 |
137 |
138 iNote->ShowNoteL( iStatus , aType , aNoteText ); |
138 iNote->ShowNoteL( iStatus , aType , aNoteText ); |
139 SetActive(); |
139 SetActive(); |
140 } |
140 } |
156 } |
156 } |
157 |
157 |
158 // --------------------------------------------------------- |
158 // --------------------------------------------------------- |
159 // CDrmUtilityInfoNoteWrapper::EvaluateCoverResourceId |
159 // CDrmUtilityInfoNoteWrapper::EvaluateCoverResourceId |
160 // --------------------------------------------------------- |
160 // --------------------------------------------------------- |
161 // |
161 // |
162 TBool DRM::CDrmUtilityInfoNoteWrapper::EvaluateCoverResourceId( |
162 TBool DRM::CDrmUtilityInfoNoteWrapper::EvaluateCoverResourceId( |
163 TInt& aResourceId ) |
163 TInt& aResourceId ) |
164 { |
164 { |
165 switch ( aResourceId ) |
165 switch ( aResourceId ) |
166 { |
166 { |
167 case R_DRMUTILITY_CONFIRMATION_QUERY: |
167 case R_DRMUTILITY_CONFIRMATION_QUERY: |
168 { |
168 { |
169 aResourceId = ECover_confirmation_query; |
169 aResourceId = ECover_confirmation_query; |