commondrm/drmutility/inc/drmuierrorhandling.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 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:  Implementation class header of MDrmErrorHandling API
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CDRMUIERRORHANDLING_H
       
    20 #define C_CDRMUIERRORHANDLING_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 #include <caf/caftypes.h>
       
    25 #include <drmerrorhandling.h>
       
    26 
       
    27 namespace DRM
       
    28 {
       
    29     
       
    30     //*** forward declarations go here:
       
    31     class CDrmUiHandlingImpl;
       
    32     class MDrmHandleErrorObserver;
       
    33     
       
    34 /**
       
    35  *  Implementation class for the MDrmErrorHandling interface
       
    36  *  For DRM UI Handling
       
    37  *
       
    38  *  @lib drmuihandling.lib
       
    39  *  @since S60 v5.0
       
    40  */
       
    41 NONSHARABLE_CLASS( CDrmUiErrorHandling ) :
       
    42     public CBase, public MDrmErrorHandling
       
    43     {
       
    44 public:
       
    45 
       
    46     /**
       
    47      * Two-phased constructor.
       
    48      * @param aImplementation pointer to the implementation class
       
    49      */
       
    50     IMPORT_C static CDrmUiErrorHandling* NewL(
       
    51         CDrmUiHandlingImpl* aImplementation );
       
    52     
       
    53     /**
       
    54      * Two-phased constructor. Leaves the created object into the
       
    55      * cleanup stack
       
    56      * @param aImplementation pointer to the implementation class
       
    57      */
       
    58     IMPORT_C static CDrmUiErrorHandling* NewLC(
       
    59         CDrmUiHandlingImpl* aImplementation );
       
    60     /**
       
    61     * Destructor.
       
    62     */
       
    63     virtual ~CDrmUiErrorHandling();
       
    64 
       
    65 
       
    66 public: // from base class MDrmErrorHandling
       
    67 
       
    68     /**
       
    69      * From MDrmErrorHandling
       
    70      *
       
    71      * Handles DRM error situations related to invalid rights.
       
    72      * This method displays appropriate notes, which observer can override, 
       
    73      * to the user and acquires new rights if needed. Asynchronous version,
       
    74      * all errors are signalled using request status. 
       
    75      *
       
    76      * @since S60 v5.0
       
    77      * @param[in]   aFile       file for which the error happened
       
    78      * @param[in]   aIntent     the CAF intent which was used to recieve 
       
    79      *                          the error
       
    80      * @param[in]   aError      error code
       
    81      * @param[in]   aObserver   reference to observer
       
    82      *
       
    83      * @return Operation Identifier for the async request
       
    84      *         required for cancelling an operation and
       
    85      *         identifying which request has been completed
       
    86      *
       
    87      * @see MDrmHandleErrorObserver
       
    88      * @see ContentAccess::TIntent
       
    89      */
       
    90     virtual TInt HandleErrorAsyncL( 
       
    91         RFile& aFile,
       
    92         ContentAccess::TIntent aIntent, 
       
    93         TInt aError, 
       
    94         MDrmHandleErrorObserver& aObserver );
       
    95         
       
    96     /**
       
    97      * From MDrmErrorHandling
       
    98      *
       
    99      * Handles DRM error situations related to invalid rights.
       
   100      * This method displays appropriate notes, which observer can override, 
       
   101      * to the user and acquires new rights if needed. Synchronous version,
       
   102      * leaves in case of error. 
       
   103      *
       
   104      * @since S60 v5.0
       
   105      * @param[in]   aFile       file for which the error happened
       
   106      * @param[in]   aIntent     the CAF intent which was used to recieve 
       
   107      *                          the error
       
   108      * @param[in]   aError      error code
       
   109      * @param[in]   aObserver   pointer to observer, NULL if no observer
       
   110      *
       
   111      * @leave   KErrArgument    File is not DRM protected.
       
   112      *
       
   113      * @see MDrmHandleErrorObserver
       
   114      * @see ContentAccess::TIntent
       
   115      */
       
   116     virtual void HandleErrorL( 
       
   117         RFile& aFile,
       
   118         ContentAccess::TIntent aIntent,              
       
   119         TInt aError, 
       
   120         MDrmHandleErrorObserver* aObserver );
       
   121     
       
   122     /**
       
   123      * From MDrmErrorHandling
       
   124      *
       
   125      * Handles DRM error situations related to invalid rights.
       
   126      * This method displays appropriate notes, which observer can override, 
       
   127      * to the user and acquires new rights if needed. Asynchronous version,
       
   128      * all errors are signalled using request status. 
       
   129      *
       
   130      * @since S60 v5.0
       
   131      * @param[in]   aFile       content for which the error happened
       
   132      * @param[in]   aIntent     the CAF intent which was used to recieve 
       
   133      *                          the error         
       
   134      * @param[in]   aError      error code
       
   135      * @param[in]   aObserver   reference to observer
       
   136      *
       
   137      * @return Operation Identifier for the async request
       
   138      *         required for cancelling an operation and
       
   139      *         identifying which request has been completed
       
   140      *
       
   141      * @see MDrmHandleErrorObserver
       
   142      * @see ContentAccess::TIntent
       
   143      */
       
   144     virtual TInt HandleErrorAsyncL( 
       
   145         ContentAccess::CData& aFile,
       
   146         ContentAccess::TIntent aIntent,
       
   147         TInt aError, 
       
   148         MDrmHandleErrorObserver& aObserver );
       
   149         
       
   150     /**
       
   151      * From MDrmErrorHandling
       
   152      *
       
   153      * Handles DRM error situations related to invalid rights.
       
   154      * This method displays appropriate notes, which observer can override, 
       
   155      * to the user and acquires new rights if needed. Synchronous version,
       
   156      * leaves in case of error. 
       
   157      *
       
   158      * @since S60 v5.0
       
   159      * @param[in]   aFile       content for which the error happened
       
   160      * @param[in]   aIntent     the CAF intent which was used to recieve 
       
   161      *                          the error         
       
   162      * @param[in]   aError      error code
       
   163      * @param[in]   aObserver   pointer to observer, NULL if no observer
       
   164      *
       
   165      * @leave   KErrArgument    File is not DRM protected.
       
   166      *
       
   167      * @see MDrmHandleErrorObserver
       
   168      * @see ContentAccess::TIntent
       
   169      */
       
   170     virtual void HandleErrorL( 
       
   171         ContentAccess::CData& aFile,
       
   172         ContentAccess::TIntent aIntent,
       
   173         TInt aError, 
       
   174         MDrmHandleErrorObserver* aObserver );
       
   175 
       
   176 
       
   177 private:
       
   178 
       
   179     /**
       
   180     * C++ constructor
       
   181     */
       
   182     CDrmUiErrorHandling();
       
   183 
       
   184     /**
       
   185     * Second phase constructor
       
   186     */
       
   187     void ConstructL( CDrmUiHandlingImpl* aImplementation );
       
   188 
       
   189 private: // data
       
   190 
       
   191     /**
       
   192      * Pointer to the implementation class
       
   193      * Not own.
       
   194      */
       
   195     CDrmUiHandlingImpl* iImplementation;
       
   196     };
       
   197 
       
   198 }
       
   199     
       
   200 #endif // C_CDRMUIERRORHANDLING_H