omadrm/drmengine/server/inc/DRMActiveDeletion.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Active object handling "Delete Expired Permission"
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DRMACTIVEDELETION_H
       
    20 #define DRMACTIVEDELETION_H
       
    21 
       
    22 // INCLUDES
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 // MACROS
       
    29 
       
    30 // DATA TYPES
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class CDRMRightsDB;
       
    34 class CDRMDbSession;                                                         
       
    35 
       
    36 // FUNCTION PROTOTYPES
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 *  CDRMActiveDeletion implements expired rights cleanup callback
       
    42 *  for drm rights database
       
    43 *
       
    44 *  @lib RightsServer.exe
       
    45 *  @since 3.0
       
    46 */
       
    47 NONSHARABLE_CLASS( CDRMActiveDeletion ) : public CActive
       
    48     {
       
    49     public: // Constructors and destructor
       
    50         
       
    51         /**
       
    52         * NewL
       
    53         *
       
    54         * Creates an instance of the CDRMRightCleaner class and returns a pointer
       
    55         * to it
       
    56         *
       
    57         * @since    3.0
       
    58         * @param    aFs : Open file server session
       
    59         * @param    aDatabase : CDRMRightsDB object
       
    60         * @param    aStatus : The request status to complete when the operation is 
       
    61         *                     fully done
       
    62         * @param    aDatabasePath : full pathname of the database path
       
    63         * @param    aTime : Time to check expiration against 
       
    64         *
       
    65         * @return   Functional CDRMActiveDeletion object, Function leaves if an error
       
    66         *           occurs.
       
    67         */
       
    68         static CDRMActiveDeletion* NewLC( const RMessagePtr2& aMessage,
       
    69                                           CDRMDbSession& aSession );
       
    70           
       
    71         /**
       
    72         * Destructor
       
    73         */
       
    74         virtual ~CDRMActiveDeletion();
       
    75 
       
    76     public: // New functions    
       
    77 
       
    78         /**
       
    79         * ActivateL
       
    80         * 
       
    81         * Activates the object by adding it to scheduler etc.
       
    82         *
       
    83         * @since    3.0
       
    84         * @return   None
       
    85         *
       
    86         */      
       
    87         void ActivateL( const TTime& aSecureTime,
       
    88                         CDRMRightsDB& aDb );
       
    89          
       
    90     protected:
       
    91     
       
    92         /**
       
    93         * Default Constructor - First phase.
       
    94         */
       
    95         CDRMActiveDeletion( const RMessagePtr2& aMessage,
       
    96                             CDRMDbSession& aSession ); 
       
    97         
       
    98         /**
       
    99         * From CActive: RunL.
       
   100         */
       
   101         void RunL();
       
   102 
       
   103         /**
       
   104         * From CActive: DoCancel performs cancel
       
   105         */        
       
   106         void DoCancel();
       
   107       
       
   108         /**
       
   109         * From CActive: RunError checks the errors from RunL.
       
   110         */
       
   111         // void RunError();                        
       
   112                         
       
   113     private:
       
   114         /**
       
   115         * Default Constructor - First phase. Prevented.
       
   116         */
       
   117         CDRMActiveDeletion(); 
       
   118     
       
   119         /**
       
   120         * Assignment operator - Prevented
       
   121         */
       
   122         CDRMActiveDeletion& operator =( const CDRMActiveDeletion& );    
       
   123     
       
   124         /**
       
   125         * Copy constructor - Prevented
       
   126         */
       
   127         CDRMActiveDeletion( const CDRMActiveDeletion& );                
       
   128      
       
   129     private:
       
   130         // The message.
       
   131         const RMessagePtr2& iMessage;
       
   132         CDRMDbSession& iSession;
       
   133     
       
   134         // The instane doing the deletion.
       
   135         CActive* iActiveOperation;
       
   136     };
       
   137 
       
   138 #endif      // DRMACTIVEDELETION_H   
       
   139             
       
   140 // End of File