# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273842454 -10800 # Node ID 908beac81e0a5b93dcf042ffe420b9601596021f # Parent 3bdc3b853094158d273c599de024be700e132fcb Revision: 201017 Kit: 201019 diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/data/102750CC.rss --- a/commondrm/drmsettingsplugin/data/102750CC.rss Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ECOM plugin resource file for DRMSettingsPlugin. -* -*/ - -#include - - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = 0x102750CC; - interfaces = - { - INTERFACE_INFO - { - interface_uid = 0x10207236; // UID for CGSPluginInterface - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = 0x102750CD; - version_no = 1; - display_name = "DRM Settings Plugin"; - default_data = "0x1020743A"; - opaque_data = "2";//Order number - } - }; - } - }; - } - - -// End of File - diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/data/drmsettingspluginrsc.rss --- a/commondrm/drmsettingsplugin/data/drmsettingspluginrsc.rss Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,512 +0,0 @@ -/* -* Copyright (c) 2006 - 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource file for DRMSettinsPlugin -* -*/ - - - -// RESOURCE IDENTIFIER -NAME DRMS // 4 letter ID - -// INCLUDES -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "drmsettingsplugin.hrh" -#include "drmsettingsplugin.rh" - - -// CONSTANTS - -// RESOURCE DEFINITIONS - -RESOURCE RSS_SIGNATURE - { - } - - -RESOURCE TBUF - { - buf="DRMS"; - } - -//---------------------------------------------------- -// -// EIK_APP_INFO -// It contains application information. -// -//---------------------------------------------------- -// -RESOURCE EIK_APP_INFO - { - } - - - -//---------------------------------------------------- -// r_drm_settings_view_caption -// -// Caption for DRM Settings plugin -//---------------------------------------------------- -// -RESOURCE TBUF r_drm_settings_view_caption - { - buf = qtn_set_protected_content; - } - - -//---------------------------------------------------- -// -// r_drm_settings_view_title -// Title of DRM Settings view -// -//---------------------------------------------------- -// -RESOURCE TITLE_PANE r_drm_settings_view_title - { - txt = qtn_set_protected_content; - } - - -//---------------------------------------------------- -// -// r_drm_softkeys_options_back_change -// Text association with MSK ( CHANGE ) -// -//---------------------------------------------------- -// -RESOURCE CBA r_drm_softkeys_options_back_change - { - buttons = - { - CBA_BUTTON - { - id=EAknSoftkeyOptions; - txt = text_softkey_option; - }, - CBA_BUTTON - { - id=EAknSoftkeyBack; - txt = text_softkey_back; - }, - CBA_BUTTON - { - id=EDRMSettingsCmdAppChangeMSK; - txt = qtn_msk_change; - } - }; - } - - - - -//---------------------------------------------------- -// -// r_drm_settings_view -// DRM Settings view. -// -//---------------------------------------------------- -// -RESOURCE AVKON_VIEW r_drm_settings_view - { - menubar = r_drm_settings_menubar_change_exit; - cba = r_drm_softkeys_options_back_change; - } - - -// ----------------------------------------------------------------------------- -// -// r_drm_settings_menubar_change_exit -// Menu with 'change' and 'exit' items. -// -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_BAR r_drm_settings_menubar_change_exit - { - titles = - { - MENU_TITLE - { - menu_pane = r_drm_settings_menu_item_exit; - }, - MENU_TITLE - { - menu_pane = r_drm_settings_menu_item_change; - } - }; - } - - - // ----------------------------------------------------------------------------- - // - // r_drm_settings_menu_item_exit - // Options menu items 'Help' and 'Exit'. Used instead of plain 'Exit' when help - // is wanted to be shown in UI. - // - // ----------------------------------------------------------------------------- - // - RESOURCE MENU_PANE r_drm_settings_menu_item_exit - { - items = - { - MENU_ITEM - { - command = EAknCmdHelp; - txt = qtn_options_help; - }, - MENU_ITEM - { - command = EAknCmdExit; - txt = qtn_options_exit; - } - }; - } - - -// ----------------------------------------------------------------------------- -// -// r_drm_settings_menu_item_change -// Change item. -// -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_drm_settings_menu_item_change - { - items = - { - MENU_ITEM - { - command = EDRMSettingsCmdAppChange; - txt = qtn_set_options_change; - flags = EEikMenuItemAction; - } - }; - } - - -//---------------------------------------------------- -// -// r_drm_settings_lbx -// DRM Settings view's listbox. -// -//---------------------------------------------------- -// -RESOURCE DRM_SETTINGS_FEATURE_ARRAY r_drm_settings_lbx - { - items = - { -#ifdef __DRM_OMA2 -#ifdef RD_DRM_SILENT_RIGHTS_ACQUISITION - DRM_SETTINGS_FEATURE - { - txt = " \t"qtn_set_automatic_activation"\t\t"; - item = EDRMSettingsIdAutomaticActivation; - }, -#endif // RD_DRM_SILENT_RIGHTS_ACQUISITION - -#ifdef RD_DRM_METERING - DRM_SETTINGS_FEATURE - { - txt = " \t"qtn_drm_set_usage_reporting"\t\t"; - item = EDRMSettingsIdUsageReporting; - }, -#endif // RD_DRM_METERING - - DRM_SETTINGS_FEATURE - { - txt = " \t"qtn_set_transaction_tracking"\t\t"; - item = EDRMSettingsIdTransactionTracking; - }, -#endif // __DRM_OMA2 - - DRM_SETTINGS_FEATURE - { - txt = " \t"qtn_drm_set_license_deletion"\t\t"; - item = EDRMSettingsIdWMDRMLicenseDeletion; - } - }; - } - - -//---------------------------------------------------- -// -// r_drm_settings_setting_listbox -// Common listbox editor resource for setting pages. -// -//---------------------------------------------------- -// -RESOURCE LISTBOX r_drm_settings_setting_listbox - { - flags = EEikListBoxMultipleSelection; - } - - -//---------------------------------------------------- -// -// r_ttracking_setting_page -// Transaction tracking setting page. -// -//---------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_ttracking_setting_page - { - number = EAknSettingPageNoOrdinalDisplayed; - label = qtn_drm_set_popup_trans_track; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - type = EAknSetListBox; - editor_resource_id = r_drm_settings_setting_listbox; - } - - -//---------------------------------------------------- -// -// r_ttracking_setting_page_lbx -// Transaction tracking setting page's listbox. -// -//---------------------------------------------------- -// -RESOURCE ARRAY r_ttracking_setting_page_lbx - { - items = - { - LBUF - { - txt = qtn_set_transact_tracking_on; - }, - LBUF - { - txt = qtn_set_transact_tracking_off; - } - }; - } - - -//---------------------------------------------------- -// r_drm_settings_ttracking_on -// -// DRM Settings text for Transaction tracking "On" -//---------------------------------------------------- -// -RESOURCE TBUF r_drm_settings_ttracking_on - { - buf = qtn_set_transact_tracking_on; - } - - -//---------------------------------------------------- -// r_drm_settings_ttracking_off -// -// DRM Settings text for Transaction tracking "Off" -//---------------------------------------------------- -// -RESOURCE TBUF r_drm_settings_ttracking_off - { - buf = qtn_set_transact_tracking_off; - } - - -//---------------------------------------------------- -// -// r_autom_activ_setting_page -// Automatic activation setting page. -// -//---------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_autom_activ_setting_page - { - number = EAknSettingPageNoOrdinalDisplayed; - label = qtn_drm_set_popup_autom_activat; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - type = EAknSetListBox; - editor_resource_id = r_drm_settings_setting_listbox; - } - - -//---------------------------------------------------- -// -// r_autom_activ_setting_page_lbx -// Automatic activation setting page's listbox. -// -//---------------------------------------------------- -// -RESOURCE ARRAY r_autom_activ_setting_page_lbx - { - items = - { - LBUF - { - txt = qtn_set_automat_act_allowed; - }, - LBUF - { - txt = qtn_set_automat_act_not_allowed; - } - }; - } - - -//---------------------------------------------------- -// r_drm_settings_autom_activ_on -// -// DRM Settings text for Automatic activation "Allowed" -//---------------------------------------------------- -// -RESOURCE TBUF r_drm_settings_autom_activ_on - { - buf = qtn_set_automat_act_allowed; - } - - -//---------------------------------------------------- -// r_drm_settings_autom_activ_off -// -// DRM Settings text for Automatic activation "Not allowed" -//---------------------------------------------------- -// -RESOURCE TBUF r_drm_settings_autom_activ_off - { - buf = qtn_set_automat_act_not_allowed; - } - -// --------------------------------------------------------- -// -// r_drm_settings_metering_checkbox_page -// Used in checkbox list. -// -// --------------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_drm_settings_metering_checkbox_page - { - number = EAknSettingPageNoOrdinalDisplayed; - label = qtn_drm_set_popup_usage_report; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__MARK; - type = EAknSetListBox; - editor_resource_id = r_drm_settings_metering_checkbox_list; - invalid_contents_softkey_resource = R_AVKON_SOFTKEYS_CANCEL; - } - -// --------------------------------------------------------- -// -// r_drm_settings_metering_checkbox_list -// Used in checkbox list. -// -// --------------------------------------------------------- -// -RESOURCE AVKON_MULTISELECTION_LIST r_drm_settings_metering_checkbox_list - { - } - -//------------------------------------------------------------------------------ -// -// r_usage_reporting_list_title -// Title text for usage reporting listbox -// -//------------------------------------------------------------------------------ -// -RESOURCE TBUF r_usage_reporting_list_title - { - buf=qtn_drm_set_popup_usage_report; - } - - -//------------------------------------------------------------------------------ -// -// r_usage_reporting_list_empty -// Empty text for usage reporting listbox -// -//------------------------------------------------------------------------------ -// -RESOURCE TBUF r_usage_reporting_list_empty - { - buf=qtn_drm_set_pane_no_providers; - } - - -//------------------------------------------------------------------------------ -// -// r_drm_set_several_services -// 'Several' value for 'Allow usage reporting for' field -// -//------------------------------------------------------------------------------ -// -RESOURCE TBUF r_drm_set_several_services - { - buf=qtn_drm_set_several_services; - } - - -//------------------------------------------------------------------------------ -// -// r_drm_set_usage_report_none -// 'None' value for 'Allow usage reporting for' field -// -//------------------------------------------------------------------------------ -// -RESOURCE TBUF r_drm_set_usage_report_none - { - buf=qtn_drm_set_usage_report_none; - } - - -//------------------------------------------------------------------------------ -// -// r_drm_confirmation_query_metering -// Confirmation query dialog. -// -//------------------------------------------------------------------------------ -// -RESOURCE DIALOG r_drm_confirmation_query_metering - { - flags=EGeneralQueryFlags; - buttons=R_AVKON_SOFTKEYS_YES_NO__YES; - items= - { - DLG_LINE - { - type=EAknCtQuery; - id=EGeneralQuery; - control= AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationQueryLayout; - label = " "; - }; - } - }; - } - -//------------------------------------------------------------------------------ -// -// r_drm_conf_query_metering -// Confirmation query text. -// -//------------------------------------------------------------------------------ -// -RESOURCE TBUF r_drm_conf_query_metering - { - buf=qtn_drm_conf_query_metering; - } - -//End of File diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/group/drmsettingsplugin.mmp --- a/commondrm/drmsettingsplugin/group/drmsettingsplugin.mmp Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project specification file. -* -*/ - - -#include // For RESOURCE_FILES_DIR -#include - -CAPABILITY CAP_ECOM_PLUGIN -TARGET drmsettingsplugin.dll -TARGETTYPE PLUGIN -UID 0x10009D8D 0x102750CC -VENDORID VID_DEFAULT - - -SOURCEPATH ../src -SOURCE drmsettingspluginimplementationtable.cpp -SOURCE drmsettingsplugin.cpp -SOURCE drmsettingsplugincontainer.cpp -SOURCE drmsettingsmodel.cpp -SOURCE drmsettingsusagecheckbox.cpp -SOURCE drmsettingsusagelist.cpp - -//User include paths -USERINCLUDE ../inc -USERINCLUDE ../data // For *.rh -USERINCLUDE ../../../inc // ADo level inc dir -USERINCLUDE ../../../omadrm/drmengine/roapstorage/inc - -//System include paths -// Default system include paths for middleware layer modules. -// App layer include path needed for help launcher -APP_LAYER_SYSTEMINCLUDE - -SOURCEPATH ../data - -START RESOURCE 102750CC.rss -TARGET drmsettingsplugin.rsc -END - -START RESOURCE drmsettingspluginrsc.rss -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - - -LIBRARY aknskins.lib // for enhanced skinning -LIBRARY aknskinsrv.lib // for enhanced skinning -LIBRARY avkon.lib -LIBRARY bafl.lib -LIBRARY centralrepository.lib -LIBRARY commonengine.lib // For RConeResourceLoader -LIBRARY cone.lib -LIBRARY ecom.lib -LIBRARY efsrv.lib -LIBRARY egul.lib -LIBRARY eikcoctl.lib -LIBRARY eikcore.lib -LIBRARY euser.lib -LIBRARY featmgr.lib // Feature manager -LIBRARY flogger.lib // For GSLogger -LIBRARY gsecomplugin.lib -LIBRARY gsframework.lib // For base classes -LIBRARY gslistbox.lib // For CGSListBoxItemTextArray -LIBRARY hlplch.lib // for "Help" options menu -LIBRARY drmserverinterfaces.lib // Roap storage -LIBRARY charconv.lib - -SMPSAFE -// End of File diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/inc/drmsettingsmodel.h --- a/commondrm/drmsettingsplugin/inc/drmsettingsmodel.h Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: DRMSettinsPlugin model. -* -*/ - -#ifndef DRMSETTINGSMODEL_H -#define DRMSETTINGSMODEL_H - -// INCLUDES -#include -#include -#include "RoapStorageClient.h" - -// FORWARD DECLARATIONS -class CDRMRIContext; - -// CONSTANTS -const TInt KDRMTransactionTrackingDisabled = 0; -const TInt KDRMTransactionTrackingEnabled = 1; - -const TInt KDRMAutomaticActivationNotAllowed = 0; -const TInt KDRMAutomaticActivationAllowed = 1; - - -// CLASS DEFINITIONS - -/** -* CDRMSettingsModel is the model class of DRMSettingsPlugin. -* It provides functions to get and set setting values. -*/ -class CDRMSettingsModel : public CBase - { - - public: // Constructor and destructor - /** - * Two-phased constructor - */ - static CDRMSettingsModel* NewL(); - - /** - * Destructor - */ - ~CDRMSettingsModel(); - - public: // New - - /** - * Get transaction tracking state - * @return KDRMTransactionTrackingDisabled - * KDRMTransactionTrackingEnabled - */ - TInt TransactionTrackingStateL(); - - /** - * Set transaction tracking state - * @param aValue updated value - */ - void SetTransactionTrackingStateL( TInt aValue ); - - /** - * Get automatic activation state - * @return KDRMAutomaticActivationNotAllowed - * KDRMAutomaticActivationAllowed - */ - TInt AutomaticActivationStateL(); - - /** - * Set automatic activation state - * @param aValue updated value - */ - void SetAutomaticActivationStateL( TInt aValue ); - - /** - * Get usage reporting state - * @return count of services for which reporting is allowed - */ - TInt UsageReportingCount(); - - /** - * Get RI alias - * - * @param aIndex : Index of the RI context - * - * @return RI alias name or RI url if no alias available - */ - HBufC* GetSingleRIAliasL( TInt aIndex ); - - /** - * Get the first RI alias, where metering is allowed - * @return RI alias name or RI url if no alias available - */ - HBufC* GetFirstAllowedMeteringRIAliasL(); - - /** - * Get number of RI contexts - * @return number of RIContexts - */ - TInt GetRiContextCount(); - - /** - * Get metering status of RI Context - * - * @param aIndex : Index of the RI context - * - * @return Status of metering - */ - TBool IsMeteringAllowed( TInt aIndex ); - - /** - * Find out if metering is allowed for all RI Contexts - * - * @return Status of metering - */ - TBool IsMeteringAllowedForAll(); - - /** - * Sets the value for metering to be enabled or disabled - * - * @param aIndex : Index of the RI context - * @param aIsAllowed : ETrue if set to allowed, EFalse if not allowed - */ - void SetMeteringStatus( TInt aIndex, TBool aIsAllowed ); - - /** - * Save the changes done to RI Contexs - */ - void SaveMeteringChanges(); - - private: // Private constructors - - /** - * Default C++ contructor - */ - CDRMSettingsModel(); - - /** - * Symbian OS default constructor - * @return void - */ - void ConstructL(); - - private: // Data - - // DRM Settings Central Repository. - CRepository* iDRMSettingsRepository; - - // Roap storage client - Roap::RRoapStorageClient* iRoapStorageClient; - - // List of service providers with which device has been registered - RPointerArray iRIContextList; - - }; - -#endif // DRMSETTINGSMODEL_H - -// End of File diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/inc/drmsettingsplugin.h --- a/commondrm/drmsettingsplugin/inc/drmsettingsplugin.h Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,189 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: View for DRMSettingsPlugin. -* -*/ - - -#ifndef DRMSETTINGSPLUGIN_H -#define DRMSETTINGSPLUGIN_H - -// INCLUDES -#include -#include -#include -#include -#include -#include - -#include "drmsettingsplugincontainer.h" - -//CONSTANTS -const TUid KDRMSettingsPluginUid = { 0x1020750CC }; - -// Listbox item indexes of the transcaction tracking setting items -const TInt KDRMTTItemIndexDisabled = 1; -const TInt KDRMTTItemIndexEnabled = 0; - -// Listbox item indexes of the automatic activation setting items -const TInt KDRMAAItemIndexDisabled = 1; -const TInt KDRMAAItemIndexEnabled = 0; - -// FORWARD DECLARATIONS -class CAknViewAppUi; -class CDRMSettingsPluginContainer; -class CDRMSettingsModel; - -// CLASS DECLARATION - -/** -* CDRMSettingsPlugin view class -* -* View class for DRM Settings plugin -*/ -class CDRMSettingsPlugin : public CGSBaseView - { - - public: // Constructors and destructor - - /** - * Symbian OS two-phased constructor - * @return connection view. - */ - static CDRMSettingsPlugin* NewL( TAny* aInitParams ); - - /** - * Destructor. - */ - ~CDRMSettingsPlugin(); - - private: - /** - * Symbian OS default constructor. - * - */ - void ConstructL(); - - /** - * C++ default constructor. - */ - CDRMSettingsPlugin(); - - public: // from CAknView - - /** - * Returns view id. - * @return An unsigned integer (view id). - */ - TUid Id() const; - - public: // from MEikCommandObserver - - /** - * Handles commands. - * @param aCommand Command to be handled. - * - */ - void HandleCommandL( TInt aCommand ); - - public: //new - - /** - * Updates listbox's item's value. - * @param aItemId An item which is updated. - * - */ - void UpdateListBoxL( TInt aItemId ); - - public: // From CGSPluginInterface - - /** - * @see CGSPluginInterface header file. - */ - void GetCaptionL( TDes& aCaption ) const; - - /** - * @see CGSPluginInterface header file. - */ - TInt PluginProviderCategory() const; - - /** - * @see CGSPluginInterface header file. - */ - TBool Visible() const; - - private: // from CGSBaseView - // - void NewContainerL(); - // - void HandleListBoxSelectionL(); - - private: // new - - /** - * Update transaction tracking setting - */ - void UpdateTransactionTrackingSettingL( TBool aShowSettingPage ); - - /** - * Update automatic activation setting - */ - void UpdateAutomaticActivationSettingL( TBool aShowSettingPage ); - - /** - * Update usage reporting setting - */ - void UpdateUsageReportingSettingL(); - - /** - * Delete WMDRM license store - */ - void DoWMDRMLicenseDeletionL(); - - /** - * Display setting page - * @param aTTState Current state. This will be updated. - * @return ETrue if value is updated. - * EFalse if value is not updated. - */ - TBool ShowTransactionTrackingSettingPageL( TInt& aTTState ); - - /** - * Display setting page - * @param aAAState Current state. This will be updated. - * @return ETrue if value is updated. - * EFalse if value is not updated. - */ - TBool ShowAutomaticActivationSettingPageL( TInt& aAAState ); - - /** - * Get DRMSettingsPlugin's ccontainer. - */ - CDRMSettingsPluginContainer* Container(); - - protected: // From MEikMenuObserver - - void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); - - private: // data - //resource loader - RConeResourceLoader iResourceLoader; - - TBool iWmdrmSupported; - }; - -#endif //DRMSETTINGSPLUGIN_H - -// End of File - diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/inc/drmsettingsplugin.hrh --- a/commondrm/drmsettingsplugin/inc/drmsettingsplugin.hrh Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Contains common definitions for menu id:s -* -*/ - - -#ifndef DRMSETTINGSPLUGIN_HRH -#define DRMSETTINGSPLUGIN_HRH - - -enum TSettingId - { - EDRMSettingsIdAutomaticActivation, - EDRMSettingsIdUsageReporting, - EDRMSettingsIdTransactionTracking, - EDRMSettingsIdWMDRMLicenseDeletion - }; - -enum TMenuCmd - { - EDRMSettingsCmdAppChange = 1, - EDRMSettingsCmdAppChangeMSK - }; - -enum TListBoxItemVisibility - { - EDRMSettingsListBoxItemTypeIsAlwaysVisible = 0, - EDRMSettingsListBoxItemTypeIsDynamic - }; - -#endif // DRMSETTINGSPLUGIN_HRH - -//End of File - diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/inc/drmsettingsplugin.rh --- a/commondrm/drmsettingsplugin/inc/drmsettingsplugin.rh Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Contains common declarations for resources. -* The file can be included only in resource file. -* -*/ - -#ifndef DRMSETTINGSPLUGIN_RH -#define DRMSETTINGSPLUGIN_RH - - -// Global definitions - - -// --------------------------------------------------------- -// drm_settings_feature_array -// Defines a structure to contain information about items -// to be able to included in the listbox. -// --------------------------------------------------------- -// -STRUCT DRM_SETTINGS_FEATURE_ARRAY - { - STRUCT items[]; - } - -// --------------------------------------------------------- -// drm_settings_feature -// Defines a structure that contains information about -// a single listbox item. -// --------------------------------------------------------- -// -STRUCT DRM_SETTINGS_FEATURE - { - LTEXT txt = ""; - WORD item = -1; - BYTE type = EDRMSettingsListBoxItemTypeIsAlwaysVisible; - } - -#endif // DRMSETTINGSPLUGIN_RH -// End of File diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/inc/drmsettingsplugincontainer.h --- a/commondrm/drmsettingsplugin/inc/drmsettingsplugincontainer.h Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Container for DRMSettinsPlugin view. -* -*/ - - -#ifndef DRMSETTINGSPLUGINCONTAINER_H -#define DRMSETTINGSPLUGINCONTAINER_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class CGSListBoxItemTextArray; -class CDRMSettingsModel; - -// CLASS DECLARATION - -/** -* CDRMSettingsPluginContainer container class -* @since Series 60_3.1 -* -* Container class for DRM Settings view -*/ -class CDRMSettingsPluginContainer : public CGSBaseContainer - { - - public: // Constructors and destructor - - /** - * Symbian OS constructor. - * @param aRect Listbox's rect. - */ - void ConstructL( const TRect& aRect ); - - CDRMSettingsPluginContainer( TBool aWmdrmSupported ); - - /** - * Destructor. - */ - ~CDRMSettingsPluginContainer(); - - public: // new - - /** - * Updates listbox's item's value. - * @param aFeatureId An item which is updated. - */ - void UpdateListBoxL( TInt aFeatureId ); - - /** - * Retrieves the currently selected listbox feature id - * @return feature id. - */ - TInt CurrentFeatureId() const; - - /** - * @return Model for the plugin. - */ - CDRMSettingsModel* Model(); - - protected: // from CGSBaseContainer - - /** - * See base class. - */ - void ConstructListBoxL( TInt aResLbxId ); - - private: // new - - void CreateListBoxItemsL(); - void MakeTransactionTrackingItemL(); - void MakeAutomaticActivationItemL(); - void MakeUsageReportingItemL(); - void MakeWMDRMLicenseDeletionItemL(); - - private: - - /** - * Required for help. - */ - void GetHelpContext( TCoeHelpContext& aContext ) const; - - private: // data - - // GS listbox item array - CGSListBoxItemTextArray* iListboxItemArray; - - // Model for DRMSettingsPlugin. - CDRMSettingsModel* iModel; - TBool iWmdrmSupported; - }; - -#endif //DRMSETTINGSPLUGINCONTAINER_H - -// End of File diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/inc/drmsettingsusagecheckbox.h --- a/commondrm/drmsettingsplugin/inc/drmsettingsusagecheckbox.h Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: CheckBox class for Usage Reporting settings -* -*/ - - -#ifndef C_DRMSETTINGSUSAGECHECKBOX_H -#define C_DRMSETTINGSUSAGECHECKBOX_H - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CDRMSettingUsageList; -class CDRMSettingsModel; -class CAknInfoPopupNoteController; -class CDRMSettingsPlugin; - -/** - * CDrmSettingUsageCheckBox class - */ -NONSHARABLE_CLASS( CDrmSettingUsageCheckBox ) : public CAknCheckBoxSettingPage - { - - public: // New functions - - /** - * C++ default constructor. - */ - CDrmSettingUsageCheckBox( TInt aResourceId, - CDRMSettingUsageList* aList, - CDRMSettingsModel* aModel, - CDRMSettingsPlugin* aPlugin ); - - /** - * Destructor. - */ - virtual ~CDrmSettingUsageCheckBox(); - - private: // From CAknSettingPage - - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ); - - void DynamicInitL(); - - TBool OkToExitL(TBool aAccept); - - void AcceptSettingL(); - - private: // New functions - - void ShowInfoPopupL(); - - private: // Data - - // Not owned - CDRMSettingUsageList* iList; - - // Not owned - CDRMSettingsModel* iModel; - - // Owned - CAknInfoPopupNoteController* iPopupController; - - // Pointer to CDrmSettingsPlugin instance - CDRMSettingsPlugin* iDrmSettingsPlugin; - - }; - -#endif // C_DRMSETTINGSUSAGECHECKBOX_H diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/inc/drmsettingsusagelist.h --- a/commondrm/drmsettingsplugin/inc/drmsettingsusagelist.h Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: List class for Usage Reporting checkbox -* -*/ - - -#ifndef C_DRMSETTINGSUSAGELIST_H -#define C_DRMSETTINGSUSAGELIST_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class CDRMSettingsModel; - -/** - * CDRMSettingUsageList class - */ -NONSHARABLE_CLASS( CDRMSettingUsageList ) : public CSelectionItemList - { - - public: // New functions - - /** - * Two-phased constructor. - */ - static CDRMSettingUsageList* NewL( CDRMSettingsModel* aModel ); - - /** - * Destructor. - */ - virtual ~CDRMSettingUsageList(); - - /** - * Updates contexts - */ - void UpdateContexts(); - - private: - - /** - * Default constructor. - */ - CDRMSettingUsageList( CDRMSettingsModel* aModel ); - - /** - * Symbian OS constructor. - */ - void ConstructL(); - - private: // Data - - // Not owned - CDRMSettingsModel* iModel; - - }; - -#endif // C_DRMSETTINGSUSAGELIST_H \ No newline at end of file diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/src/drmsettingsmodel.cpp --- a/commondrm/drmsettingsplugin/src/drmsettingsmodel.cpp Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,315 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Model for DRMSettinsPlugin. -* -*/ - - -// INCLUDE FILES -#include -#include -#include - -#include "drmsettingsmodel.h" -#include "drmsettingsplugininternalcrkeys.h" -#include "DRMRIContext.h" - -// CONSTANTS -#ifdef _DEBUG -// debug panic -_LIT( KDRMSettingsDebugPanicMessage, "DrmSettingsDebugPanic" ); -const TInt KDRMSettingsDebugPanicCode( 1 ); -#endif - -// ================= MEMBER FUNCTIONS ======================= - - -// ---------------------------------------------------------------------------- -// CDRMSettingsModel::NewL -// -// EPOC two-phased constructor -// ---------------------------------------------------------------------------- -// -CDRMSettingsModel* CDRMSettingsModel::NewL() - { - CDRMSettingsModel* self = new( ELeave ) CDRMSettingsModel; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ---------------------------------------------------------------------------- -// CDRMSettingsModel::CDRMSettingsModel -// -// C++ default constructor can NOT contain any code, that -// might leave. -// ---------------------------------------------------------------------------- -// -CDRMSettingsModel::CDRMSettingsModel() - { - } - - -// ---------------------------------------------------------------------------- -// CDRMSettingsModel::ConstructL -// -// EPOC default constructor can leave. -// ---------------------------------------------------------------------------- -// -void CDRMSettingsModel::ConstructL() - { - // create an instance of Central Repository - iDRMSettingsRepository = CRepository::NewL( KCRUidDRMSettings ); - -#ifdef RD_DRM_METERING - - // Create an instance of roap storage client - iRoapStorageClient = new (ELeave) Roap::RRoapStorageClient; - - // Connect to server - User::LeaveIfError( iRoapStorageClient->Connect() ); - - // Fill the list - iRoapStorageClient->GetAllRIContextsL( iRIContextList ); - -#endif // RD_DRM_METERING - - } - - -// ---------------------------------------------------------------------------- -// CDRMSettingsModel::~CDRMSettingsModel -// -// Destructor -// ---------------------------------------------------------------------------- -// -CDRMSettingsModel::~CDRMSettingsModel() - { - if ( iDRMSettingsRepository ) - { - delete iDRMSettingsRepository; - } - if ( iRoapStorageClient ) - { - iRoapStorageClient->Close(); - delete iRoapStorageClient; - } - - iRIContextList.ResetAndDestroy(); - iRIContextList.Close(); - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsModel::SetTransactionTrackingStateL() -// -// Set transaction tracking state -// --------------------------------------------------------------------------- -// -void CDRMSettingsModel::SetTransactionTrackingStateL( TInt aValue ) - { - User::LeaveIfError( iDRMSettingsRepository-> - Set( KDRMSettingsTransactionTracking, - aValue ) ); - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsModel::TransactionTrackingStateL() -// -// Get transaction tracking state -// --------------------------------------------------------------------------- -// -TInt CDRMSettingsModel::TransactionTrackingStateL() - { - TInt value( KErrNone ); - - User::LeaveIfError( iDRMSettingsRepository->Get( - KDRMSettingsTransactionTracking, - value ) ); - - return value; - } - -// --------------------------------------------------------------------------- -// CDRMSettingsModel::SetAutomaticActivationStateL() -// -// Set automatic activation state -// --------------------------------------------------------------------------- -// -void CDRMSettingsModel::SetAutomaticActivationStateL( TInt aValue ) - { - User::LeaveIfError( iDRMSettingsRepository-> - Set( KDRMSettingsSilentRightsAcquisition, - aValue ) ); - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsModel::AutomaticActivationStateL() -// -// Get automatic activation state -// --------------------------------------------------------------------------- -// -TInt CDRMSettingsModel::AutomaticActivationStateL() - { - TInt value( KErrNone ); - - User::LeaveIfError( iDRMSettingsRepository->Get( - KDRMSettingsSilentRightsAcquisition, - value ) ); - - return value; - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsModel::UsageReportingCount() -// -// Get usage reporting state. Return count of allowed services. -// --------------------------------------------------------------------------- -// -TInt CDRMSettingsModel::UsageReportingCount() - { - TInt count( 0 ); - - for ( TInt i( 0 ); i < iRIContextList.Count(); i++ ) - { - if ( iRIContextList[i]->IsMeteringAllowed() ) - { - count++; - } - } - - return count; - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsModel::GetSingleRIAliasL() -// --------------------------------------------------------------------------- -// -HBufC* CDRMSettingsModel::GetSingleRIAliasL( TInt aIndex ) - { - __ASSERT_DEBUG( aIndex >= 0 || - aIndex < iRIContextList.Count(), - User::Panic( KDRMSettingsDebugPanicMessage, - KDRMSettingsDebugPanicCode ) ); - - HBufC* alias( NULL ); - - if ( &iRIContextList[aIndex]->RIAlias() ) - { - alias = - CnvUtfConverter::ConvertToUnicodeFromUtf8L( - iRIContextList[aIndex]->RIAlias() ); - } - else - { - alias = - CnvUtfConverter::ConvertToUnicodeFromUtf8L( - iRIContextList[aIndex]->RightsIssuerURL() ); - } - - return alias; - } - -// --------------------------------------------------------------------------- -// CDRMSettingsModel::GetFirstAllowedMeteringRIAliasL() -// --------------------------------------------------------------------------- -// -HBufC* CDRMSettingsModel::GetFirstAllowedMeteringRIAliasL() - { - for ( TInt i( 0 ); i < iRIContextList.Count(); i++ ) - { - if( IsMeteringAllowed( i ) ) - { - return GetSingleRIAliasL( i ); - } - } - return NULL; - } - -// --------------------------------------------------------------------------- -// CDRMSettingsModel::GetRiContextCount() -// --------------------------------------------------------------------------- -// -TInt CDRMSettingsModel::GetRiContextCount() - { - return iRIContextList.Count(); - } - -// --------------------------------------------------------------------------- -// CDRMSettingsModel::IsMeteringAllowed() -// --------------------------------------------------------------------------- -// -TBool CDRMSettingsModel::IsMeteringAllowed( TInt aIndex ) - { - __ASSERT_DEBUG( aIndex >= 0 || - aIndex < iRIContextList.Count(), - User::Panic( KDRMSettingsDebugPanicMessage, - KDRMSettingsDebugPanicCode ) ); - - return iRIContextList[aIndex]->IsMeteringAllowed(); - } - -// --------------------------------------------------------------------------- -// CDRMSettingsModel::IsMeteringAllowedForAll() -// --------------------------------------------------------------------------- -// -TBool CDRMSettingsModel::IsMeteringAllowedForAll() - { - TBool isAllowed( ETrue ); - - for ( TInt i( 0 ); i < iRIContextList.Count() && isAllowed; i++ ) - { - if( !IsMeteringAllowed( i ) ) - { - isAllowed = EFalse; - } - } - - return isAllowed; - } - -// --------------------------------------------------------------------------- -// CDRMSettingsModel::SetMeteringStatus() -// --------------------------------------------------------------------------- -// -void CDRMSettingsModel::SetMeteringStatus( TInt aIndex, TBool aIsAllowed ) - { - __ASSERT_DEBUG( aIndex >= 0 || - aIndex < iRIContextList.Count(), - User::Panic( KDRMSettingsDebugPanicMessage, - KDRMSettingsDebugPanicCode ) ); - - iRIContextList[aIndex]->SetMeteringStatus( aIsAllowed ); - } - -// --------------------------------------------------------------------------- -// CDRMSettingsModel::SaveMeteringChanges() -// --------------------------------------------------------------------------- -// -void CDRMSettingsModel::SaveMeteringChanges() - { - for ( TInt i( 0 ); i < iRIContextList.Count(); i++ ) - { - TRAP_IGNORE( - iRoapStorageClient->UpdateRIContextL( *iRIContextList[i] ) ); - } - } - -// End of File diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/src/drmsettingsplugin.cpp --- a/commondrm/drmsettingsplugin/src/drmsettingsplugin.cpp Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,729 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: View for DRMSettinsPlugin -* -*/ - - -// INCLUDE FILES -#include -#include // For HlpLauncher -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "drmsettingsplugin.h" -#include "drmsettingsplugincontainer.h" -#include "drmsettingsplugin.hrh" -#include "drmsettingsmodel.h" -#include "drmsettingsusagecheckbox.h" -#include "drmsettingsusagelist.h" -#include "wmdrmpkclientwrapper.h" - -// CONSTANTS -_LIT( KDRMSettingsPluginResourceFileName, "z:drmsettingspluginrsc.rsc" ); - - -// ============================= LOCAL FUNCTIONS ============================== - -// ========================= MEMBER FUNCTIONS ================================ - -// ---------------------------------------------------------------------------- -// CDRMSettingsPlugin::CDRMSettingsPlugin() -// -// Constructor -// ---------------------------------------------------------------------------- -// -CDRMSettingsPlugin::CDRMSettingsPlugin() - : iResourceLoader( *iCoeEnv ) - { - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPlugin::NewL() -// -// Symbian OS default constructor -// --------------------------------------------------------------------------- -CDRMSettingsPlugin* CDRMSettingsPlugin::NewL( TAny* /*aInitParams*/ ) - { - CDRMSettingsPlugin* self = new( ELeave ) CDRMSettingsPlugin; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - - - -// --------------------------------------------------------------------------- -// CDRMSettingsPlugin::ConstructL() -// -// Symbian OS two-phased constructor -// --------------------------------------------------------------------------- -void CDRMSettingsPlugin::ConstructL() - { - FeatureManager::InitializeLibL(); - // Find the resource file - TParse parse; - parse.Set( KDRMSettingsPluginResourceFileName, - &KDC_RESOURCE_FILES_DIR, - NULL ); - TFileName fileName( parse.FullName() ); - - // Get language of resource file - BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName ); - - // Open resource file - iResourceLoader.OpenL( fileName ); - - BaseConstructL( R_DRM_SETTINGS_VIEW ); - - if ( FeatureManager::FeatureSupported( KFeatureIdWindowsMediaDrm ) ) - { - iWmdrmSupported = ETrue; - } - } - - -// ---------------------------------------------------------------------------- -// CDRMSettingsPlugin::~CDRMSettingsPlugin -// -// Destructor -// ---------------------------------------------------------------------------- -CDRMSettingsPlugin::~CDRMSettingsPlugin() - { - FeatureManager::UnInitializeLib(); - iResourceLoader.Close(); - } - - -// --------------------------------------------------------------------------- -// TUid CDRMSettingsPlugin::Id() -// -// Returns view's ID. -// --------------------------------------------------------------------------- -TUid CDRMSettingsPlugin::Id() const - { - return KDRMSettingsPluginUid; - } - - -// ========================= From CGSPluginInterface ================== - -// ---------------------------------------------------------------------------- -// CDRMSettingsPlugin::GetCaption -// -// Return application/view caption. -// ---------------------------------------------------------------------------- -// -void CDRMSettingsPlugin::GetCaptionL( TDes& aCaption ) const - { - // the resource file is already opened. - HBufC* result( StringLoader::LoadL( R_DRM_SETTINGS_VIEW_CAPTION ) ); - aCaption.Copy( *result ); - delete result; - } - - -// ---------------------------------------------------------------------------- -// CDRMSettingsPlugin::PluginProviderCategory -// -// A means to identify the location of this plug-in in the framework. -// ---------------------------------------------------------------------------- -// -TInt CDRMSettingsPlugin::PluginProviderCategory() const - { - //To identify internal plug-ins. - return KGSPluginProviderInternal; - } - - -// ---------------------------------------------------------------------------- -// CDRMSettingsPlugin::Visible -// -// Provides the visibility status of self to framework. -// ---------------------------------------------------------------------------- -// -TBool CDRMSettingsPlugin::Visible() const - { - TBool visible( EFalse ); - - // The plugin is visible if __DRM_OMA2 or __WINDOWS_MEDIA_DRM are enabled. - if( FeatureManager::FeatureSupported( KFeatureIdDrmOma2 ) || - FeatureManager::FeatureSupported( KFeatureIdWindowsMediaDrm ) ) - { - visible = ETrue; - } - - return visible; - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPlugin::HandleCommandL(TInt aCommand) -// -// Handles commands directed to this class. -// --------------------------------------------------------------------------- -void CDRMSettingsPlugin::HandleCommandL( TInt aCommand ) - { - switch ( aCommand ) - { - case EDRMSettingsCmdAppChangeMSK: - { - const TInt currentFeatureId( Container()->CurrentFeatureId() ); - - switch ( currentFeatureId ) - { -#ifdef __DRM_OMA2 - case EDRMSettingsIdTransactionTracking: - - UpdateTransactionTrackingSettingL( EFalse ); - - break; - -#ifdef RD_DRM_SILENT_RIGHTS_ACQUISITION - case EDRMSettingsIdAutomaticActivation: - - UpdateAutomaticActivationSettingL( EFalse ); - - break; -#endif // RD_DRM_SILENT_RIGHTS_ACQUISITION - -#ifdef RD_DRM_METERING - case EDRMSettingsIdUsageReporting: - - UpdateUsageReportingSettingL(); - - break; -#endif // RD_DRM_METERING -#endif // __DRM_OMA2 - - case EDRMSettingsIdWMDRMLicenseDeletion: - - if ( iWmdrmSupported ) - { - DoWMDRMLicenseDeletionL(); - } - - break; - - default: - - break; - } - - break; - } - case EDRMSettingsCmdAppChange: - { - const TInt currentFeatureId( Container()->CurrentFeatureId() ); - - switch ( currentFeatureId ) - { -#ifdef __DRM_OMA2 - case EDRMSettingsIdTransactionTracking: - - UpdateTransactionTrackingSettingL( ETrue ); - - break; - -#ifdef RD_DRM_SILENT_RIGHTS_ACQUISITION - case EDRMSettingsIdAutomaticActivation: - - UpdateAutomaticActivationSettingL( ETrue ); - - break; -#endif // RD_DRM_SILENT_RIGHTS_ACQUISITION - -#ifdef RD_DRM_METERING - case EDRMSettingsIdUsageReporting: - - UpdateUsageReportingSettingL(); - - break; -#endif // RD_DRM_METERING -#endif // __DRM_OMA2 - - case EDRMSettingsIdWMDRMLicenseDeletion: - - if ( iWmdrmSupported ) - { - DoWMDRMLicenseDeletionL(); - } - - break; - - default: - - break; - } - break; - } - case EAknSoftkeyBack: - - iAppUi->ActivateLocalViewL( KGSSecurityPluginUid ); - - break; - - case EAknCmdHelp: - { - - if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) - { - HlpLauncher::LaunchHelpApplicationL( - iEikonEnv->WsSession(), - iAppUi->AppHelpContextL() ); - } - - break; - - } - default: - - iAppUi->HandleCommandL( aCommand ); - - break; - } - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPlugin::UpdateListBoxL -// -// Updates listbox items. -// --------------------------------------------------------------------------- -// -void CDRMSettingsPlugin::UpdateListBoxL( TInt aItemId ) - { - Container()->UpdateListBoxL( aItemId ); - } - - -// ---------------------------------------------------------------------------- -// CDRMSettingsPlugin::Container -// -// Return handle to container class. -// ---------------------------------------------------------------------------- -// -CDRMSettingsPluginContainer* CDRMSettingsPlugin::Container() - { - return static_cast( iContainer ); - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPlugin::NewContainerL() -// -// Creates new iContainer. -// --------------------------------------------------------------------------- -// -void CDRMSettingsPlugin::NewContainerL() - { - iContainer = new( ELeave ) CDRMSettingsPluginContainer( iWmdrmSupported ); - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPlugin::HandleListBoxSelectionL() -// -// Handles events raised through a rocker key. -// --------------------------------------------------------------------------- -void CDRMSettingsPlugin::HandleListBoxSelectionL() - { - const TInt currentFeatureId( Container()->CurrentFeatureId() ); - - switch ( currentFeatureId ) - { -#ifdef __DRM_OMA2 - case EDRMSettingsIdTransactionTracking: - - UpdateTransactionTrackingSettingL( EFalse ); - - break; - -#ifdef RD_DRM_SILENT_RIGHTS_ACQUISITION - case EDRMSettingsIdAutomaticActivation: - - UpdateAutomaticActivationSettingL( EFalse ); - - break; -#endif // RD_DRM_SILENT_RIGHTS_ACQUISITION - -#ifdef RD_DRM_METERING - case EDRMSettingsIdUsageReporting: - - UpdateUsageReportingSettingL(); - - break; -#endif // RD_DRM_METERING -#endif // __DRM_OMA2 - - case EDRMSettingsIdWMDRMLicenseDeletion: - - if ( iWmdrmSupported ) - { - DoWMDRMLicenseDeletionL(); - } - - break; - - default: - - break; - } - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPlugin::UpdateTransactionTrackingSettingL -// -// Display Transaction tracking setting page. -// --------------------------------------------------------------------------- -// -void CDRMSettingsPlugin::UpdateTransactionTrackingSettingL( TBool aShowSettingPage ) - { - if( FeatureManager::FeatureSupported( KFeatureIdDrmOma2 ) ) - { - TInt currentValue( Container()->Model()->TransactionTrackingStateL() ); - TBool isValueUpdated( EFalse ); - - if ( aShowSettingPage ) - { - isValueUpdated = ShowTransactionTrackingSettingPageL( currentValue ); - } - else - { - switch ( currentValue ) - { - case KDRMTransactionTrackingDisabled: - - currentValue = KDRMTransactionTrackingEnabled; - - break; - - case KDRMTransactionTrackingEnabled: - - currentValue = KDRMTransactionTrackingDisabled; - - break; - - default: - - break; - } - isValueUpdated = ETrue; - } - // If value is updated, store it to model: - if ( isValueUpdated ) - { - Container()->Model()->SetTransactionTrackingStateL( currentValue ); - UpdateListBoxL( EDRMSettingsIdTransactionTracking ); - } - } - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPlugin::ShowTransactionTrackingSettingPageL() -// -// Display transaction tracking setting page. Selected listbox item index -// must be mapped to transaction tracking state because index value is -// different from state value. -// --------------------------------------------------------------------------- -// -TBool CDRMSettingsPlugin::ShowTransactionTrackingSettingPageL( - TInt& aTTState ) - { - // in case DRM Phase 2 is not supported, return EFalse. - TBool isValueUpdated( EFalse ); - TInt selectedTTItemIndex( 0 ); - TInt originalTTState( aTTState ); - - // Set selected listbox item to current transaction tracking state: - switch ( aTTState ) - { - case KDRMTransactionTrackingDisabled: - - selectedTTItemIndex = KDRMTTItemIndexDisabled; - - break; - - case KDRMTransactionTrackingEnabled: - - selectedTTItemIndex = KDRMTTItemIndexEnabled; - - break; - } - - CDesCArrayFlat* items( - iCoeEnv->ReadDesC16ArrayResourceL( R_TTRACKING_SETTING_PAGE_LBX ) ); - CleanupStack::PushL( items ); - CAknRadioButtonSettingPage* dlg( - new (ELeave) CAknRadioButtonSettingPage( R_TTRACKING_SETTING_PAGE, - selectedTTItemIndex, - items ) ); - - dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); - CleanupStack::PopAndDestroy( items ); - - // Map selected listbox item to correct state: - switch ( selectedTTItemIndex ) - { - case KDRMTTItemIndexDisabled: - - aTTState = KDRMTransactionTrackingDisabled; - - break; - - case KDRMTTItemIndexEnabled: - - aTTState = KDRMTransactionTrackingEnabled; - - break; - } - - // Check is value updated: - if( aTTState != originalTTState ) - { - isValueUpdated = ETrue; - } - - return isValueUpdated; - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPlugin::UpdateAutomaticActivationSettingL -// -// Display Automatic activation setting page. -// --------------------------------------------------------------------------- -// -void CDRMSettingsPlugin::UpdateAutomaticActivationSettingL( TBool aShowSettingPage ) - { - if( FeatureManager::FeatureSupported( KFeatureIdDrmOma2 ) ) - { - TInt currentValue( Container()->Model()->AutomaticActivationStateL() ); - TBool isValueUpdated( EFalse ); - - if ( aShowSettingPage ) - { - isValueUpdated = ShowAutomaticActivationSettingPageL( currentValue ); - } - else - { - switch ( currentValue ) - { - case KDRMAutomaticActivationNotAllowed: - - currentValue = KDRMAutomaticActivationAllowed; - - break; - - case KDRMAutomaticActivationAllowed: - - currentValue = KDRMAutomaticActivationNotAllowed; - - break; - - default: - - break; - } - isValueUpdated = ETrue; - } - // If value is updated, store it to model: - if ( isValueUpdated ) - { - Container()->Model()->SetAutomaticActivationStateL( currentValue ); - UpdateListBoxL( EDRMSettingsIdAutomaticActivation ); - } - } - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPlugin::ShowAutomaticActivationSettingPageL() -// -// Display Automatic activation setting page. Selected listbox item index -// must be mapped to automatic activation state because index value is -// different from state value. -// --------------------------------------------------------------------------- -// -TBool CDRMSettingsPlugin::ShowAutomaticActivationSettingPageL( - TInt& aAAState ) - { - // in case DRM Phase 2 is not supported, return EFalse. - TBool isValueUpdated( EFalse ); - TInt selectedAAItemIndex( 0 ); - TInt originalAAState( aAAState ); - - // Set selected listbox item to current state: - switch ( aAAState ) - { - case KDRMAutomaticActivationNotAllowed: - - selectedAAItemIndex = KDRMAAItemIndexDisabled; - - break; - - case KDRMAutomaticActivationAllowed: - - selectedAAItemIndex = KDRMAAItemIndexEnabled; - - break; - } - - CDesCArrayFlat* items( - iCoeEnv->ReadDesC16ArrayResourceL( R_AUTOM_ACTIV_SETTING_PAGE_LBX ) ); - CleanupStack::PushL( items ); - CAknRadioButtonSettingPage* dlg( - new (ELeave) CAknRadioButtonSettingPage( R_AUTOM_ACTIV_SETTING_PAGE, - selectedAAItemIndex, - items ) ); - - dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); - CleanupStack::PopAndDestroy( items ); - - // Map selected listbox item to correct state: - switch ( selectedAAItemIndex ) - { - case KDRMAAItemIndexDisabled: - - aAAState = KDRMAutomaticActivationNotAllowed; - - break; - - case KDRMAAItemIndexEnabled: - - aAAState = KDRMAutomaticActivationAllowed; - - break; - - } - - // Check is value updated: - if( aAAState != originalAAState ) - { - isValueUpdated = ETrue; - } - - return isValueUpdated; - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPlugin::UpdateUsageReportingSettingL -// -// Display Usage Reporting setting page. -// --------------------------------------------------------------------------- -// -void CDRMSettingsPlugin::UpdateUsageReportingSettingL() - { - TBool isValueUpdated( EFalse ); - - if( FeatureManager::FeatureSupported( KFeatureIdDrmOma2 ) ) - { - CDRMSettingsModel* model( this->Container()->Model() ); - - CDRMSettingUsageList* usageList( CDRMSettingUsageList::NewL( model ) ); - CleanupStack::PushL( usageList ); - - CDrmSettingUsageCheckBox* usageCheckBox( - new (ELeave) CDrmSettingUsageCheckBox( - R_DRM_SETTINGS_METERING_CHECKBOX_PAGE, - usageList, - model, - this ) ); - - isValueUpdated = - usageCheckBox->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted ); - - CleanupStack::PopAndDestroy( usageList ); - } - - if ( isValueUpdated ) - { - UpdateListBoxL( EDRMSettingsIdUsageReporting ); - } - } - -// --------------------------------------------------------------------------- -// CDRMSettingsPlugin::DoWMDRMLicenseDeletionL -// -// Display WMDRM license deletion setting page. -// --------------------------------------------------------------------------- -// -void CDRMSettingsPlugin::DoWMDRMLicenseDeletionL() - { - if ( iWmdrmSupported ) - { - TInt r = KErrNone; - RLibrary library; - r = library.Load( KWmdrmPkClientWrapperName ); - if( !r ) - { - CleanupClosePushL( library ); - CWmDrmPkClientWrapper* wrapper = - (CWmDrmPkClientWrapper*)library.Lookup( KWmdrmPkClientNewL )(); - CleanupStack::PushL( wrapper ); - User::LeaveIfError( wrapper->Connect() ); - wrapper->DeleteRights(); - wrapper->Close(); - CleanupStack::PopAndDestroy( 2, &library ); - } - } - } - -// ---------------------------------------------------------------------------- -// CDRMSettingsPlugin::DynInitMenuPaneL() -// -// Display the dynamic menu -// ---------------------------------------------------------------------------- -void CDRMSettingsPlugin::DynInitMenuPaneL( - TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - // show or hide the 'help' menu item when supported - if( aResourceId == R_DRM_SETTINGS_MENU_ITEM_EXIT ) - { - User::LeaveIfNull( aMenuPane ); - -#ifdef __DRM_OMA2 - if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) - { - aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); - } - else - { - aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); - } -#else - - aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); - -#endif // __DRM_OMA2 - } - } - - - -// End of File diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/src/drmsettingsplugincontainer.cpp --- a/commondrm/drmsettingsplugin/src/drmsettingsplugincontainer.cpp Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,336 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Container for DRMSettinsPlugin -* -*/ - - -// INCLUDE FILES -#include -#include -#include -#include -#include -#include - -#include "drmsettingsplugincontainer.h" -#include "drmsettingsplugin.hrh" -#include "drmsettingsmodel.h" - -const TUid KUidRightsManager = { 0x101F85C7 }; - -// ========================= MEMBER FUNCTIONS ================================ - -// --------------------------------------------------------------------------- -// CDRMSettingsPluginContainer::ConstructL() -// -// Symbian OS two phased constructor -// --------------------------------------------------------------------------- -// -void CDRMSettingsPluginContainer::ConstructL( const TRect& aRect ) - { - iListBox = new( ELeave ) CAknSettingStyleListBox; - iModel = CDRMSettingsModel::NewL(); - BaseConstructL( aRect, R_DRM_SETTINGS_VIEW_TITLE, R_DRM_SETTINGS_LBX ); - } - -// --------------------------------------------------------------------------- -// CDRMSettingsPluginContainer::CDRMSettingsPluginContainer() -// -// Constructor -// --------------------------------------------------------------------------- -// -CDRMSettingsPluginContainer::CDRMSettingsPluginContainer( - TBool aWmdrmSupported ) : iWmdrmSupported( aWmdrmSupported ) - { - } - -// --------------------------------------------------------------------------- -// CDRMSettingsPluginContainer::~CDRMSettingsPluginContainer() -// -// Destructor -// --------------------------------------------------------------------------- -// -CDRMSettingsPluginContainer::~CDRMSettingsPluginContainer() - { - if ( iModel ) - { - delete iModel; - } - // delete listbox item array - if ( iListboxItemArray ) - { - delete iListboxItemArray; - } - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPluginContainer::ConstructListBoxL() -// -// Construct the listbox from resource array. -// --------------------------------------------------------------------------- -// -void CDRMSettingsPluginContainer::ConstructListBoxL( TInt aResLbxId ) - { - iListBox->ConstructL( this, EAknListBoxSelectionList /* | - EAknListBoxItemSpecificMenuDisabled */ ); - iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, - *iListBox, - *iCoeEnv ); - iListBox->Model()->SetItemTextArray( iListboxItemArray ); - iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); - CreateListBoxItemsL(); - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPluginContainer::CreateListBoxItemsL() -// -// Create listbox items. -// --------------------------------------------------------------------------- -// -void CDRMSettingsPluginContainer::CreateListBoxItemsL() - { -#ifdef __DRM_OMA2 - MakeTransactionTrackingItemL(); - -#ifdef RD_DRM_SILENT_RIGHTS_ACQUISITION - MakeAutomaticActivationItemL(); -#endif // RD_DRM_SILENT_RIGHTS_ACQUISITION - -#ifdef RD_DRM_METERING - MakeUsageReportingItemL(); -#endif // RD_DRM_METERING -#endif // __DRM_OMA2 - - - MakeWMDRMLicenseDeletionItemL(); - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPluginContainer::UpdateListBoxL() -// -// Update listbox item. -// --------------------------------------------------------------------------- -// -void CDRMSettingsPluginContainer::UpdateListBoxL( TInt aFeatureId ) - { - switch( aFeatureId ) - { -#ifdef __DRM_OMA2 - case EDRMSettingsIdTransactionTracking: - MakeTransactionTrackingItemL(); - break; - -#ifdef RD_DRM_SILENT_RIGHTS_ACQUISITION - case EDRMSettingsIdAutomaticActivation: - MakeAutomaticActivationItemL(); - break; -#endif // RD_DRM_SILENT_RIGHTS_ACQUISITION - -#ifdef RD_DRM_METERING - case EDRMSettingsIdUsageReporting: - MakeUsageReportingItemL(); - break; -#endif // RD_DRM_METERING -#endif // __DRM_OMA2 - - case EDRMSettingsIdWMDRMLicenseDeletion: - - MakeWMDRMLicenseDeletionItemL(); - - break; - - default: - break; - } - - iListBox->HandleItemAdditionL(); - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPluginContainer::MakeTransactionTrackingItemL() -// -// Create Transaction tracking list item -// --------------------------------------------------------------------------- -// -void CDRMSettingsPluginContainer::MakeTransactionTrackingItemL() - { - HBufC* dynamicText( NULL ); - TInt trxTrState( iModel->TransactionTrackingStateL() ); - - switch ( trxTrState ) - { - case KDRMTransactionTrackingEnabled: - dynamicText = StringLoader::LoadLC( R_DRM_SETTINGS_TTRACKING_ON ); - break; - default: - dynamicText = StringLoader::LoadLC( R_DRM_SETTINGS_TTRACKING_OFF ); - break; - } - - TPtr ptrBuffer ( dynamicText->Des() ); - - - // Finally, set the dynamic text - iListboxItemArray->SetDynamicTextL( EDRMSettingsIdTransactionTracking, ptrBuffer ); - - CleanupStack::PopAndDestroy( dynamicText ); - - // And add to listbox - iListboxItemArray->SetItemVisibilityL( EDRMSettingsIdTransactionTracking, - CGSListBoxItemTextArray::EVisible ); - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPluginContainer::MakeAutomaticActivationItemL() -// -// Create Automatic activation list item -// --------------------------------------------------------------------------- -// -void CDRMSettingsPluginContainer::MakeAutomaticActivationItemL() - { - TInt automActivState( iModel->AutomaticActivationStateL() ); - - HBufC* dynamicText( NULL ); - - switch ( automActivState ) - { - case KDRMTransactionTrackingEnabled: - dynamicText = StringLoader::LoadLC( R_DRM_SETTINGS_AUTOM_ACTIV_ON ); - break; - default: - dynamicText = StringLoader::LoadLC( R_DRM_SETTINGS_AUTOM_ACTIV_OFF ); - break; - } - - TPtr ptrBuffer ( dynamicText->Des() ); - - // Finally, set the dynamic text - iListboxItemArray->SetDynamicTextL( EDRMSettingsIdAutomaticActivation, - ptrBuffer ); - - CleanupStack::PopAndDestroy( dynamicText ); - - // And add to listbox - iListboxItemArray->SetItemVisibilityL( EDRMSettingsIdAutomaticActivation, - CGSListBoxItemTextArray::EVisible ); - } - -// --------------------------------------------------------------------------- -// CDRMSettingsPluginContainer::MakeUsageReportingItemL() -// -// Create Usage reporting list item -// --------------------------------------------------------------------------- -// -void CDRMSettingsPluginContainer::MakeUsageReportingItemL() - { - TInt count( iModel->UsageReportingCount() ); - - HBufC* dynamicText( NULL ); - - switch ( count ) - { - case 0: - dynamicText = StringLoader::LoadL( R_DRM_SET_USAGE_REPORT_NONE ); - break; - case 1: - dynamicText = iModel->GetFirstAllowedMeteringRIAliasL(); - break; - default: - dynamicText = StringLoader::LoadL( R_DRM_SET_SEVERAL_SERVICES ); - break; - } - CleanupStack::PushL( dynamicText ); - - TPtr ptrBuffer ( dynamicText->Des() ); - - // Finally, set the dynamic text - iListboxItemArray->SetDynamicTextL( EDRMSettingsIdUsageReporting, - ptrBuffer ); - - CleanupStack::PopAndDestroy( dynamicText ); - - // And add to listbox - iListboxItemArray->SetItemVisibilityL( EDRMSettingsIdUsageReporting, - CGSListBoxItemTextArray::EVisible ); - } - -// --------------------------------------------------------------------------- -// CDRMSettingsPluginContainer::MakeWMDRMLicenseDeletionItemL() -// -// Create WMDRM license deletion list item -// --------------------------------------------------------------------------- -// -void CDRMSettingsPluginContainer::MakeWMDRMLicenseDeletionItemL() - { - if ( iWmdrmSupported ) - { - // Add to listbox - iListboxItemArray-> - SetItemVisibilityL( EDRMSettingsIdWMDRMLicenseDeletion, - CGSListBoxItemTextArray::EVisible ); - } - else - { - // Add to listbox - iListboxItemArray-> - SetItemVisibilityL( EDRMSettingsIdWMDRMLicenseDeletion, - CGSListBoxItemTextArray::EInvisible ); - - } - } - -// --------------------------------------------------------------------------- -// CDRMSettingsPluginContainer::GetHelpContext() const -// -// Gets Help -// --------------------------------------------------------------------------- -// -void CDRMSettingsPluginContainer::GetHelpContext( - TCoeHelpContext& aContext ) const - { - aContext.iMajor = KUidRightsManager; - aContext.iContext = KSET_HLP_PROTECTED_CONTENT; - } - - -// --------------------------------------------------------------------------- -// CDRMSettingsPluginContainer::CurrentFeatureId() -// -// Return the feature id of selected listitem -// --------------------------------------------------------------------------- -// -TInt CDRMSettingsPluginContainer::CurrentFeatureId( ) const - { - return iListboxItemArray->CurrentFeature(); - } - - -// ----------------------------------------------------------------------------- -// CDRMSettingsPluginContainer::Model() -// -// -// ----------------------------------------------------------------------------- -// -CDRMSettingsModel* CDRMSettingsPluginContainer::Model() - { - return iModel; - } - -// End of File diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/src/drmsettingspluginimplementationtable.cpp --- a/commondrm/drmsettingsplugin/src/drmsettingspluginimplementationtable.cpp Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2006 - 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ECOM proxy table for DRMSettinsPlugin -* -*/ - - -// INCLUDES -#include -#include - -#include "drmsettingsplugin.h" - - -// CONSTANTS -const TImplementationProxy KDRMSettingsPluginImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( 0x102750CD, CDRMSettingsPlugin::NewL ) - }; - - -// --------------------------------------------------------------------------- -// ImplementationGroupProxy -// -// Gate/factory function -// --------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( - TInt& aTableCount ) - { - aTableCount = sizeof( KDRMSettingsPluginImplementationTable ) - / sizeof( TImplementationProxy ); - return KDRMSettingsPluginImplementationTable; - } - - - -// End of File diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/src/drmsettingsusagecheckbox.cpp --- a/commondrm/drmsettingsplugin/src/drmsettingsusagecheckbox.cpp Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: CheckBox class for Usage Reporting settings -* -*/ - - -// INCLUDE FILES -#include -#include -#include -#include - -#include "drmsettingsusagecheckbox.h" -#include "drmsettingsusagelist.h" -#include "drmsettingsmodel.h" -#include "drmsettingsplugin.h" - -// ================= MEMBER FUNCTIONS ======================= - -// ----------------------------------------------------------------------------- -// CDrmSettingUsageCheckBox::CDrmSettingUsageCheckBox -// Default constructor. -// ----------------------------------------------------------------------------- -// -CDrmSettingUsageCheckBox::CDrmSettingUsageCheckBox( - TInt aResourceId, - CDRMSettingUsageList* aList, - CDRMSettingsModel* aModel, - CDRMSettingsPlugin* aPlugin ) : CAknCheckBoxSettingPage( aResourceId, aList ), - iList( aList ), - iModel( aModel ), - iDrmSettingsPlugin( aPlugin ) - { - } - -// ---------------------------------------------------------------------------- -// CDrmSettingUsageCheckBox::~CDrmSettingUsageCheckBox -// -// Destructor -// ---------------------------------------------------------------------------- -// -CDrmSettingUsageCheckBox::~CDrmSettingUsageCheckBox() - { - delete iPopupController; - } - -// ----------------------------------------------------------------------------- -// CDrmSettingUsageCheckBox::OfferKeyEventL -// ----------------------------------------------------------------------------- -// -TKeyResponse CDrmSettingUsageCheckBox::OfferKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - TKeyResponse response( EKeyWasNotConsumed ); - if ( aKeyEvent.iCode != EKeyApplicationF ) - { - response = this->ListBoxControl()->OfferKeyEventL( aKeyEvent, aType ); - } - - if ( aType == EEventKeyUp ) - { - ShowInfoPopupL(); - } - - if ( ( aType == EEventKey ) && ( aKeyEvent.iCode == EKeyEscape ) ) - { - iDrmSettingsPlugin->HandleCommandL( EEikCmdExit ); - } - - return response; - } - -// ----------------------------------------------------------------------------- -// CDrmSettingUsageCheckBox::DynamicInitL -// ----------------------------------------------------------------------------- -// -void CDrmSettingUsageCheckBox::DynamicInitL() - { - HBufC* emptyText( StringLoader::LoadLC( R_USAGE_REPORTING_LIST_EMPTY, - iEikonEnv ) ); - this->ListBoxControl()->View()->SetListEmptyTextL( *emptyText ); - CleanupStack::PopAndDestroy( emptyText ); - } - -// ----------------------------------------------------------------------------- -// CDrmSettingUsageCheckBox::OkToExitL -// ----------------------------------------------------------------------------- -// -TBool CDrmSettingUsageCheckBox::OkToExitL( TBool aAccept ) - { - TBool exit( ETrue ); - - if ( aAccept ) - { - iList->UpdateContexts(); - - if ( !iModel->IsMeteringAllowedForAll() ) - { - HBufC* query( StringLoader::LoadLC( R_DRM_CONF_QUERY_METERING, - iEikonEnv ) ); - - CAknQueryDialog* queryDialog( CAknQueryDialog::NewL() ); - - TBool retVal( queryDialog->ExecuteLD( R_DRM_CONFIRMATION_QUERY_METERING, - *query ) ); - CleanupStack::PopAndDestroy( query ); - - if ( !retVal ) - { - exit = EFalse; - } - } - } - - return exit; - } - -// ----------------------------------------------------------------------------- -// CDrmSettingUsageCheckBox::AcceptSettingL -// ----------------------------------------------------------------------------- -// -void CDrmSettingUsageCheckBox::AcceptSettingL() - { - iModel->SaveMeteringChanges(); - } - -// ----------------------------------------------------------------------------- -// CDrmSettingUsageCheckBox::ShowInfoPopupL -// ----------------------------------------------------------------------------- -// -void CDrmSettingUsageCheckBox::ShowInfoPopupL() - { - if ( !iPopupController ) - { - iPopupController = CAknInfoPopupNoteController::NewL(); - } - TInt index( this->ListBoxControl()->View()->CurrentItemIndex() ); - if ( index != -1 ) - { - iPopupController->SetTextL( iList->At(index)->ItemText() ); - iPopupController->ShowInfoPopupNote(); - } - } - -// End of File diff -r 3bdc3b853094 -r 908beac81e0a commondrm/drmsettingsplugin/src/drmsettingsusagelist.cpp --- a/commondrm/drmsettingsplugin/src/drmsettingsusagelist.cpp Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: List class for Usage Reporting checkbox -* -*/ - - -// INCLUDE FILES -#include "drmsettingsusagelist.h" -#include "drmsettingsmodel.h" - -// CONSTANTS -const TInt KDRMSettingsListGranularity( 5 ); - -// ================= MEMBER FUNCTIONS ======================= - -// ---------------------------------------------------------------------------- -// CDRMSettingUsageList::NewL -// Two-phased constructor. -// ---------------------------------------------------------------------------- -// -CDRMSettingUsageList* CDRMSettingUsageList::NewL( - CDRMSettingsModel* aModel ) - { - CDRMSettingUsageList* self( - new( ELeave ) CDRMSettingUsageList( aModel ) ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ---------------------------------------------------------------------------- -// CDRMSettingUsageList::CDRMSettingUsageList -// Default constructor. -// ---------------------------------------------------------------------------- -// -CDRMSettingUsageList::CDRMSettingUsageList( CDRMSettingsModel* aModel ) - : CSelectionItemList( KDRMSettingsListGranularity ), iModel( aModel ) - { - } - -// ---------------------------------------------------------------------------- -// CDRMSettingUsageList::ConstructL -// ---------------------------------------------------------------------------- -// -void CDRMSettingUsageList::ConstructL() - { - for ( TInt i( 0 ); i < iModel->GetRiContextCount(); i++ ) - { - HBufC* alias( iModel->GetSingleRIAliasL( i ) ); - CleanupStack::PushL( alias ); - TBool isAllowed( iModel->IsMeteringAllowed( i ) ); - CSelectableItem* selItem( new (ELeave) CSelectableItem( *alias, - isAllowed ) ); - selItem->ConstructL(); - this->AppendL( selItem ); - CleanupStack::PopAndDestroy( alias ); - } - } - -// ---------------------------------------------------------------------------- -// CDRMSettingUsageList::~CDRMSettingUsageList -// -// Destructor -// ---------------------------------------------------------------------------- -// -CDRMSettingUsageList::~CDRMSettingUsageList() - { - this->ResetAndDestroy(); - } - -// ---------------------------------------------------------------------------- -// CDRMSettingUsageList::UpdateContexts -// ---------------------------------------------------------------------------- -// -void CDRMSettingUsageList::UpdateContexts() - { - for ( TInt i( 0 ); i < iModel->GetRiContextCount(); i++ ) - { - CSelectableItem* selItem( this->At( i ) ); - iModel->SetMeteringStatus( i, selItem->SelectionStatus() ); - } - } - -// End of File diff -r 3bdc3b853094 -r 908beac81e0a commondrm/group/bld.inf --- a/commondrm/group/bld.inf Mon May 03 12:46:34 2010 +0300 +++ b/commondrm/group/bld.inf Fri May 14 16:07:34 2010 +0300 @@ -39,8 +39,6 @@ ../rom/DRMEncryptorResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( drmencryptorresources.iby ) ../rom/DRMRightsManagerUI.iby CORE_MW_LAYER_IBY_EXPORT_PATH( drmrightsmanagerui.iby ) ../rom/DRMRightsManagerUIResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( drmrightsmanageruiresources.iby ) -../rom/drmsettingsplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( drmsettingsplugin.iby ) -../rom/drmsettingspluginresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( drmsettingspluginresources.iby ) ../rom/drmutility.iby CORE_MW_LAYER_IBY_EXPORT_PATH( drmutility.iby ) ../rom/drmutility_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( drmutility_resources.iby ) ../rom/drmserviceapiwrapper.iby CORE_MW_LAYER_IBY_EXPORT_PATH( drmserviceapiwrapper.iby ) @@ -51,9 +49,6 @@ // DRMEncryptor ../drmencryptor/group/DRMEncryptor.mmp -// DRMSettingsPlugin -../drmsettingsplugin/group/drmsettingsplugin.mmp - // DRMRightsManagerUi ../drmrightsmanagerui/group/DRMRightsManager.mmp diff -r 3bdc3b853094 -r 908beac81e0a commondrm/rom/drmsettingsplugin.iby --- a/commondrm/rom/drmsettingsplugin.iby Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: DRMSettingsPlugin ROM resources -* -*/ - -#ifndef DRMSETTINGSPLUGIN_IBY -#define DRMSETTINGSPLUGIN_IBY - -ECOM_PLUGIN( drmsettingsplugin.dll, 102750CC.rsc ) -//data=DATAZ_\BITMAP_DIR\drmsettingsplugin.mif BITMAP_DIR\drmsettingsplugin.mif - -data=ZSYSTEM\install\commondrm_stub.SIS \system\install\commondrm_stub.SIS -#endif // DRMSETTINGSPLUGIN_IBY -// End of File diff -r 3bdc3b853094 -r 908beac81e0a commondrm/rom/drmsettingspluginresources.iby --- a/commondrm/rom/drmsettingspluginresources.iby Mon May 03 12:46:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: DRMSettingsPlugin ROM resources. -* -*/ - -#ifndef DRMSETTINGSPLUGINRESOURCES_IBY -#define DRMSETTINGSPLUGINRESOURCES_IBY - -data=DATAZ_\RESOURCE_FILES_DIR\drmsettingspluginrsc.rsc RESOURCE_FILES_DIR\drmsettingspluginrsc.rsc - -#endif // DRMSETTINGSPLUGINRESOURCES_IBY -// End of File diff -r 3bdc3b853094 -r 908beac81e0a drm_plat/dcf_repository_api/inc/DcfRep.h --- a/drm_plat/dcf_repository_api/inc/DcfRep.h Mon May 03 12:46:34 2010 +0300 +++ b/drm_plat/dcf_repository_api/inc/DcfRep.h Fri May 14 16:07:34 2010 +0300 @@ -23,8 +23,8 @@ // INCLUDES #include #include -#include -#include "dcfrepcli.h" +#include +#include "DcfRepCli.h" // CONSTANTS // MACROS // DATA TYPES diff -r 3bdc3b853094 -r 908beac81e0a drm_plat/drm_common_api/inc/DRMCommon.h --- a/drm_plat/drm_common_api/inc/DRMCommon.h Mon May 03 12:46:34 2010 +0300 +++ b/drm_plat/drm_common_api/inc/DRMCommon.h Fri May 14 16:07:34 2010 +0300 @@ -21,7 +21,7 @@ #define DRMCOMMON_H #include -#include +#include #include const TUint KDrmMaxContentInfoSize = 512; diff -r 3bdc3b853094 -r 908beac81e0a drm_plat/drm_common_api/tsrc/data/mmc/DRM/content.dcf diff -r 3bdc3b853094 -r 908beac81e0a drm_plat/drm_rights_api/inc/DcfCommon.h --- a/drm_plat/drm_rights_api/inc/DcfCommon.h Mon May 03 12:46:34 2010 +0300 +++ b/drm_plat/drm_rights_api/inc/DcfCommon.h Fri May 14 16:07:34 2010 +0300 @@ -23,8 +23,8 @@ // INCLUDES #include #include -#include -#include +#include +#include using namespace ContentAccess; // CONSTANTS diff -r 3bdc3b853094 -r 908beac81e0a drm_plat/drm_rights_api/tsrc/data/c/content.dcf diff -r 3bdc3b853094 -r 908beac81e0a drm_plat/drm_service_api/inc/drmserviceapi.h --- a/drm_plat/drm_service_api/inc/drmserviceapi.h Mon May 03 12:46:34 2010 +0300 +++ b/drm_plat/drm_service_api/inc/drmserviceapi.h Fri May 14 16:07:34 2010 +0300 @@ -21,7 +21,7 @@ #define C_CDRMSERVICEAPI_H #include -#include "drmtypes.h" +#include "DRMTypes.h" // Forward declarations class RDRMClockClient; diff -r 3bdc3b853094 -r 908beac81e0a drm_pub/oma_drm_caf_agent_api/tsrc/bc/DRM_CAF/data/content.dcf diff -r 3bdc3b853094 -r 908beac81e0a inc/DrmKeyStorage.h --- a/inc/DrmKeyStorage.h Mon May 03 12:46:34 2010 +0300 +++ b/inc/DrmKeyStorage.h Fri May 14 16:07:34 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -25,7 +25,12 @@ // CLASS DECLARATION /** -* CDrmKeyStorage: Contains key storage for OMA DRM 2.0 +* CDrmKeyStorage: Contains key storage for OMA DRM 2.x +* +* Generally the methods to the class require that a root certificate is selected. +* A specific root certificate can be selected or the default root can be selected. +* Operations needing the PKI keys should fail if the key has not been selected. +* Suggested error code: KErrNotReady * * @lib - * @since 3.0 @@ -38,53 +43,231 @@ public: // New functions + /** + * Destructor + */ + virtual ~MDrmKeyStorage() = 0; + /** + * ModulusSize + * + * Return the modulus size of the selected certificates private key. + * + * @return Modulus size of the PKI key + */ + virtual TInt ModulusSize() = 0; - + + /** + * SelectTrustedRootL + * + * Selects the trusted root certificate to be used for operation occurring after + * this call + * + * @param aRootKeyHash Hash of the root key to be used. + * @leave Symbian OS error codes + */ + virtual void SelectTrustedRootL( const TDesC8& aRootKeyHash) = 0; - + + /** + * SelectedRootIsCmla + * + * Checks if the selected root is a CMLA root + * + * @return ETrue if the selected root is a CMLA root + * EFalse if the root does not exist or is not a CMLA root + */ + virtual TBool SelectedRootIsCmla() = 0; - + + /** + * SelectDefaultRootL + * + * Selects the default root certificate of the device/keystorage implementation + * + * @leave Symbian OS error code if the root can't be selected for some reason + */ + virtual void SelectDefaultRootL() = 0; - + + /** + * GetTrustedRootsL + * + * Get a list of unique identifiers for the trusted roots of the + * device / keystorage implementation. Generally PKI public key hash values. + * + * @param aRootList A pointer array of trusted root certificate hash values + * or other unique identifiers for the certificates + * @leave Symbian OS error codes + */ + virtual void GetTrustedRootsL( RPointerArray& aRootList) = 0; - + + /** + * GetCertificateChainL + * + * Get the certificate chain of the selected certificate + * + * @param aRootList A pointer array of certificate hash values + * or other unique identifiers for the certificates + * in the certificate chain + * @leave Symbian OS error codes + */ + virtual void GetCertificateChainL( RPointerArray& aCertChain) = 0; + + /** + * RsaSignL + * + * Create an RSA signature of the buffer given + * + * @param aInput A descriptor containing the data to be signed + * @return Signed buffer. Caller is responsible for freeing it. + * @leave Symbian OS error codes + */ virtual HBufC8* RsaSignL( const TDesC8& aInput) = 0; - + + /** + * RsaDecryptL + * + * Decrypt the RSA encrypted buffer + * + * @param aInput A descriptor containing the data to be decrypted + * @return Decrypted buffer. Caller is responsible for freeing it. + * @leave Symbian OS error codes + */ + virtual HBufC8* RsaDecryptL( const TDesC8& aInput) = 0; - + + /** + * ImportDataL + * + * Allows the importing of PKI keys into the system + * Should import: Private Key, Public Certificate and all + * signing certificates for the certificate chain all the way to the root. + * + * Mostly usable for debugging purposes. Should be used with caution. + * + * @param aPrivateKey Private key of the imported PKI key. + * @param aCertificateChain Public Certificate and signing certificates + * @leave Symbian OS error codes + */ + virtual void ImportDataL( const TDesC8& aPrivateKey, const RArray& aCertificateChain) = 0; - + + /** + * GetDeviceSpecificKeyL + * + * Get the device specific key/identifier that has a length of + * KDeviceSpecificKeyLength. Must return the same value every time. + * This method must not require the root to be selected. + * + * Does not require the selection of + * + * @param aKey Buffer to fit the bytes of a device specific + * unique key / identifier. Must return the same + * value every time + * @leave Symbian OS error codes + */ + virtual void GetDeviceSpecificKeyL( TBuf8& aKey) = 0; + + /** + * GetRdbSerialNumberL + * + * This method fetches a unique serial number for the OMA DRM rights database + * currently in use. Does not have to be unique per device, but should return + * the same value while the current database is in use. + * Should create a new serial number if one does not exists. + * + * @param aSerialNumber Serial number for the OMA DRM + * rights database + * @leave Symbian OS error codes + */ virtual void GetRdbSerialNumberL( TBuf8& aSerialNumber) = 0; - + + /** + * GenerateNewRdbSerialNumberL( + * + * This method creates a new unique serial number for the OMA DRM rights database. + * Length of the serial number is defined by KRdbSerialNumberLength constant. + * Should be random and must be persisted until a new serial number is generated by + * a new call to this method. + * + * Recommend storing the serial number into the file system or other secure location. + * For example under the rightsserver.exe private directory. + * + * @leave Symbian OS error codes + */ + virtual void GenerateNewRdbSerialNumberL() = 0; - + + /** + * UdtEncryptL + * + * Encrypt the User Data Transfer data. Usable only in the user data transfer use case. + * Uses it's own User Data Transfer PKI key. + * + * @param aInput Input buffer to be encrypted + * @return Buffer encrypted with the User Data Transfer specific PKI key. + * @leave Symbian OS error codes + */ + virtual HBufC8* UdtEncryptL( const TDesC8& aInput) = 0; - + + /** + * GetRootCertificatesL + * + * Get a list of all the root certificates of the device. + * Returns actual binary format (.der) certificates. + * + * @param aRootCerts Param description + * @return Return value descriptions + * @leave Symbian OS error codes + */ + virtual void GetRootCertificatesL( RPointerArray& aRootCerts) = 0; + /** + * RandomDataGetL + * + * Get random data into the beginning of the aData buffer. + * + * @param aData A return buffer that has enough space for the aLength amount of data. + * @param aLength Amount of random data requested + * @leave Symbian OS error codes + */ + virtual void RandomDataGetL( TDes8& aData, const TInt aLength ) = 0; }; +/** +* DrmKeyStorageNewL +* +* @return Pointer to an object which implements the MDrmKeyStorage +* interface. Underlying implementation tells which +* keystorage to load if there are emulator/hw specific ones +* @leave Symbian OS error codes +*/ + IMPORT_C MDrmKeyStorage* DrmKeyStorageNewL(); #endif // DRMKEYSTORAGE_H diff -r 3bdc3b853094 -r 908beac81e0a omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp --- a/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp Mon May 03 12:46:34 2010 +0300 +++ b/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp Fri May 14 16:07:34 2010 +0300 @@ -72,6 +72,20 @@ const TInt KMaxAlbumTrack = 3; const TInt KMaxRecordingYear = 6; +const TInt KAllowAllDefined = + DRM::EDrmAllowAudioAnalog | + DRM::EDrmAllowAudioFmTransmitter | + DRM::EDrmAllowAudioBluetooth | + DRM::EDrmAllowAudioUplink | + DRM::EDrmAllowVideoAnalog | + DRM::EDrmAllowVideoMacroVision | + DRM::EDrmAllowAudioUsb | + DRM::EDrmAllowAudioHdmiHdcpRequired | + DRM::EDrmAllowAudioHdmi | + DRM::EDrmAllowVideoHDMI | + DRM::EDrmAllowVideoHdmiHdcpRequested | + DRM::EDrmAllowVideoHdmiHdcpRequired; + // ============================= LOCAL FUNCTIONS =============================== // ----------------------------------------------------------------------------- @@ -451,7 +465,14 @@ } break; case DRM::EDrmAllowedOutputs: - value = DRM::EDrmAllowAudioAnalog | DRM::EDrmAllowAudioBluetooth | DRM::EDrmAllowVideoMacroVision | DRM::EDrmAllowAudioFmTransmitter; + if( dcf2 ) + { + value = DRM::EDrmAllowAudioAnalog | DRM::EDrmAllowAudioBluetooth | DRM::EDrmAllowVideoMacroVision | DRM::EDrmAllowAudioFmTransmitter; + } + else + { + value = KAllowAllDefined; + } break; default: value = KErrCANotSupported; @@ -683,7 +704,14 @@ } break; case DRM::EDrmAllowedOutputs: - value = DRM::EDrmAllowAudioAnalog | DRM::EDrmAllowAudioBluetooth | DRM::EDrmAllowVideoMacroVision | DRM::EDrmAllowAudioFmTransmitter; + if( dcf2 ) + { + value = DRM::EDrmAllowAudioAnalog | DRM::EDrmAllowAudioBluetooth | DRM::EDrmAllowVideoMacroVision | DRM::EDrmAllowAudioFmTransmitter; + } + else + { + value = KAllowAllDefined; + } break; case ERightsNone: if (aRightsClient == NULL) @@ -817,6 +845,7 @@ RDRMRightsClient* aRightsClient) { TInt err = KErrCANotSupported; + TInt ret = KErrNone; HBufC* b = NULL; COma1Dcf* dcf1 = NULL; COma2Dcf* dcf2 = NULL; diff -r 3bdc3b853094 -r 908beac81e0a omadrm/drmengine/agentv2/src/Oma2AgentContent.cpp --- a/omadrm/drmengine/agentv2/src/Oma2AgentContent.cpp Mon May 03 12:46:34 2010 +0300 +++ b/omadrm/drmengine/agentv2/src/Oma2AgentContent.cpp Fri May 14 16:07:34 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -26,7 +26,7 @@ #include -#include +#include #include "Oma2AgentContent.h" @@ -545,7 +545,6 @@ // ----------------------------------------------------------------------------- // COma2AgentContent::NotifyStatusChange -// // ----------------------------------------------------------------------------- // void COma2AgentContent::NotifyStatusChange( diff -r 3bdc3b853094 -r 908beac81e0a omadrm/drmengine/drmclock/Inc/GPSTimeUpdater.h --- a/omadrm/drmengine/drmclock/Inc/GPSTimeUpdater.h Mon May 03 12:46:34 2010 +0300 +++ b/omadrm/drmengine/drmclock/Inc/GPSTimeUpdater.h Fri May 14 16:07:34 2010 +0300 @@ -29,8 +29,7 @@ { public: ~CGPSTimeUpdater(); - static CGPSTimeUpdater* New( RPositionServer &aPosServer, - const TPositionModuleId& aModuleId, + static CGPSTimeUpdater* New( const TPositionModuleId& aModuleId, CDRMClock* aClock ); inline const TPositionModuleId& ModuleId() { return iModuleId; } @@ -38,8 +37,7 @@ inline const TBool TimeReceived() { return iTimeReceived; } private: - CGPSTimeUpdater( RPositionServer &aPosServer, - const TPositionModuleId& aModuleId, + CGPSTimeUpdater( const TPositionModuleId& aModuleId, CDRMClock* aClock ); void ConstructL(); @@ -48,7 +46,7 @@ TInt RunError( TInt aError ); private: - RPositionServer &iPosServer; + RPositionServer iPosServer; RPositioner iPositioner; TPositionModuleId iModuleId; diff -r 3bdc3b853094 -r 908beac81e0a omadrm/drmengine/drmclock/Inc/GPSWatcher.h --- a/omadrm/drmengine/drmclock/Inc/GPSWatcher.h Mon May 03 12:46:34 2010 +0300 +++ b/omadrm/drmengine/drmclock/Inc/GPSWatcher.h Fri May 14 16:07:34 2010 +0300 @@ -21,39 +21,52 @@ #define GPSWATCHER_H_ #include - +#include class CGPSTimeUpdater; class CDRMClock; -class CGPSWatcher : public CTimer + +class CGPSWatcher : public CTimer, public MPosIntGpsHwStatusObserver { public: ~CGPSWatcher(); static CGPSWatcher* NewL( CDRMClock* aClock ); +public: // from MPosIntGpsHwStatusObserver + /** + * Notify observer of a GPS hardware status event + * @param aStatus The GPS hardware status. + * @param aError KErrNone if successful. Other possible error values defined by RProperty::Get() + */ + void OnStatusUpdateEvent(CPosIntGpsHwStatus::TIntGpsHwStatus aStatus, TInt aError); + private: CGPSWatcher( CDRMClock* aClock ); void ConstructL(); - void CheckModules(); - void Subscribe(); + void CheckSatellites(); + TInt CheckModules(); void RunL(); void DoCancel(); TInt RunError( TInt aError ); private: - RPositionServer iPosServer; - TPositionModuleStatusEvent iStatusEvent; + // owned: + RPointerArray iTimeUpdaters; - // owned - CGPSTimeUpdater *iTimeUpdater; + // not owned: + CDRMClock* iClock; - // not owned - CDRMClock* iClock; - - // Retry counter - TInt iRetryCounter; + // GPS status information: + CPosIntGpsHwStatus* iStatusUpdater; + + // status received from GPS: + CPosIntGpsHwStatus::TIntGpsHwStatus iGpsStatus; + + // List of active satellite modules: + RPointerArray iActiveSatelliteModules; + }; #endif /* GPSWATCHER_H_ */ diff -r 3bdc3b853094 -r 908beac81e0a omadrm/drmengine/drmclock/Src/GPSTimeUpdater.cpp --- a/omadrm/drmengine/drmclock/Src/GPSTimeUpdater.cpp Mon May 03 12:46:34 2010 +0300 +++ b/omadrm/drmengine/drmclock/Src/GPSTimeUpdater.cpp Fri May 14 16:07:34 2010 +0300 @@ -26,6 +26,10 @@ _LIT(KDRMClockServerName, "DRMClockServer"); +const TInt KGPSUpdateInterval = 1000000; // One second +const TInt KGPSUpdateAge = 500000; // Half a second +const TInt KGPSUpdateTimeOut = 30000000; // Thirty seconds + // ============================ MEMBER FUNCTIONS =============================== @@ -35,11 +39,9 @@ // might leave. // ----------------------------------------------------------------------------- // -CGPSTimeUpdater::CGPSTimeUpdater( RPositionServer &aPosServer, - const TPositionModuleId& aModuleId, +CGPSTimeUpdater::CGPSTimeUpdater( const TPositionModuleId& aModuleId, CDRMClock* aClock ) : CActive(EPriorityHigh), - iPosServer(aPosServer), iModuleId(aModuleId), iClock( aClock ), iTimeReceived( EFalse ) @@ -58,6 +60,7 @@ Cancel(); iPositioner.Close(); + iPosServer.Close(); } // ----------------------------------------------------------------------------- @@ -65,11 +68,10 @@ // Two-phased constructor // ----------------------------------------------------------------------------- // -CGPSTimeUpdater* CGPSTimeUpdater::New( RPositionServer &aPosServer, - const TPositionModuleId& aModuleId, +CGPSTimeUpdater* CGPSTimeUpdater::New( const TPositionModuleId& aModuleId, CDRMClock* aClock ) { - CGPSTimeUpdater* self = new CGPSTimeUpdater(aPosServer, aModuleId, aClock); + CGPSTimeUpdater* self = new CGPSTimeUpdater(aModuleId, aClock); if(self) { TRAPD(err, self->ConstructL()); @@ -92,6 +94,8 @@ { DRMLOG(_L("CGPSTimeUpdater::ConstructL >>")); + User::LeaveIfError( iPosServer.Connect() ); + // Open positioner User::LeaveIfError(iPositioner.Open(iPosServer, iModuleId)); User::LeaveIfError(iPositioner.SetRequestor(CRequestor::ERequestorService, @@ -101,9 +105,9 @@ // Set update options TPositionUpdateOptions updateOptions; updateOptions.SetAcceptPartialUpdates(ETrue); - updateOptions.SetMaxUpdateAge(0); - updateOptions.SetUpdateInterval(TTimeIntervalMicroSeconds(0)); - updateOptions.SetUpdateTimeOut(TTimeIntervalMicroSeconds(30*1000*1000)); + updateOptions.SetMaxUpdateAge(KGPSUpdateAge); + updateOptions.SetUpdateInterval(TTimeIntervalMicroSeconds(KGPSUpdateInterval)); + updateOptions.SetUpdateTimeOut(TTimeIntervalMicroSeconds(KGPSUpdateTimeOut)); User::LeaveIfError(iPositioner.SetUpdateOptions(updateOptions)); // Request position update @@ -124,7 +128,9 @@ DRMLOG2(_L("CGPSTimeUpdater::RunL: iStatus=%d"), iStatus.Int()); - if( iStatus == KErrNone || iStatus == KPositionPartialUpdate ) + // We got some kind of an update: + if( iStatus == KErrNone || + iStatus == KPositionPartialUpdate ) { DRMLOG(_L("CGPSTimeUpdater::RunL: position updated!")); @@ -140,18 +146,9 @@ // Mark time as received iTimeReceived = ETrue; } - - // if the call timed out try again - if( iStatus == KErrTimedOut ) - { - // Request position update - iPositioner.NotifyPositionUpdate(iSatelliteInfo, iStatus); - SetActive(); - } - else - { - iPositioner.Close(); - } + + // We only try once, if it fails it fails and we will try again when it is activated the next time. + iPositioner.Close(); DRMLOG(_L("CGPSTimeUpdater::RunL <<")); } diff -r 3bdc3b853094 -r 908beac81e0a omadrm/drmengine/drmclock/Src/GPSWatcher.cpp --- a/omadrm/drmengine/drmclock/Src/GPSWatcher.cpp Mon May 03 12:46:34 2010 +0300 +++ b/omadrm/drmengine/drmclock/Src/GPSWatcher.cpp Fri May 14 16:07:34 2010 +0300 @@ -26,8 +26,6 @@ #include "drmlog.h" // Wait time in microseconds: wait 5 minutes -const TInt KGpsDefaultWaitTime = 300000000; -const TInt KMaxRetryCounter = 20; // ============================ MEMBER FUNCTIONS =============================== @@ -41,7 +39,8 @@ CGPSWatcher::CGPSWatcher( CDRMClock* aClock ) : CTimer(EPriorityHigh), iClock( aClock ), - iRetryCounter( 0 ) + iStatusUpdater( NULL ), + iGpsStatus( CPosIntGpsHwStatus::EStatusUnknown ) { CActiveScheduler::Add(this); } @@ -55,10 +54,10 @@ { Cancel(); - delete iTimeUpdater; - iTimeUpdater = 0; - - iPosServer.Close(); + iTimeUpdaters.ResetAndDestroy(); + iActiveSatelliteModules.ResetAndDestroy(); + + delete iStatusUpdater; } // ----------------------------------------------------------------------------- @@ -84,28 +83,42 @@ // void CGPSWatcher::ConstructL() { + TRequestStatus* status = &iStatus; CTimer::ConstructL(); - User::LeaveIfError(iPosServer.Connect()); - - // Immediately subscribe for module status events - iStatusEvent.SetRequestedEvents(TPositionModuleStatusEventBase::EEventDeviceStatus); - Subscribe(); - - // Check initial state - CheckModules(); + // Create the status updater + iStatusUpdater = CPosIntGpsHwStatus::NewL(*this); + + // Get the status manually, if we can, it's ok if we cant + TRAP_IGNORE( iStatusUpdater->GetStatusL( iGpsStatus ) ); + + if( !IsActive() ) + { + SetActive(); + } + + User::RequestComplete(status, KErrNone); } // ----------------------------------------------------------------------------- -// CGPSWatcher::Subscribe -// Subscribe to position events +// CGPSWatcher::OnStatusUpdateEvent +// Inherited from MPosIntGpsHwStatusObserver // ----------------------------------------------------------------------------- // -void CGPSWatcher::Subscribe() - { - iPosServer.NotifyModuleStatusEvent(iStatusEvent, iStatus); - SetActive(); - } +void CGPSWatcher::OnStatusUpdateEvent(CPosIntGpsHwStatus::TIntGpsHwStatus aStatus, TInt aError) + { + TRequestStatus* status = &iStatus; + + // store the status from the Gps: + iGpsStatus = aStatus; + + User::RequestComplete(status, aError); + + if( !IsActive() ) + { + SetActive(); + } + } // ----------------------------------------------------------------------------- // CGPSWatcher::RunL @@ -114,41 +127,53 @@ // void CGPSWatcher::RunL() { + TInt error = KErrNone; + // If there are errors just leave and stop watching: - DRMLOG2(_L("CGPSWatcher::RunL: error: '%d'"), iStatus.Int()); - - // If we already updated the time: - if( iTimeUpdater && iTimeUpdater->TimeReceived() ) - { - DRMLOG( _L("CGPSWatcher::RunL: time updater exists, time received, deleting")); - iClock->Notify( CDRMClock::ENotifyGPSTimeReceived ); - DRMLOG( _L("CGPSWatcher::RunL: object deleted, returning")); - return; - } + DRMLOG2(_L("CGPSWatcher::RunL: status: '%d'"), iStatus.Int()); - // The server was killed: - if( iStatus.Int() == KErrServerTerminated ) + switch( iGpsStatus ) { - if( iRetryCounter > KMaxRetryCounter ) - { - DRMLOG( _L("CGPSWatcher::RunL: Maximum retries reached, stopping watcher.") ); - iClock->Notify( CDRMClock::ENotifyGPSTimeReceived ); - return; - } - // If there are errors just leave and stop watching: - DRMLOG2(_L("CGPSWatcher::RunL: server terminated, waiting '%d' microseconds"), KGpsDefaultWaitTime); - After( TTimeIntervalMicroSeconds32(KGpsDefaultWaitTime) ); - return; - } - - Subscribe(); - TPositionModuleStatusEventBase::TModuleEvent occurredEvents = iStatusEvent.OccurredEvents(); - DRMLOG2(_L("CGPSWatcher::RunL: occurredEvents = 0x%X"), occurredEvents); - - - // If time updater is not running, check module statuses - if(!iTimeUpdater) - CheckModules(); + // GPS HW is used and is receiving location fixes. + case CPosIntGpsHwStatus::EStatusOn: + DRMLOG(_L("CGPSWatcher::RunL: CPosIntGpsHwStatus::EStatusOn: Checking modules")); + // No active modules, check again: + if( !iActiveSatelliteModules.Count() ) + { + DRMLOG(_L("CGPSWatcher::RunL: CPosIntGpsHwStatus::EStatusOn: No active modules in list Checking modules")); + error = CheckModules(); + } + + // if we have some or found some check the satellites for updates: + if( !error && iActiveSatelliteModules.Count() ) + { + DRMLOG2(_L("CGPSWatcher::RunL: CPosIntGpsHwStatus::EStatusOn: Active modules available (%d), check satellites"), iActiveSatelliteModules.Count()); + // Get the time update: + CheckSatellites(); + } + else + { + DRMLOG2(_L("CGPSWatcher::RunL: CPosIntGpsHwStatus::EStatusOn: Still no active modules in list or error (%d) occurred"), error); + } + break; + // GPS HW is used and is searching for location. + case CPosIntGpsHwStatus::EStatusActive: + // Get a list of active GPS modules: + DRMLOG(_L("CGPSWatcher::RunL: CPosIntGpsHwStatus::EStatusActive: Checking modules")); + + // return value not important: + CheckModules(); + break; + case CPosIntGpsHwStatus::EStatusUnknown: + case CPosIntGpsHwStatus::EStatusOff: + // Clear the list of modules: + DRMLOG2(_L("CGPSWatcher::RunL: CPosIntGpsHwStatus::EStatusUnknown,Off or default: (%d) Checking modules"), iGpsStatus); + iActiveSatelliteModules.ResetAndDestroy(); + iTimeUpdaters.ResetAndDestroy(); + default: + // Do nothing + break; + } } @@ -159,7 +184,6 @@ // void CGPSWatcher::DoCancel() { - iPosServer.CancelRequest(EPositionServerNotifyModuleStatusEvent); } // ----------------------------------------------------------------------------- @@ -178,36 +202,54 @@ // Check what modules are present and act accordingly // ----------------------------------------------------------------------------- // -void CGPSWatcher::CheckModules() +TInt CGPSWatcher::CheckModules() { - // Get number of modules - TUint numModules; - if(iPosServer.GetNumModules(numModules)!=KErrNone || !numModules) - return; + TUint numModules = 0; + TPositionModuleInfo* moduleInfo = NULL; + TInt error = KErrNone; + RPositionServer posServer; - // Collect all active and satellite capable modules - TFullName moduleName; - RPointerArray satelliteModules; - - TPositionModuleInfo *moduleInfo(0); - - for(TUint i=0; iDeviceLocation() & TPositionModuleInfo::EDeviceInternal) || ! (moduleInfo->Capabilities() & TPositionModuleInfo::ECapabilitySatellite) ) @@ -216,47 +258,75 @@ continue; } - // Get module status + // Get module status and check if the module is actually active: + + + DRMLOG(_L("CheckModules: Checking module status")); + TPositionModuleStatus moduleStatus; - if(iPosServer.GetModuleStatus(moduleStatus, moduleInfo->ModuleId()) != KErrNone) + + if(posServer.GetModuleStatus(moduleStatus, moduleInfo->ModuleId()) != KErrNone) { continue; } - // Check if the module is active - if(moduleStatus.DeviceStatus() != TPositionModuleStatus::EDeviceActive) + + // Check if the module is active or ready as all might not use the active state: + if(!(moduleStatus.DeviceStatus() == TPositionModuleStatus::EDeviceActive || + moduleStatus.DeviceStatus() == TPositionModuleStatus::EDeviceReady) ) { continue; } - moduleInfo->GetModuleName(moduleName); - - DRMLOG6( _L("Module %d: id=0x%08X, name = %S, cap=0x%08X, status=%d"), i, moduleInfo->ModuleId().iUid, &moduleName, moduleInfo->Capabilities(), moduleStatus.DeviceStatus()); + + DRMLOG(_L("CheckModules: Module is ready or active")); // Active internal satellite device, try to append in the array - if(satelliteModules.Append(moduleInfo) == KErrNone) + if(iActiveSatelliteModules.Append(moduleInfo) == KErrNone) { + // Set this to 0 so that on the next round a new one will be created + // old one will be in the list: + DRMLOG2(_L("CheckModules: Appended modules to list available (%d) active now available"), iActiveSatelliteModules.Count()); moduleInfo = 0; } } - delete moduleInfo; + // There is a module created which was not added, delete it. + if( moduleInfo ) + { + delete moduleInfo; + moduleInfo = NULL; + } - if(satelliteModules.Count()) - { - DRMLOG( _L("Active satellite module available") ); - // We have an active satellite module available - TPositionModuleId moduleId = satelliteModules[0]->ModuleId(); - - // Just allocating/deleting the time updater will do the trick - iTimeUpdater = CGPSTimeUpdater::New(iPosServer, moduleId, iClock); - } - else - { - DRMLOG( _L("No active satellite modules available") ); - // Delete time updater since no active GPS anymore - delete iTimeUpdater; iTimeUpdater = 0; - } - - satelliteModules.ResetAndDestroy(); - satelliteModules.Close(); + // close connection to the positioning server: + posServer.Close(); + return KErrNone; } + + +// ----------------------------------------------------------------------------- +// CGPSWatcher::CheckSatellites() +// Check what modules are present and act accordingly +// ----------------------------------------------------------------------------- +// +void CGPSWatcher::CheckSatellites() + { + CGPSTimeUpdater* updater = NULL; + + iTimeUpdaters.ResetAndDestroy(); + + // Start as many updaters as needed: + for( TInt i = 0; i < iActiveSatelliteModules.Count(); i++ ) + { + updater = CGPSTimeUpdater::New( iActiveSatelliteModules[i]->ModuleId(), iClock ); + if( updater ) + { + if( iTimeUpdaters.Append(updater) ) + { + delete updater; + updater = NULL; + } + } + } + } + +// End of File diff -r 3bdc3b853094 -r 908beac81e0a omadrm/drmengine/group/RightsServer.mmp --- a/omadrm/drmengine/group/RightsServer.mmp Mon May 03 12:46:34 2010 +0300 +++ b/omadrm/drmengine/group/RightsServer.mmp Fri May 14 16:07:34 2010 +0300 @@ -148,6 +148,7 @@ LIBRARY featmgr.lib // Feature Manager LIBRARY wmdrmfileserverclient.lib LIBRARY lbs.lib // GPS libraries +LIBRARY eposindicator.lib // GPS positioner indicator lib #ifdef RD_DRM_METERING LIBRARY random.lib #endif diff -r 3bdc3b853094 -r 908beac81e0a omadrm/drmengine/legacy/src/drmcommon.rss --- a/omadrm/drmengine/legacy/src/drmcommon.rss Mon May 03 12:46:34 2010 +0300 +++ b/omadrm/drmengine/legacy/src/drmcommon.rss Fri May 14 16:07:34 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 3bdc3b853094 -r 908beac81e0a omadrm/drmhelper/src/drmhelper.cpp --- a/omadrm/drmhelper/src/drmhelper.cpp Mon May 03 12:46:34 2010 +0300 +++ b/omadrm/drmhelper/src/drmhelper.cpp Fri May 14 16:07:34 2010 +0300 @@ -59,7 +59,7 @@ #include -#include // for handling URLs +#include // for handling URLs #include "DRMHelperServer.h" #include "ConsumeData.h" #include "DRMTypes.h" diff -r 3bdc3b853094 -r 908beac81e0a omadrm/drmplugins/drmfilter/src/HTTPFilterDRM.cpp --- a/omadrm/drmplugins/drmfilter/src/HTTPFilterDRM.cpp Mon May 03 12:46:34 2010 +0300 +++ b/omadrm/drmplugins/drmfilter/src/HTTPFilterDRM.cpp Fri May 14 16:07:34 2010 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -217,7 +217,7 @@ //------------------------------------------------------------------------ // CHTTPFilterDRM::MHFRunL -// See MHTTPFilterBase::MHFRunL +// See MHTTPFilterBase::MHFRunL //------------------------------------------------------------------------ // void CHTTPFilterDRM::MHFRunL( RHTTPTransaction aTransaction, @@ -320,7 +320,7 @@ case KErrCANoRights: case KErrCorrupt: { - error = NW_STAT_FAILURE; //Unable to perform operation + error = NW_STAT_FAILURE; //Unable to perform operation } break; case KErrArgument: @@ -461,10 +461,10 @@ // CHTTPFilterDRM::CheckHeadersL // Check HTTP headers and extract MIME type //------------------------------------------------------------------------ -// +// void CHTTPFilterDRM::CheckHeadersL( const RHTTPTransaction& aTrans ) { - // read the header data and check the MIME type here + // read the header data and check the MIME type here // check the status and body RHTTPResponse response = aTrans.Response(); TInt status = response.StatusCode(); @@ -512,7 +512,7 @@ drmData = CHTTPFilterDRMDataSupplier::NewL( aTrans.Id(), response.Body(), const_cast ( this ) ); /** Support for Hutchinson's content protection scheme, CFM - * + * */ drmData->SetProcessedContentType( EStandardDRMContent ); /** @@ -630,7 +630,7 @@ // Do not encrypt JAD files: if ( headers.GetField( fieldNameStr, 0, fieldVal ) == KErrNone ) { - // If it is a JAD always ignore any of the above: + // If it is a JAD always ignore any of the above: const TBuf8 JADStringBuf( KJADString ); RStringF JADValue = strP.OpenFStringL( JADStringBuf ); CleanupClosePushL( JADValue ); @@ -665,7 +665,7 @@ iDataSups.Append( drmData ); response.SetBody( *drmData ); - /// + /// RStringF DRMValue1 = strP.OpenFStringL( DRMStringBuf1 ); CleanupClosePushL( DRMValue1 );