diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsdrmscanner.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsdrmscanner.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,205 @@ +/* +* Copyright (c) 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: The API supports attributes not present in MCS from SAT Api +* +*/ + + +#ifndef __MCSDRMSCANNER_H__ +#define __MCSDRMSCANNER_H__ + +#include +#include "menuengoperation.h" +#include "mcsmenuitem.h" + +class CMenuSrvEngUtils; +class CMenuSrvEng; +class TAppItem; +/** + * Interface for updating Now Playing entry after Publish&Subscribe events. + * + * @since S60 v3.2 + */ +class MMcsDrmAppScanner + { + +public: + + virtual void HandleDrmAppEvent() = 0; + }; + + +/** + * DRM Scanner Active Object. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsDrmScanner ) : + public CActive, + public MMenuEngOperation + { + +public: + + /** + * Creates an instance of CMcsDrmScanner implementation. + * + * @since S60 v5.0 + */ + static CMcsDrmScanner* NewL( + MMcsDrmAppScanner& aObserver, + CMenuSrvEng& aSrvEng, + CMenuSrvEngUtils& aUtils ); + + /** + * Destructor. + */ + virtual ~CMcsDrmScanner(); + + const RArray& DrmExpiredAppArray(); + const RArray& DrmProtectedAppArray(); + + void Scan(); + + void RemoveObserverAndScanL( TUid aUid ); + +private: + + /** + * Execute engine operation: + */ + void RunMenuEngOperationL(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + void CompletedMenuEngOperation( TInt aErr ); + + /** + */ + void ScanDrmApplicationsL(); + + /** + */ + void GetMcsAppItemsL( RArray& aArray ); + +private: + /** + * Constructor. + * + * @since S60 v5.0 + */ + CMcsDrmScanner( + MMcsDrmAppScanner& aObserver, + CMenuSrvEng& aSrvEng, + CMenuSrvEngUtils& aUtils ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + +private: // From CActive. + + /** + * From CActive. + */ + void DoCancel(); + + /** + * From CActive. + */ + void RunL(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + TInt RunError( TInt aError ); + +private: + + void GetAppItemsL( + RArray& aItemArray, + RArray& aAppItemArray ); + + void GetUidsL( + RArray& aAppItemArray, + RArray& aUidArray ); + + TBool RemoveNotExistingApps( + RArray& aArrayToModify, + const RArray& aUidArray ); + + TBool RemoveChangedApps( ); + + TBool RemoveMissingApps( const RArray& aUidArray ); + + TBool CheckDrmAppsL( const RArray& aUidArray ); + +private: + + + +private: + + + /** + * Interface for notifying changes. + * Not own. + */ + MMcsDrmAppScanner& iObserver; + + + CMenuSrvEng& iSrvEng; + + CMenuSrvEngUtils& iUtils; + + RArray iNotProtectedAppArray; + RArray iDrmExpiredAppArray; + RArray iDrmProtectedAppArray; + + RArray iChangedAppArray; + + + TBool iOpStatus; + + }; + +NONSHARABLE_CLASS( TAppItem ) + { + public: + TAppItem( TInt aId, TUid aUid ): iId(aId), iUid(aUid) {}; + + TInt Id() const + { + return iId; + }; + + TUid Uid() const + { + return iUid; + }; + + private: + TInt iId; + TUid iUid; + + }; + + +#endif // __MCSDRMSCANNER_H__ + +// End of File