photosgallery/viewframework/views/cloudview/src/glxbubbletimer.cpp
branchRCL_3
changeset 26 5b3385a43d68
equal deleted inserted replaced
25:8e5f6eea9c9f 26:5b3385a43d68
       
     1 /*
       
     2 * Copyright (c) 2008-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:    Implementation of Cloud view
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include "glxbubbletimer.h" //class declaration
       
    23 
       
    24 #include <glxtracer.h>					// For Logs
       
    25 
       
    26 
       
    27 // ======== MEMBER FUNCTIONS ========
       
    28 // ---------------------------------------------------------------------------
       
    29 // Destructor
       
    30 // ---------------------------------------------------------------------------
       
    31 //
       
    32 
       
    33 CGlxBubbleTimer::~CGlxBubbleTimer()
       
    34 	{
       
    35 	TRACER("GLX_CLOUD::CGlxBubbleTimer::~CGlxBubbleTimer");
       
    36 	iTimer.Close ();
       
    37 	if ( iNotifier)
       
    38 		{
       
    39 		iNotifier =NULL;
       
    40 		}
       
    41 	}
       
    42 
       
    43 // ConstructL
       
    44 // ---------------------------------------------------------------------------
       
    45 // 
       
    46 void CGlxBubbleTimer::ConstructL()
       
    47 	{
       
    48 	TRACER("GLX_CLOUD::CGlxBubbleTimer::ConstructL()");
       
    49 	User::LeaveIfError (iTimer.CreateLocal ());
       
    50 	}
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 // Two-phased constructor.
       
    54 // ---------------------------------------------------------------------------
       
    55 // 
       
    56 CGlxBubbleTimer *CGlxBubbleTimer::NewL(MGlxTimerNotifier *aNotifier)
       
    57 	{
       
    58 	TRACER("GLX_CLOUD::CGlxBubbleTimer::NewL");
       
    59 	CGlxBubbleTimer *self = new(ELeave)CGlxBubbleTimer(aNotifier);
       
    60 	CleanupStack::PushL (self);
       
    61 	self->ConstructL ();
       
    62 	CleanupStack::Pop (self);
       
    63 	return self;
       
    64 	}
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // Default C++ Constructor
       
    68 // ---------------------------------------------------------------------------
       
    69 // 
       
    70 
       
    71 CGlxBubbleTimer::CGlxBubbleTimer(MGlxTimerNotifier *aNotifier) :
       
    72 	CActive(0), iNotifier(aNotifier)
       
    73 	{
       
    74 	TRACER("GLX_CLOUD::CGlxBubbleTimer::CGlxBubbleTimer");
       
    75 	CActiveScheduler::Add (this);
       
    76 
       
    77 	}
       
    78 
       
    79 // ---------------------------------------------------------------------------
       
    80 // SetDelay()
       
    81 // ---------------------------------------------------------------------------
       
    82 //
       
    83 void CGlxBubbleTimer::SetDelay(TTimeIntervalMicroSeconds32 aDelay)
       
    84     {
       
    85     TRACER("GLX_CLOUD::CGlxBubbleTimer::SetDelay");
       
    86     //iTimer.Cancel() ;
       
    87     Cancel ();
       
    88 
       
    89     _LIT(KDelayedHelloPanic, "CGlxBubbleTimer");
       
    90     __ASSERT_ALWAYS(!IsActive(), User::Panic(KDelayedHelloPanic, 1));
       
    91     // iTimer.Close() ;
       
    92     if( !IsActive() )
       
    93         {
       
    94         iTimer.After (iStatus, aDelay);
       
    95         SetActive ();
       
    96         }
       
    97     }
       
    98 
       
    99 // ---------------------------------------------------------------------------
       
   100 // RunL()
       
   101 // ---------------------------------------------------------------------------
       
   102 //
       
   103 void CGlxBubbleTimer::RunL()
       
   104 	{
       
   105 	TRACER("GLX_CLOUD::CGlxBubbleTimer::RunL");
       
   106 	iNotifier->TimerCompleteL(); //notify that timer is over
       
   107 	}
       
   108 
       
   109 // ---------------------------------------------------------------------------
       
   110 // DoCancel()
       
   111 // ---------------------------------------------------------------------------
       
   112 //
       
   113 
       
   114 void CGlxBubbleTimer::DoCancel()
       
   115 	{
       
   116 	TRACER("GLX_CLOUD::CGlxBubbleTimer::DoCancel");
       
   117 	iTimer.Cancel ();
       
   118 	}
       
   119 
       
   120 //  End of File