emailservices/emailservermonitor/src/emailservermonitorutilities.cpp
branchRCL_3
changeset 10 f5907b1a1053
parent 0 8466d47a6819
equal deleted inserted replaced
8:e1b6206813b4 10:f5907b1a1053
   103         process.Close();
   103         process.Close();
   104         }
   104         }
   105     
   105     
   106     return EFalse;
   106     return EFalse;
   107     }
   107     }
       
   108 
       
   109 
       
   110 /////////////////////////////////////////////////////////////////////////////////
       
   111 // GENERIC TIMER
       
   112 //
       
   113 
       
   114 // -----------------------------------------------------------------------------
       
   115 // CEmailServerMonitorTimer::NewL
       
   116 // NewL function. Returns timer object.
       
   117 // -----------------------------------------------------------------------------
       
   118 //
       
   119 CEmailServerMonitorTimer* CEmailServerMonitorTimer::NewL(
       
   120     MEmailServerMonitorTimerCallback* aCallback,
       
   121     const TInt aPriority )
       
   122     {
       
   123     FUNC_LOG;
       
   124     CEmailServerMonitorTimer* self = NewLC( aCallback, aPriority );
       
   125     CleanupStack::Pop( self );
       
   126     return self;
       
   127     }
       
   128 
       
   129 // -----------------------------------------------------------------------------
       
   130 // CEmailServerMonitorTimer::NewL
       
   131 // NewL function. Returns timer object.
       
   132 // -----------------------------------------------------------------------------
       
   133 //
       
   134 CEmailServerMonitorTimer* CEmailServerMonitorTimer::NewLC(
       
   135     MEmailServerMonitorTimerCallback* aCallback,
       
   136     const TInt aPriority )
       
   137     {
       
   138     FUNC_LOG;
       
   139     CEmailServerMonitorTimer* self = new (ELeave) CEmailServerMonitorTimer( aCallback, aPriority );
       
   140     CleanupStack::PushL( self );
       
   141     self->ConstructL();
       
   142     return self;
       
   143     }
       
   144 
       
   145 // -----------------------------------------------------------------------------
       
   146 // CEmailServerMonitorTimer::NewL
       
   147 // NewL function. Returns timer object.
       
   148 // -----------------------------------------------------------------------------
       
   149 //
       
   150 void CEmailServerMonitorTimer::ConstructL()
       
   151     {
       
   152     FUNC_LOG;
       
   153     CTimer::ConstructL();
       
   154     CActiveScheduler::Add( this );
       
   155     }
       
   156 
       
   157 // -----------------------------------------------------------------------------
       
   158 // CEmailServerMonitorTimer::~CEmailServerMonitorTimer
       
   159 // D'tor
       
   160 // -----------------------------------------------------------------------------
       
   161 //
       
   162 CEmailServerMonitorTimer::~CEmailServerMonitorTimer()
       
   163     {
       
   164     FUNC_LOG;
       
   165     Cancel();
       
   166     iCallback = NULL;
       
   167     }
       
   168 
       
   169 // -----------------------------------------------------------------------------
       
   170 // CEmailServerMonitorTimer::CEmailServerMonitorTimer
       
   171 // C'tor
       
   172 // -----------------------------------------------------------------------------
       
   173 //
       
   174 CEmailServerMonitorTimer::CEmailServerMonitorTimer(
       
   175     MEmailServerMonitorTimerCallback* aCallback,
       
   176     const TInt aPriority )
       
   177     : CTimer( aPriority ),
       
   178     iCallback( aCallback )
       
   179     {
       
   180     }
       
   181 
       
   182 // -----------------------------------------------------------------------------
       
   183 // CEmailServerMonitorTimer::RunL
       
   184 // Timer trigger function.
       
   185 // -----------------------------------------------------------------------------
       
   186 //
       
   187 void CEmailServerMonitorTimer::RunL()
       
   188     {
       
   189     FUNC_LOG;
       
   190     if ( iCallback )
       
   191         {
       
   192         iCallback->TimerEventL( this );
       
   193         }
       
   194     }
       
   195 
       
   196 // -----------------------------------------------------------------------------
       
   197 // CEmailServerMonitorTimer::Start
       
   198 // Timer starting function.
       
   199 // -----------------------------------------------------------------------------
       
   200 //
       
   201 void CEmailServerMonitorTimer::Start( TInt aInterval )
       
   202     {
       
   203     FUNC_LOG;
       
   204     Cancel();
       
   205     After( TTimeIntervalMicroSeconds32( aInterval ) );
       
   206     }
       
   207 
       
   208 // -----------------------------------------------------------------------------
       
   209 // CEmailServerMonitorTimer::Stop
       
   210 // Timer stopping function
       
   211 // -----------------------------------------------------------------------------
       
   212 //
       
   213 void CEmailServerMonitorTimer::Stop()
       
   214     {
       
   215     FUNC_LOG;
       
   216     Cancel();
       
   217     }