breakdeps/DRMEngine/DRMClock.h
changeset 88 ca165d35976d
child 90 62156f66dbad
equal deleted inserted replaced
87:e9fb2728ea8b 88:ca165d35976d
       
     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 class CGPSWatcher;
       
    44 
       
    45 // CLASS DECLARATION
       
    46 
       
    47 /**
       
    48 *  CDRMClock implements the drm clock required by DRM Engine
       
    49 *
       
    50 *  @lib unipertar.exe
       
    51 *  @since 2.8
       
    52 */
       
    53 NONSHARABLE_CLASS( CDRMClock )
       
    54     {
       
    55     public:
       
    56         // Notifications:        
       
    57         enum 
       
    58             {
       
    59             ENotifyNone = 0,    
       
    60             ENotifyGPSTimeReceived = 1    
       
    61             };    
       
    62     
       
    63     public:
       
    64 
       
    65         /**
       
    66         * NewLC
       
    67         *
       
    68         * Creates an instance of the CDRMClock class and returns a pointer to it
       
    69         * The function leaves the object into the cleanup stack
       
    70         *
       
    71         * @since  2.8
       
    72         * @return Functional CDRMClock object, Function leaves if an error occurs.
       
    73         */
       
    74         static CDRMClock* NewLC();
       
    75 
       
    76         /**
       
    77         * NewL
       
    78         *
       
    79         * Creates an instance of the CDRMClock class and returns a pointer to it
       
    80         *
       
    81         * @since  2.8
       
    82         * @return Functional CDRMClock object, Function leaves if an error occurs.
       
    83         */
       
    84         static CDRMClock* NewL();
       
    85   
       
    86         /**
       
    87         * Destructor
       
    88         */
       
    89         virtual ~CDRMClock();
       
    90 
       
    91         /**
       
    92         * GetSecureTime
       
    93         * 
       
    94         * Return the current time and the security of the current time
       
    95         *
       
    96         * @since 2.8
       
    97         * @param aTime : return parameter for time in UTC
       
    98         * @param aTimeZone : return parameter for the timezone in +/-15 minutes
       
    99         * @param aSecurityLevel : return parameter for security level
       
   100         * @return none
       
   101         */
       
   102         void GetSecureTime(TTime& aTime, TInt& aTimeZone, 
       
   103                            DRMClock::ESecurityLevel& aSecurityLevel);
       
   104 
       
   105         /**
       
   106         * ResetSecureTimeL
       
   107         *
       
   108         * Resets the secure time source and recalculates the offsets
       
   109         *
       
   110         * @since 2.8 
       
   111         * @param aSecureTime, the new secure time in UTC
       
   112         * @param aTimeZone, the time zone of the new secure time in +/- 15 minutes 
       
   113         * @return none, Function leaves with Symbian OS error code if an
       
   114         *         error occurs
       
   115         */
       
   116         void ResetSecureTimeL( const TTime& aSecureTime, const TInt& aTimeZone );
       
   117         
       
   118         
       
   119         /**
       
   120         * Notify
       
   121         *
       
   122         * Notifies about an event to the DRM Clock
       
   123         *
       
   124         * @since 9.2
       
   125         * @param Message The notification event   
       
   126         *
       
   127         */
       
   128         void Notify( TInt aMessage );
       
   129         
       
   130     protected:    
       
   131     private:
       
   132         /**
       
   133         * Default Constructor - First phase
       
   134         */
       
   135         CDRMClock();
       
   136 
       
   137          /**
       
   138         * ConstructL
       
   139         *
       
   140         * Second phase constructor
       
   141         *
       
   142         * @since  2.8
       
   143         * @return Leaves if an error occurs
       
   144         */	   
       
   145         void ConstructL();
       
   146  
       
   147         /**
       
   148         * ConnectToPhoneL
       
   149         *
       
   150         * Connects to the phone services
       
   151         *
       
   152         * @since 2.8
       
   153         * @return Leaves with symbian os error codes if an error occurs
       
   154         */
       
   155         void ConnectToPhoneL();
       
   156         
       
   157         // Variables
       
   158         CDRMNotifier* iNotifier;   
       
   159         
       
   160         // Nitz information handles      
       
   161         RTelServer iEtelServer;
       
   162         RMobilePhone iPhone;
       
   163         CDRMNitzObserver* iObserver;
       
   164         
       
   165         // GPS watcher component, updates DRM time from GPS if available
       
   166         CGPSWatcher* iGpsWatcher;
       
   167     };
       
   168 #endif      // DRMCLOCK_H   
       
   169             
       
   170 // End of File