omadrm/drmengine/server/inc/DRMObsoleteFinder.h
changeset 23 493788a4a8a4
parent 0 95b198f216e5
equal deleted inserted replaced
5:79d62d1d7957 23:493788a4a8a4
    20 #define DRMOBSOLETEFINDER_H
    20 #define DRMOBSOLETEFINDER_H
    21 
    21 
    22 // INCLUDES
    22 // INCLUDES
    23 
    23 
    24 #include <e32base.h>
    24 #include <e32base.h>
    25 #include "drmpointerarray.h"
    25 #include "DRMPointerArray.h"
    26 
    26 
    27 // CONSTANTS
    27 // CONSTANTS
    28 
    28 
    29 // MACROS
    29 // MACROS
    30 
    30 
    33 // FORWARD DECLARATIONS
    33 // FORWARD DECLARATIONS
    34 class RFs;
    34 class RFs;
    35 class CDir;
    35 class CDir;
    36 class CDRMRightsDB;
    36 class CDRMRightsDB;
    37 class CDcfRep;
    37 class CDcfRep;
    38                                                          
    38 
    39 
    39 
    40 // FUNCTION PROTOTYPES
    40 // FUNCTION PROTOTYPES
    41 
    41 
    42 // CLASS DECLARATION
    42 // CLASS DECLARATION
    43 
    43 
    50 */
    50 */
    51 
    51 
    52 NONSHARABLE_CLASS( CDRMObsoleteFinder ) : public CActive
    52 NONSHARABLE_CLASS( CDRMObsoleteFinder ) : public CActive
    53     {
    53     {
    54     public: // Constructors and destructor
    54     public: // Constructors and destructor
    55         
    55 
    56         /**
    56         /**
    57         * NewL
    57         * NewL
    58         *
    58         *
    59         * Creates an instance of the CDRMObsoleteFinder class and returns a pointer
    59         * Creates an instance of the CDRMObsoleteFinder class and returns a pointer
    60         * to it
    60         * to it
    61         *
    61         *
    62         * @since    3.0
    62         * @since    3.0
    63         * @param    aFs : Open file server session
    63         * @param    aFs : Open file server session
    64         * @param    aDatabase : CDRMRightsDB object
    64         * @param    aDatabase : CDRMRightsDB object
    65         * @param    aStatus : The request status to complete when the operation is 
    65         * @param    aStatus : The request status to complete when the operation is
    66         *                     fully done
    66         *                     fully done
    67         * @param    aStream : stream to write the result into
    67         * @param    aStream : stream to write the result into
    68         * @param    aPerformScan : if a filesystem scan need to be performed
    68         * @param    aPerformScan : if a filesystem scan need to be performed
    69         *
    69         *
    70         * @return   Functional CDRMObsoleteFinder object, Function leaves if an error
    70         * @return   Functional CDRMObsoleteFinder object, Function leaves if an error
    73         static CDRMObsoleteFinder* NewL( RFs& aFs,
    73         static CDRMObsoleteFinder* NewL( RFs& aFs,
    74                                         CDRMRightsDB* aDatabase,
    74                                         CDRMRightsDB* aDatabase,
    75                                         TRequestStatus& aStatus,
    75                                         TRequestStatus& aStatus,
    76                                         RWriteStream& aStream,
    76                                         RWriteStream& aStream,
    77                                         TBool aPerformScan );
    77                                         TBool aPerformScan );
    78           
    78 
    79         /**
    79         /**
    80         * Destructor
    80         * Destructor
    81         */
    81         */
    82         virtual ~CDRMObsoleteFinder();
    82         virtual ~CDRMObsoleteFinder();
    83 
    83 
    84     public: // New functions    
    84     public: // New functions
    85 
    85 
    86         /**
    86         /**
    87         * ExecuteCleanupLD
    87         * ExecuteCleanupLD
    88         * 
    88         *
    89         * Delete expired permissions. The object is deleted when
    89         * Delete expired permissions. The object is deleted when
    90         * the function completes
    90         * the function completes
    91         *
    91         *
    92         * @since    3.0
    92         * @since    3.0
    93         * @return   None
    93         * @return   None
    94         *
    94         *
    95         */      
    95         */
    96         void ExecuteFinderLD();
    96         void ExecuteFinderLD();
    97         
    97 
    98         
    98 
    99         void DoCleanup();
    99         void DoCleanup();
   100          
   100 
   101     protected:
   101     protected:
   102         /**
   102         /**
   103         * From CActive: RunL.
   103         * From CActive: RunL.
   104         */
   104         */
   105         void RunL();
   105         void RunL();
   106 
   106 
   107 
   107 
   108         /**
   108         /**
   109         * From CActive: DoCancel performs cancel
   109         * From CActive: DoCancel performs cancel
   110         */        
   110         */
   111         void DoCancel();
   111         void DoCancel();
   112       
   112 
   113         /**
   113         /**
   114         * From CActive: RunError checks the errors from RunL.
   114         * From CActive: RunError checks the errors from RunL.
   115         */
   115         */
   116         TInt RunError( TInt aError );                        
   116         TInt RunError( TInt aError );
   117                         
   117 
   118     private:
   118     private:
   119         /**
   119         /**
   120         * Default Constructor - First phase. Prevented.
   120         * Default Constructor - First phase. Prevented.
   121         */
   121         */
   122         CDRMObsoleteFinder(); 
   122         CDRMObsoleteFinder();
   123     
   123 
   124         /**
   124         /**
   125         * Default Constructor - First phase.
   125         * Default Constructor - First phase.
   126         */
   126         */
   127         CDRMObsoleteFinder( RFs& aFs,
   127         CDRMObsoleteFinder( RFs& aFs,
   128                             CDRMRightsDB* aDatabase,
   128                             CDRMRightsDB* aDatabase,
   129                             TRequestStatus& aStatus,
   129                             TRequestStatus& aStatus,
   130                             RWriteStream& aStream ); 
   130                             RWriteStream& aStream );
   131         
   131 
   132         /**
   132         /**
   133         * ConstructL
   133         * ConstructL
   134         *
   134         *
   135         * Second phase constructor
   135         * Second phase constructor
   136         *
   136         *
   137         * @since  3.0
   137         * @since  3.0
   138         * @return Leaves if an error occurs
   138         * @return Leaves if an error occurs
   139         */  
   139         */
   140         void ConstructL( const TBool aPerformScan );  
   140         void ConstructL( const TBool aPerformScan );
   141 
   141 
   142         /**
   142         /**
   143         * Assignment operator - Prevented
   143         * Assignment operator - Prevented
   144         */
   144         */
   145         CDRMObsoleteFinder& operator =( const CDRMObsoleteFinder& );    
   145         CDRMObsoleteFinder& operator =( const CDRMObsoleteFinder& );
   146     
   146 
   147         /**
   147         /**
   148         * Copy constructor - Prevented
   148         * Copy constructor - Prevented
   149         */
   149         */
   150         CDRMObsoleteFinder( const CDRMObsoleteFinder& );                
   150         CDRMObsoleteFinder( const CDRMObsoleteFinder& );
   151 
   151 
   152 
   152 
   153         /**
   153         /**
   154         * Get possible parents the content if there are any
   154         * Get possible parents the content if there are any
   155         *
   155         *
   169         * @since    3.0
   169         * @since    3.0
   170         * @return   none
   170         * @return   none
   171         * @leave    Symbian OS error code
   171         * @leave    Symbian OS error code
   172         */
   172         */
   173         void ObsoleteToStreamL();
   173         void ObsoleteToStreamL();
   174      
   174 
   175     private:
   175     private:
   176         // Dcf repository client
   176         // Dcf repository client
   177         CDcfRep* iDcfClient;
   177         CDcfRep* iDcfClient;
   178         
   178 
   179         // List of content id's
   179         // List of content id's
   180         CDRMPointerArray<HBufC8>* iContents;
   180         CDRMPointerArray<HBufC8>* iContents;
   181         
   181 
   182         // List of content id's
   182         // List of content id's
   183         CDRMPointerArray<HBufC8>* iParents;
   183         CDRMPointerArray<HBufC8>* iParents;
   184         
   184 
   185         // List of content id's
   185         // List of content id's
   186         CDRMPointerArray<HBufC8>* iNoContents;
   186         CDRMPointerArray<HBufC8>* iNoContents;
   187                                
   187 
   188         // Index we are going at:
   188         // Index we are going at:
   189         TInt iIndex;
   189         TInt iIndex;
   190     
   190 
   191         // fileserver session
   191         // fileserver session
   192         RFs& iFileServer;
   192         RFs& iFileServer;
   193 
   193 
   194         // output stream
   194         // output stream
   195         RWriteStream& iStream;
   195         RWriteStream& iStream;
   196     
   196 
   197         // rights database file, fileserver subsession
   197         // rights database file, fileserver subsession
   198         CDRMRightsDB* iRightsDb;
   198         CDRMRightsDB* iRightsDb;
   199     
   199 
   200         // request status to be set complete
   200         // request status to be set complete
   201         TRequestStatus& iOperationStatus;
   201         TRequestStatus& iOperationStatus;
   202         
   202 
   203         // State of the active object
   203         // State of the active object
   204         TInt iState;
   204         TInt iState;
   205         
   205 
   206         // Cancelling status
   206         // Cancelling status
   207         TInt iCancel;
   207         TInt iCancel;
   208     };
   208     };
   209 
   209 
   210 #endif      // DRMOBSOLETEFINDER_H   
   210 #endif      // DRMOBSOLETEFINDER_H
   211             
   211 
   212 // End of File
   212 // End of File