phonebookui/Phonebook2/inc/CPbk2DrmManager.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Phonebook 2 DRM manager.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2DRMMANAGER_H
       
    20 #define CPBK2DRMMANAGER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class DRMCommon;
       
    27 class CDRMHelper;
       
    28 class CRepository;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33  * Phonebook2 DRM manager.
       
    34  */
       
    35 class CPbk2DrmManager : public CBase
       
    36     {
       
    37     public: // Constructors and destructor
       
    38 
       
    39         /**
       
    40          * Creates a new instance of this class.
       
    41          *
       
    42          * @return  A new instance of this class.
       
    43          */
       
    44         IMPORT_C static CPbk2DrmManager* NewL();
       
    45 
       
    46         /**
       
    47          * Destructor.
       
    48          */
       
    49         IMPORT_C ~CPbk2DrmManager();
       
    50 
       
    51     public: // Interface
       
    52 
       
    53         /**
       
    54          * Check if the given file is DRM protected.
       
    55          * NB. If DRM protection information is not available
       
    56          * then ETrue is returned.
       
    57          *
       
    58          * @param aFileName     File name to check.
       
    59          * @param aIsProtected  ETrue if the file was protected,
       
    60          *                      EFalse if the file was not protected.
       
    61          * @return Common error code
       
    62          */
       
    63         IMPORT_C TInt IsProtectedFile(
       
    64                 const TDesC& aFileName,
       
    65                 TBool& aIsProtected );
       
    66 
       
    67         /**
       
    68          * Check is the given ringing tone acceptable.
       
    69          * NB. If DRM protection information is not available
       
    70          * then ETrue is returned.         
       
    71          *
       
    72          * @param aFileName    Ringing tone's file name.
       
    73          * @param aIsProtected ETrue if the file was protected,
       
    74          *                     EFalse if the file was not protected.
       
    75          * @return Common error code
       
    76          */
       
    77         IMPORT_C TInt IsRingingToneForbidden(
       
    78                 const TDesC& aFileName,
       
    79                 TBool& aIsProtected );
       
    80 
       
    81         /**
       
    82          * Check is the given thumbnail acceptable.
       
    83          * NB. If DRM protection information is not available
       
    84          * then ETrue is returned.
       
    85          *
       
    86          * @param aFileName    Thumbnail's file name.
       
    87          * @param aIsProtected ETrue if the file was protected,
       
    88          *                     EFalse if the file was not protected.
       
    89          * @return Common error code
       
    90          */
       
    91         IMPORT_C TInt IsThumbnailForbidden(
       
    92                 const TDesC& aFileName,
       
    93                 TBool& aIsProtected );
       
    94 
       
    95     private: // Implementation
       
    96         CPbk2DrmManager();
       
    97         void ConstructL();
       
    98         void ShowErrorNoteL(
       
    99                 TInt aResource );
       
   100         TBool IsDrmRequiredForPlaybackL();
       
   101         TBool IsBlockedMimeTypeL(
       
   102                 const TDesC& aMimeType );
       
   103         void CheckProtectedFileL(
       
   104                 const TDesC& aFileName,
       
   105                 TBool& aProtected );
       
   106         void CheckUnprotectedFileL(
       
   107                 const TDesC& aFileName,
       
   108                 TBool& aProtected );
       
   109 
       
   110     private: // For wmdrm support
       
   111     	/**
       
   112          * Checks if file is WMDRM protected.
       
   113          * @param aFileName Name of the file to be checked.
       
   114          * @return ETrue if file is WMDRM protected, EFalse otherwise.
       
   115          */
       
   116 		TBool IsFileWMDRMProtectedL( const TDesC& aFileName,
       
   117 									TBool& aIsProtected  ) const;            
       
   118     private: // Data
       
   119         /// Own: DRM support
       
   120         DRMCommon* iDrmClient;
       
   121         /// Own: DRM state
       
   122         TBool iDrmEnabled;
       
   123         /// Own: DRM helper
       
   124         CDRMHelper* iDrmHelper;
       
   125         /// Own: Music player features
       
   126         CRepository* iMusicPlayerFeatures;
       
   127     };
       
   128 
       
   129 #endif // CPBK2DRMMANAGER_H
       
   130 
       
   131 // End of File