btobexprofiles/obexserviceman/utils/src/obexutilsdialogtimer.cpp
author hgs
Fri, 28 May 2010 17:03:06 +0300
changeset 32 19bd632b5100
permissions -rw-r--r--
201021
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
// INCLUDE FILES
hgs
parents:
diff changeset
    20
#include "obexutilsdialogtimer.h"
hgs
parents:
diff changeset
    21
#include "obexutilsdebug.h"
hgs
parents:
diff changeset
    22
hgs
parents:
diff changeset
    23
// ============================ MEMBER FUNCTIONS ===============================
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    26
// C++ default constructor can NOT contain any code, that
hgs
parents:
diff changeset
    27
// might leave.
hgs
parents:
diff changeset
    28
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    29
//
hgs
parents:
diff changeset
    30
CObexUtilsDialogTimer::CObexUtilsDialogTimer( CObexUtilsDialog* aParent)
hgs
parents:
diff changeset
    31
                               : CTimer( EPriorityLow ), 
hgs
parents:
diff changeset
    32
                                 iParent( aParent )
hgs
parents:
diff changeset
    33
    {
hgs
parents:
diff changeset
    34
    CActiveScheduler::Add( this );
hgs
parents:
diff changeset
    35
    }
hgs
parents:
diff changeset
    36
hgs
parents:
diff changeset
    37
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    38
// CObexUtilsDialogTimer::ConstructL
hgs
parents:
diff changeset
    39
// Symbian OS default constructor can leave.
hgs
parents:
diff changeset
    40
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    41
//
hgs
parents:
diff changeset
    42
void CObexUtilsDialogTimer::ConstructL()
hgs
parents:
diff changeset
    43
    {
hgs
parents:
diff changeset
    44
    FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::ConstructL()"));
hgs
parents:
diff changeset
    45
hgs
parents:
diff changeset
    46
    CTimer::ConstructL();
hgs
parents:
diff changeset
    47
hgs
parents:
diff changeset
    48
    FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::ConstructL() completed"));
hgs
parents:
diff changeset
    49
    }
hgs
parents:
diff changeset
    50
hgs
parents:
diff changeset
    51
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    52
// CObexUtilsDialogTimer::NewL
hgs
parents:
diff changeset
    53
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    54
CObexUtilsDialogTimer* CObexUtilsDialogTimer::NewL( CObexUtilsDialog* aParent)
hgs
parents:
diff changeset
    55
    {
hgs
parents:
diff changeset
    56
    CObexUtilsDialogTimer* self = 
hgs
parents:
diff changeset
    57
        new( ELeave ) CObexUtilsDialogTimer( aParent );
hgs
parents:
diff changeset
    58
hgs
parents:
diff changeset
    59
    CleanupStack::PushL( self );
hgs
parents:
diff changeset
    60
    self->ConstructL();
hgs
parents:
diff changeset
    61
    CleanupStack::Pop( self );
hgs
parents:
diff changeset
    62
    return self;
hgs
parents:
diff changeset
    63
    }
hgs
parents:
diff changeset
    64
hgs
parents:
diff changeset
    65
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    66
// Destructor
hgs
parents:
diff changeset
    67
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    68
//
hgs
parents:
diff changeset
    69
CObexUtilsDialogTimer::~CObexUtilsDialogTimer()
hgs
parents:
diff changeset
    70
    {
hgs
parents:
diff changeset
    71
    Cancel();
hgs
parents:
diff changeset
    72
    }
hgs
parents:
diff changeset
    73
hgs
parents:
diff changeset
    74
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    75
// CObexUtilsDialogTimer::Tickle
hgs
parents:
diff changeset
    76
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    77
//
hgs
parents:
diff changeset
    78
void CObexUtilsDialogTimer::Tickle()
hgs
parents:
diff changeset
    79
    {
hgs
parents:
diff changeset
    80
    FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::Tickle()"));
hgs
parents:
diff changeset
    81
hgs
parents:
diff changeset
    82
    Cancel();
hgs
parents:
diff changeset
    83
    After( iTimeout );
hgs
parents:
diff changeset
    84
hgs
parents:
diff changeset
    85
    FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::Tickle() completed"));
hgs
parents:
diff changeset
    86
    }
hgs
parents:
diff changeset
    87
hgs
parents:
diff changeset
    88
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    89
// CObexUtilsDialogTimer::RunL
hgs
parents:
diff changeset
    90
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    91
//
hgs
parents:
diff changeset
    92
void CObexUtilsDialogTimer::RunL()
hgs
parents:
diff changeset
    93
    {
hgs
parents:
diff changeset
    94
    FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::RunL()"));
hgs
parents:
diff changeset
    95
    if (iParent)
hgs
parents:
diff changeset
    96
        {
hgs
parents:
diff changeset
    97
        iParent->UpdateProgressDialog();
hgs
parents:
diff changeset
    98
        }
hgs
parents:
diff changeset
    99
hgs
parents:
diff changeset
   100
    FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::RunL() completed"));
hgs
parents:
diff changeset
   101
    }
hgs
parents:
diff changeset
   102
hgs
parents:
diff changeset
   103
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   104
// CObexUtilsDialogTimer::SetTimeout
hgs
parents:
diff changeset
   105
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   106
//
hgs
parents:
diff changeset
   107
void CObexUtilsDialogTimer::SetTimeout( TTimeIntervalMicroSeconds32 aTimeout )
hgs
parents:
diff changeset
   108
    {
hgs
parents:
diff changeset
   109
    iTimeout = aTimeout;
hgs
parents:
diff changeset
   110
    }
hgs
parents:
diff changeset
   111
hgs
parents:
diff changeset
   112
//  End of File