wmdrm/wmdrmengine/wmdrmserver/server/inc/clock.h
changeset 0 95b198f216e5
child 19 7c1aa284cf3b
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2007 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 definitions
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CLOCK_H
       
    20 #define __CLOCK_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 
       
    25 class CWmDrmServer;
       
    26 
       
    27 namespace DRM
       
    28     {
       
    29     class CDrmServiceApiWrapper;    
       
    30     }
       
    31 
       
    32 
       
    33 class CClock : public CTimer
       
    34 	{
       
    35 public:
       
    36 	static const TInt KClockInterval = 15 * 60 * 1000000;
       
    37 
       
    38     static CClock* CClock::NewL( CWmDrmServer* aServer );
       
    39 	~CClock();
       
    40 	CClock( CWmDrmServer* aServer );
       
    41 
       
    42     void ConstructL();
       
    43 
       
    44     void Start();
       
    45 
       
    46     static TInt ChangeCallback( TAny* aClock );
       
    47 
       
    48     void HandleChange();
       
    49 
       
    50     TInt ReadTimeL();
       
    51 
       
    52     TInt WriteTimeL();
       
    53 
       
    54     void EvaluateCurrentTime();
       
    55 
       
    56     TBool TimeIsGood();
       
    57 
       
    58     void SetTimeAsGoodL( TBool aGood );
       
    59     
       
    60     void GetTimeL( TTime& aTime, TBool& aValid );
       
    61 
       
    62 protected:
       
    63 
       
    64     void RunL();
       
    65 
       
    66 	CEnvironmentChangeNotifier* iChangeNotifier;
       
    67 	TTime iTime;
       
    68 	TBool iTimeIsGood;
       
    69 	CWmDrmServer* iServer;
       
    70 
       
    71 private:
       
    72     TInt LoadServiceApi();
       
    73     
       
    74     TBool iServiceApiLoaded;
       
    75 	DRM::CDrmServiceApiWrapper* iServiceApi;
       
    76 	RLibrary iServiceApiLib;
       
    77 
       
    78 	};
       
    79 
       
    80 #endif