systemswstubs/exampledsy/src/dsyhelper.cpp
changeset 43 e71858845f73
parent 40 b7e5ed8c1342
child 46 e1758cbb96ac
equal deleted inserted replaced
40:b7e5ed8c1342 43:e71858845f73
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *    It implements the class CDosHelperExample.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include "DsyHelper.h"
       
    21 #include "DsyDebug.h"
       
    22 
       
    23 //
       
    24 // ---------------------------------------------------------
       
    25 // CDosHelperExample::NewL
       
    26 // ---------------------------------------------------------
       
    27 //  
       
    28 CDosHelperExample* CDosHelperExample::NewL()
       
    29 {
       
    30 	FLOG(_L("CDosHelperExample::NewL()"));
       
    31 
       
    32 	CDosHelperExample* result = new (ELeave) CDosHelperExample;
       
    33 
       
    34 	CleanupStack::PushL(result);
       
    35 	result->ConstructL();
       
    36 	CleanupStack::Pop();
       
    37 
       
    38 	return result;
       
    39 }
       
    40 
       
    41 //
       
    42 // ---------------------------------------------------------
       
    43 // CDosHelperExample::ConstructL
       
    44 // ---------------------------------------------------------
       
    45 //  
       
    46 void CDosHelperExample::ConstructL()
       
    47 {
       
    48 	FLOG(_L("CDosHelperExample::ConstructL()"));
       
    49 }
       
    50 
       
    51 //
       
    52 // ---------------------------------------------------------
       
    53 // CDosHelperExample::GetStartupReasonL
       
    54 // ---------------------------------------------------------
       
    55 //  
       
    56 TInt CDosHelperExample::GetStartupReasonL(TInt& aReason)
       
    57 {
       
    58 	FLOG(_L("CDosHelperExample::GetStartupReasonL()"));
       
    59 
       
    60 /*Returns the Startup Reason from the DOS point of view. These are the values (defined in
       
    61   startupreasons.h):
       
    62 
       
    63 	ENormal
       
    64 	EAlarm
       
    65 	EMidnightAlarm
       
    66 	EHiddenReset
       
    67 	ECharger
       
    68 	ETest
       
    69 	ELocal
       
    70 	ESelftestFail
       
    71 	ENotReadFromHardware
       
    72 	ENotKnown
       
    73 */
       
    74 	aReason = 0; //ENormal
       
    75 
       
    76 	return KErrNone;
       
    77 }
       
    78 
       
    79 
       
    80 //
       
    81 // ---------------------------------------------------------
       
    82 // CDosHelperExample::GetSWStartupReasonL
       
    83 // ---------------------------------------------------------
       
    84 //  
       
    85 TInt CDosHelperExample::GetSWStartupReasonL(TInt16& aReason)
       
    86 {
       
    87 	FLOG(_L("CDosHelperExample::GetSWStartupReasonL()"));
       
    88 
       
    89 	// provide a list with the Possible Startup Reasons
       
    90 
       
    91 	
       
    92 	//Retrieve from one previousily stored in SetSWStartupReason
       
    93 	aReason = 100; //Normal
       
    94 
       
    95 
       
    96 	return KErrNone;
       
    97 }
       
    98 
       
    99 //
       
   100 // ---------------------------------------------------------
       
   101 // CDosHelperExample::SetSWStartupReasonL
       
   102 // ---------------------------------------------------------
       
   103 //  
       
   104 TInt CDosHelperExample::SetSWStartupReasonL(TInt16 /*aReason*/)
       
   105 {
       
   106 	FLOG(_L("CDosHelperExample::SetSWStartupReasonL()"));
       
   107 
       
   108 	//Store the value to be got from GetSWStartupReason
       
   109 
       
   110 	return KErrNone;
       
   111 }
       
   112 
       
   113 
       
   114 //
       
   115 // ---------------------------------------------------------
       
   116 // CDosHelperExample::HiddenResetL
       
   117 // ---------------------------------------------------------
       
   118 //  
       
   119 TBool CDosHelperExample::HiddenResetL()
       
   120 {
       
   121 	FLOG(_L("CDosHelperExample::HiddenResetL()"));
       
   122 
       
   123 	//Checks if the last reset was hidden or not.
       
   124 	return EFalse;
       
   125 }
       
   126 
       
   127 
       
   128 //
       
   129 // ---------------------------------------------------------
       
   130 // CDosHelperExample::GetRTCStatusL
       
   131 // ---------------------------------------------------------
       
   132 //  
       
   133 TInt CDosHelperExample::GetRTCStatusL(TBool& aStatus)
       
   134 {
       
   135 	FLOG(_L("CDosHelperExample::GetRTCStatusL()"));
       
   136 
       
   137 	// EFalse asks time and date in startup
       
   138 	aStatus = ETrue;
       
   139 
       
   140 	return KErrNone;
       
   141 }
       
   142 
       
   143 
       
   144 //
       
   145 // ---------------------------------------------------------
       
   146 // CDosHelperExample::GenerateGripEventL
       
   147 // ---------------------------------------------------------
       
   148 //  
       
   149 TInt CDosHelperExample::GenerateGripEventL()
       
   150 {
       
   151 	FLOG(_L("CDosHelperExample::GenerateGripEventL()"));
       
   152 
       
   153 	return KErrNone;
       
   154 }