systemswuis/touchscreencalib/tsccustcmds/src/tscstartupextension.cpp
branchRCL_3
changeset 14 5f281e37a2f5
parent 0 254040eb3b7d
equal deleted inserted replaced
13:90fe62538f66 14:5f281e37a2f5
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Declaration of CTSCStartupExtension class.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "tscstartupextension.h"
       
    19 #include "tscstartupextensiondef.h"
       
    20 #include "TSCPubSubObserver.h"
       
    21 
       
    22 
       
    23 // ======== MEMBER FUNCTIONS ========
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // CDiskSpaceReserve::NewL
       
    27 //
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 CTSCStartupExtension * CTSCStartupExtension ::NewL()
       
    31     {
       
    32     TRACES("CTSCStartupExtension :: NewL ()");
       
    33     CTSCStartupExtension * self = new ( ELeave ) CTSCStartupExtension ;
       
    34 
       
    35     return self;
       
    36     }
       
    37 
       
    38 
       
    39 // ---------------------------------------------------------------------------
       
    40 // Destructor
       
    41 //
       
    42 // ---------------------------------------------------------------------------
       
    43 //
       
    44 CTSCStartupExtension::~CTSCStartupExtension ()
       
    45     {
       
    46     TRACES("CTSCStartupExtension ::~CTSCStartupExtension ()");
       
    47 
       
    48     TRACES("CTSCStartupExtension ::~CTSCStartupExtension () End");
       
    49     }
       
    50 
       
    51 
       
    52 
       
    53 // ---------------------------------------------------------------------------
       
    54 // First phase constructor
       
    55 //
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 CTSCStartupExtension::CTSCStartupExtension()
       
    59     :iRequestSent(EFalse)
       
    60     {
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------------------------
       
    64 // CTSCStartupExtension::Initialize
       
    65 //
       
    66 // ---------------------------------------------------------------------------
       
    67 //
       
    68 TInt CTSCStartupExtension::Initialize( CSsmCustomCommandEnv* /*aCmdEnv*/ )
       
    69     {
       
    70     TRACES("CTSCStartupExtension::Initialize()");
       
    71     iTSCPubSubObserver = CTSCPubSubObserver::NewL( this );
       
    72     return KErrNone;
       
    73     }
       
    74 
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // CTSCStartupExtension::Execute
       
    78 //
       
    79 // ---------------------------------------------------------------------------
       
    80 //
       
    81 void CTSCStartupExtension::Execute(
       
    82     const TDesC8& /*aParams*/,
       
    83     TRequestStatus& aStatus )
       
    84     {
       
    85     TRACES("CTSCStartupExtension::ExecuteL()");    
       
    86     aStatus = KRequestPending;
       
    87     iStatus = &aStatus;
       
    88     TRACES("CTSCStartupExtension::ExecuteL(): End");
       
    89     }
       
    90 
       
    91 
       
    92 // ---------------------------------------------------------------------------
       
    93 // CTSCStartupExtension::ExecuteCancel
       
    94 //
       
    95 // ---------------------------------------------------------------------------
       
    96 //
       
    97 void CTSCStartupExtension::ExecuteCancel()
       
    98     {
       
    99     // Nothing to do.
       
   100     }
       
   101 
       
   102 
       
   103 // ---------------------------------------------------------------------------
       
   104 // CTSCStartupExtension::Release
       
   105 //
       
   106 // ---------------------------------------------------------------------------
       
   107 //
       
   108 void CTSCStartupExtension::Release()
       
   109     {
       
   110     delete this;
       
   111     }
       
   112 
       
   113 
       
   114 // ---------------------------------------------------------------------------
       
   115 // CTSCStartupExtension::Close
       
   116 //
       
   117 // ---------------------------------------------------------------------------
       
   118 //
       
   119 void CTSCStartupExtension::Close()
       
   120     {
       
   121     TRACES("CTSCStartupExtension :: Close()");
       
   122     if (iTSCPubSubObserver)
       
   123         {
       
   124         delete iTSCPubSubObserver;
       
   125         iTSCPubSubObserver = NULL;
       
   126         }
       
   127     TRACES("CTSCStartupExtension :: Close() End");
       
   128     }
       
   129 
       
   130 // ---------------------------------------------------------------------------
       
   131 // CTSCStartupExtension::CalibrationDone
       
   132 //
       
   133 // ---------------------------------------------------------------------------
       
   134 //
       
   135 void CTSCStartupExtension::CalibrationDone()
       
   136     {
       
   137     TRACES("CTSCStartupExtension::CalibrationDone()");
       
   138     if (!iRequestSent)
       
   139         {
       
   140         TRACES("CTSCStartupExtension::CalibrationDone(): Send complete request");
       
   141         TInt errorCode = KErrNone;    
       
   142         User::RequestComplete( iStatus, errorCode );
       
   143         iRequestSent = ETrue;
       
   144         }
       
   145     TRACES("CTSCStartupExtension::CalibrationDone(): End");
       
   146     }    
       
   147 
       
   148