omadrm/drmengine/dcfrepository/server/inc/DcfRepSrvSes.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  Server Session implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CDCFREPSRVSES_H
       
    21 #define CDCFREPSRVSES_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 
       
    27 // CONSTANTS
       
    28 // MACROS
       
    29 // DATA TYPES
       
    30 // FUNCTION PROTOTYPES
       
    31 // FORWARD DECLARATIONS
       
    32 class CPair;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 
       
    37 /**
       
    38 *  Server Session implementation.
       
    39 *  DCF Repository
       
    40 *
       
    41 *  @lib 
       
    42 *  @since Series 60 3.0 
       
    43 */
       
    44 class CDcfRepSrvSes : public CSession2
       
    45     {
       
    46     public:  // Constructors and destructor
       
    47         
       
    48         /**
       
    49         * Two-phased constructor.
       
    50         */
       
    51         static CDcfRepSrvSes* NewL();
       
    52         
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         virtual ~CDcfRepSrvSes();
       
    57 
       
    58     public: // New functions
       
    59     public: // Functions from base classes
       
    60 
       
    61         /**
       
    62         * From CSession2: Handles the service request event.
       
    63         * @since S60Rel3.0
       
    64         * @param aMessage The message related to the event.
       
    65         * @exception Method leaves with appropriate exception value
       
    66         *            if any errors occured.
       
    67         */
       
    68         void ServiceL( const RMessage2& aMessage );
       
    69         
       
    70     protected:  // New functions
       
    71     protected:  // Functions from base classes
       
    72     private:
       
    73 
       
    74         /**
       
    75         * C++ default constructor.
       
    76         */
       
    77         CDcfRepSrvSes();
       
    78 
       
    79         /**
       
    80         * By default Symbian 2nd phase constructor is private.
       
    81         */
       
    82         void ConstructL();
       
    83         
       
    84         /** 
       
    85         * AddFileL() will add a file info into database
       
    86         * @since S60Rel3.0
       
    87         * @param aMessage The message associated to the event.
       
    88         * @Leave with KErrNotSupported if file is not protected file
       
    89         */        
       
    90         void AddFileL( const RMessage2& aMessage );        
       
    91 
       
    92         /** 
       
    93         * ServiceL() runs DispatchL() under TRAP harness, so
       
    94         * all errors can be catched properly. DispatchL() then calls
       
    95         * appropriate private method depending on the request.
       
    96         * @since S60Rel3.0
       
    97         * @param aMessage The message associated to the event.
       
    98         */
       
    99         void DispatchL( const RMessage2& aMessage );
       
   100         
       
   101         /** 
       
   102         * FullScanL() will triger the file scan for all DCFs
       
   103         * @since S60Rel3.0
       
   104         * @param aMessage The message associated to the event.
       
   105         */        
       
   106         void FullScanL( const RMessage2& aMessage );
       
   107         
       
   108         
       
   109         /** 
       
   110         * ScanStartL() will initialize scanning dcfs for a list of content ID 
       
   111         * @since S60Rel3.0
       
   112         * @param aMessage The message associated to the event.
       
   113         */        
       
   114         void ScanStartL( const RMessage2& aMessage );
       
   115 
       
   116         /** 
       
   117         * ScanAddL() will add content ID into CID list for scanning
       
   118         * @since S60Rel3.0
       
   119         * @param aMessage The message associated to the event.
       
   120         */        
       
   121         void ScanAddL( const RMessage2& aMessage );
       
   122         
       
   123         /** 
       
   124         * ScanEndL() will finnally triger scanning dcfs for a list of content ID 
       
   125         * @since S60Rel3.0
       
   126         * @param aMessage The message associated to the event.
       
   127         */        
       
   128         void ScanEndL( const RMessage2& aMessage );
       
   129         
       
   130         
       
   131         /** 
       
   132         * SetTtidStartL() will initialize Ttid reset for a list of content ID 
       
   133         * @since S60Rel3.0
       
   134         * @param aMessage The message associated to the event.
       
   135         */        
       
   136         void SetTtidStartL( const RMessage2& aMessage );
       
   137 
       
   138         /** 
       
   139         * SetTtidAddL() will add a pair of content ID and transaction ID (ttid) into list for reset
       
   140         * @since S60Rel3.0
       
   141         * @param aMessage The message associated to the event.
       
   142         */        
       
   143         void SetTtidAddL( const RMessage2& aMessage );
       
   144         
       
   145         /** 
       
   146         * SetTtidEndL() will finnally triger scanning dcfs in order to reset them
       
   147         * @since S60Rel3.0
       
   148         * @param aMessage The message associated to the event.
       
   149         */        
       
   150         void SetTtidEndL( const RMessage2& aMessage );
       
   151 
       
   152         /** 
       
   153         * NotifyIdleL() will notify if server becomes idle
       
   154         * @since S60Rel3.0
       
   155         * @param aMessage The message associated to the event.
       
   156         */            
       
   157         void NotifyIdleL( const RMessage2& aMessage );
       
   158         
       
   159         /** 
       
   160         * Stop watching the RightsServer
       
   161         * @since S60Rel3.1
       
   162         * @param aMessage The message associated to the event.
       
   163         */            
       
   164         void StopWatchingL( const RMessage2& aMessage );
       
   165         
       
   166         // Prohibit copy constructor if not deriving from CBase.
       
   167         CDcfRepSrvSes( const CDcfRepSrvSes& );
       
   168         // Prohibit assigment operator if not deriving from CBase.
       
   169         CDcfRepSrvSes& operator=( const CDcfRepSrvSes& );
       
   170 
       
   171     public:     // Data
       
   172     protected:  // Data
       
   173     private:    // Data
       
   174         TInt iPreviousAction;
       
   175         RPointerArray<HBufC8>* iCidList;
       
   176         RPointerArray<CPair>* iPairList;
       
   177         RMessage2* iMessage;
       
   178 
       
   179     public:     // Friend classes
       
   180     protected:  // Friend classes
       
   181     private:    // Friend classes
       
   182     };
       
   183 
       
   184 #endif      // CDCFREPSRVSES_H   
       
   185             
       
   186 // End of File