photosgallery/viewframework/views/cloudview/src/glxbubbletimer.cpp
changeset 0 4e91876724a2
child 18 bcb43dc84c44
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     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 	//if (iTimer)	
       
    37 	//	{
       
    38 	//iTimer.Cancel ();
       
    39 	iTimer.Close ();
       
    40 	//}
       
    41 	if ( iNotifier)
       
    42 		{
       
    43 		iNotifier =NULL;
       
    44 		}
       
    45 	}
       
    46 
       
    47 // ConstructL
       
    48 // ---------------------------------------------------------------------------
       
    49 // 
       
    50 void CGlxBubbleTimer::ConstructL()
       
    51 	{
       
    52 	TRACER("GLX_CLOUD::CGlxBubbleTimer::ConstructL()");
       
    53 	User::LeaveIfError (iTimer.CreateLocal ());
       
    54 	}
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // Two-phased constructor.
       
    58 // ---------------------------------------------------------------------------
       
    59 // 
       
    60 CGlxBubbleTimer *CGlxBubbleTimer::NewL(MGlxTimerNotifier *aNotifier)
       
    61 	{
       
    62 	TRACER("GLX_CLOUD::CGlxBubbleTimer::NewL");
       
    63 	CGlxBubbleTimer *self = new(ELeave)CGlxBubbleTimer(aNotifier);
       
    64 	CleanupStack::PushL (self);
       
    65 	self->ConstructL ();
       
    66 	CleanupStack::Pop (self);
       
    67 	return self;
       
    68 	}
       
    69 
       
    70 // ---------------------------------------------------------------------------
       
    71 // Default C++ Constructor
       
    72 // ---------------------------------------------------------------------------
       
    73 // 
       
    74 
       
    75 CGlxBubbleTimer::CGlxBubbleTimer(MGlxTimerNotifier *aNotifier) :
       
    76 	CActive(0), iNotifier(aNotifier)
       
    77 	{
       
    78 	TRACER("GLX_CLOUD::CGlxBubbleTimer::CGlxBubbleTimer");
       
    79 	CActiveScheduler::Add (this);
       
    80 
       
    81 	}
       
    82 
       
    83 // ---------------------------------------------------------------------------
       
    84 // SetDelay()
       
    85 // ---------------------------------------------------------------------------
       
    86 //
       
    87 void CGlxBubbleTimer::SetDelay(TTimeIntervalMicroSeconds32 aDelay)
       
    88     {
       
    89     TRACER("GLX_CLOUD::CGlxBubbleTimer::SetDelay");
       
    90     //iTimer.Cancel() ;
       
    91     Cancel ();
       
    92 
       
    93     _LIT(KDelayedHelloPanic, "CGlxBubbleTimer");
       
    94     __ASSERT_ALWAYS(!IsActive(), User::Panic(KDelayedHelloPanic, 1));
       
    95     // iTimer.Close() ;
       
    96     if( !IsActive() )
       
    97         {
       
    98         iTimer.After (iStatus, aDelay);
       
    99         SetActive ();
       
   100         }
       
   101     }
       
   102 
       
   103 // ---------------------------------------------------------------------------
       
   104 // RunL()
       
   105 // ---------------------------------------------------------------------------
       
   106 //
       
   107 void CGlxBubbleTimer::RunL()
       
   108 	{
       
   109 	TRACER("GLX_CLOUD::CGlxBubbleTimer::RunL");
       
   110 	iNotifier->TimerComplete (); //notify that timer is over
       
   111 	}
       
   112 
       
   113 // ---------------------------------------------------------------------------
       
   114 // DoCancel()
       
   115 // ---------------------------------------------------------------------------
       
   116 //
       
   117 
       
   118 void CGlxBubbleTimer::DoCancel()
       
   119 	{
       
   120 	TRACER("GLX_CLOUD::CGlxBubbleTimer::DoCancel");
       
   121 	iTimer.Cancel ();
       
   122 	}
       
   123 
       
   124 //  End of File