EngSrc/ImageMonitorAO.cpp
changeset 3 93fff7023be8
equal deleted inserted replaced
2:e1e28b0273b0 3:93fff7023be8
       
     1 /*
       
     2 * Copyright (c) 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: Juha Kauppinen, Mika Hokkanen
       
    13 * 
       
    14 * Description: Photo Browser
       
    15 *
       
    16 */
       
    17 
       
    18 #include "IEEngineImp.h"
       
    19 #include "ImageMonitorAO.h"
       
    20 
       
    21 // Here Engine pointer is not required 
       
    22 // we will define one internal observer class between Engine and ImageMonitor thread
       
    23 // 
       
    24     
       
    25 CImageMonitorAO* CImageMonitorAO::NewL(CIEEngineImp* aEngImp)
       
    26 {
       
    27 CImageMonitorAO* self = new(ELeave) CImageMonitorAO(aEngImp);
       
    28     CleanupStack::PushL(self);
       
    29     self->ConstructL();
       
    30     CleanupStack::Pop();
       
    31     return self;
       
    32 }
       
    33 
       
    34 CImageMonitorAO* CImageMonitorAO::NewLC(CIEEngineImp* aEngImp)
       
    35     {
       
    36     CImageMonitorAO* self = new(ELeave) CImageMonitorAO(aEngImp);
       
    37     CleanupStack::PushL( self );
       
    38     self->ConstructL();
       
    39     return self;
       
    40     }
       
    41 
       
    42  
       
    43 CImageMonitorAO::CImageMonitorAO(CIEEngineImp* aEngImp) :
       
    44         CActive(CActive::EPriorityLow),
       
    45         iEngImp(aEngImp)
       
    46         
       
    47     {
       
    48     CActiveScheduler::Add(this);
       
    49     }
       
    50 
       
    51 void CImageMonitorAO::ConstructL()
       
    52     {
       
    53         
       
    54     }
       
    55 
       
    56 
       
    57 CImageMonitorAO::~CImageMonitorAO()
       
    58     {
       
    59     Cancel();
       
    60     }
       
    61  
       
    62 void CImageMonitorAO::RunL()
       
    63     {
       
    64     iEngImp->AllFilesAddedToFilenameArrayL();
       
    65     }
       
    66 
       
    67  
       
    68 void CImageMonitorAO::DoCancel()
       
    69     {
       
    70     }
       
    71 
       
    72  
       
    73 void CImageMonitorAO::RunError()
       
    74     {
       
    75     // Nothing here
       
    76     }
       
    77 
       
    78 //This name should be changed to IssueActiveRequest()
       
    79 //This is more meaningful...
       
    80 void CImageMonitorAO::ActiveRequest()
       
    81     {
       
    82     if(!IsActive())
       
    83         SetActive();
       
    84     }
       
    85 
       
    86