email/mail/UtilsSrc/MsgMailDRMHandler.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Declaration of class MsgMailDRMHandler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MSGMAILDRMHANDLER_H
       
    20 #define MSGMAILDRMHANDLER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MsgAttachmentInfo.h>
       
    25 // FORWARD DECLARATIONS
       
    26 class TContentProtection;
       
    27 class CMsgAttachmentInfo;
       
    28 class CDRMHelper;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 *  MsgMailDRMHandler: provides DRM functions.
       
    34 *
       
    35 *  @lib    MsgMaliUtils.dll
       
    36 *  @since  2.1
       
    37 */
       
    38 NONSHARABLE_CLASS(MsgMailDRMHandler): public CBase
       
    39     {
       
    40 
       
    41 public:  // Constructors and destructor
       
    42         
       
    43     /**
       
    44     * Two-phased constructor.
       
    45     */
       
    46     IMPORT_C static MsgMailDRMHandler* NewL();
       
    47     
       
    48     /**
       
    49     * Destructor.
       
    50     */
       
    51     IMPORT_C virtual ~MsgMailDRMHandler();
       
    52 
       
    53 public: // New functions
       
    54         
       
    55     /**
       
    56     * IsProtectedFile
       
    57     *
       
    58     * Takes a file name and checks if it is a DCF file or a regular file.
       
    59     *
       
    60     * @since  2.1
       
    61     * @param  aFileName: the name of the file to be tested.
       
    62     * @return ETrue if the content is ForwardLocked.
       
    63     */
       
    64     IMPORT_C TBool IsForwardLockedFileL ( RFile& aFileHandle );
       
    65     
       
    66     /**
       
    67     * IsSuperDistributableFileL
       
    68     *
       
    69     * Takes a file name and checks if it is a DCF SuperDistributable file.
       
    70     *
       
    71     * @since  2.1
       
    72     * @param  aFileName: the name of the file to be tested.
       
    73     * @return ETrue if the content is SuperDistributable.
       
    74     */
       
    75     IMPORT_C TBool IsSuperDistributableFileL ( RFile& aFileHandle );
       
    76     
       
    77     /**
       
    78     * SetDRMDataTypeL
       
    79     * Set correct DRM Data type to attachment info.
       
    80     * @param aAttachmentInfo refefence to attachment info.
       
    81     * @param aFileHandle open Handle to conten file. Handle is left open
       
    82     */
       
    83     IMPORT_C void SetDRMDataTypeL ( 
       
    84     	CMsgAttachmentInfo& aAttachmentInfo, 
       
    85     	RFile& aFileHandle );
       
    86 
       
    87     /**
       
    88     * GetDRMDataTypeL
       
    89     * Get DRM Data type from a file handle.
       
    90     * @param aFileHandle open Handle to conten file. Handle is left open
       
    91     * @return Editor base compatible drm type.
       
    92     */    	
       
    93     IMPORT_C CMsgAttachmentInfo::TDRMDataType GetDRMDataTypeL( RFile aFileHandle );
       
    94     
       
    95 private: // implementation
       
    96     
       
    97     void GetFileInfoL ( RFile& aFileHandle, 
       
    98         TBool& aIsForwardable,
       
    99         TBool& aValidRights,
       
   100         TBool& aProtection );
       
   101     
       
   102 private:
       
   103 
       
   104     /**
       
   105     * C++ default constructor.
       
   106     */
       
   107     MsgMailDRMHandler();
       
   108 
       
   109     /**
       
   110     * 2nd phase constructor.
       
   111     */
       
   112     void ConstructL();
       
   113 
       
   114 
       
   115 
       
   116 protected:  // Data
       
   117     
       
   118     /// Own: DRM helper
       
   119     CDRMHelper* iDRMHelper;
       
   120     };
       
   121 
       
   122 #endif      // MsgMailDRMHandler_H   
       
   123             
       
   124 // End of File