omadrm/drmengine/drmclock/Inc/DRMClock.h
changeset 0 95b198f216e5
child 12 8a03a285ab14
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2003-2009 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:  Interface for the DRMClock
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DRMCLOCK_H
       
    20 #define DRMCLOCK_H
       
    21 
       
    22 // INCLUDES
       
    23 
       
    24 #include <e32base.h>	// CBase
       
    25 #include <e32std.h>
       
    26 #include <e32def.h>		// Type definitions
       
    27 #include <bacntf.h>
       
    28 #include <etelmm.h>
       
    29 #include <DrmTypes.h>
       
    30 #include <e32property.h>
       
    31 
       
    32 // CONSTANTS
       
    33 
       
    34 // MACROS
       
    35 
       
    36 // DATA TYPES
       
    37 
       
    38 // FUNCTION PROTOTYPES
       
    39 
       
    40 // FORWARD DECLARATIONS
       
    41 class CDRMNitzObserver;
       
    42 class CDRMNotifier;
       
    43 
       
    44 // CLASS DECLARATION
       
    45 
       
    46 /**
       
    47 *  CDRMClock implements the drm clock required by DRM Engine
       
    48 *
       
    49 *  @lib unipertar.exe
       
    50 *  @since 2.8
       
    51 */
       
    52 NONSHARABLE_CLASS( CDRMClock )
       
    53     {
       
    54     public:
       
    55 
       
    56         /**
       
    57         * NewLC
       
    58         *
       
    59         * Creates an instance of the CDRMClock class and returns a pointer to it
       
    60         * The function leaves the object into the cleanup stack
       
    61         *
       
    62         * @since  2.8
       
    63         * @return Functional CDRMClock object, Function leaves if an error occurs.
       
    64         */
       
    65         static CDRMClock* NewLC();
       
    66 
       
    67         /**
       
    68         * NewL
       
    69         *
       
    70         * Creates an instance of the CDRMClock class and returns a pointer to it
       
    71         *
       
    72         * @since  2.8
       
    73         * @return Functional CDRMClock object, Function leaves if an error occurs.
       
    74         */
       
    75         static CDRMClock* NewL();
       
    76   
       
    77         /**
       
    78         * Destructor
       
    79         */
       
    80         virtual ~CDRMClock();
       
    81 
       
    82         /**
       
    83         * GetSecureTime
       
    84         * 
       
    85         * Return the current time and the security of the current time
       
    86         *
       
    87         * @since 2.8
       
    88         * @param aTime : return parameter for time in UTC
       
    89         * @param aTimeZone : return parameter for the timezone in +/-15 minutes
       
    90         * @param aSecurityLevel : return parameter for security level
       
    91         * @return none
       
    92         */
       
    93         void GetSecureTime(TTime& aTime, TInt& aTimeZone, 
       
    94                            DRMClock::ESecurityLevel& aSecurityLevel);
       
    95 
       
    96         /**
       
    97         * ResetSecureTimeL
       
    98         *
       
    99         * Resets the secure time source and recalculates the offsets
       
   100         *
       
   101         * @since 2.8 
       
   102         * @param aSecureTime, the new secure time in UTC
       
   103         * @param aTimeZone, the time zone of the new secure time in +/- 15 minutes 
       
   104         * @return none, Function leaves with Symbian OS error code if an
       
   105         *         error occurs
       
   106         */
       
   107         void ResetSecureTimeL( const TTime& aSecureTime, const TInt& aTimeZone );
       
   108         
       
   109     protected:    
       
   110     private:
       
   111         /**
       
   112         * Default Constructor - First phase
       
   113         */
       
   114         CDRMClock();
       
   115 
       
   116          /**
       
   117         * ConstructL
       
   118         *
       
   119         * Second phase constructor
       
   120         *
       
   121         * @since  2.8
       
   122         * @return Leaves if an error occurs
       
   123         */	   
       
   124         void ConstructL();
       
   125  
       
   126         /**
       
   127         * ConnectToPhoneL
       
   128         *
       
   129         * Connects to the phone services
       
   130         *
       
   131         * @since 2.8
       
   132         * @return Leaves with symbian os error codes if an error occurs
       
   133         */
       
   134         void ConnectToPhoneL();
       
   135         
       
   136         // Variables
       
   137         CDRMNotifier* iNotifier;   
       
   138         
       
   139         // Nitz information handles      
       
   140         RTelServer iEtelServer;
       
   141         RMobilePhone iPhone;
       
   142         CDRMNitzObserver* iObserver;
       
   143     };
       
   144 #endif      // DRMCLOCK_H   
       
   145             
       
   146 // End of File