phonebookengines/VirtualPhonebook/VPbkEng/src/CVPbkEmptyBatchOperation.cpp
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Virtual Phonebook Empty batch operation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "CVPbkEmptyBatchOperation.h"
       
    20 
       
    21 CVPbkEmptyBatchOperation::CVPbkEmptyBatchOperation(
       
    22         MVPbkBatchOperationObserver& aObserver) :
       
    23     CActive(CActive::EPriorityIdle),
       
    24     iObserver(aObserver)
       
    25     {
       
    26     CActiveScheduler::Add(this);
       
    27     }
       
    28 
       
    29 CVPbkEmptyBatchOperation::~CVPbkEmptyBatchOperation()
       
    30     {
       
    31     Cancel();
       
    32     }
       
    33 
       
    34 EXPORT_C CVPbkEmptyBatchOperation* CVPbkEmptyBatchOperation::NewLC(
       
    35         MVPbkBatchOperationObserver& aObserver)
       
    36     {
       
    37     CVPbkEmptyBatchOperation* self = new(ELeave) CVPbkEmptyBatchOperation(aObserver);
       
    38     CleanupStack::PushL(self);
       
    39     return self;
       
    40 	}
       
    41 
       
    42 void CVPbkEmptyBatchOperation::StartL()
       
    43     {
       
    44     IssueRequest();
       
    45     }
       
    46 
       
    47 void CVPbkEmptyBatchOperation::Cancel()
       
    48     {
       
    49     CActive::Cancel();
       
    50     }
       
    51 
       
    52 void CVPbkEmptyBatchOperation::RunL()
       
    53     {
       
    54     iObserver.OperationComplete(*this);
       
    55     }
       
    56 
       
    57 void CVPbkEmptyBatchOperation::DoCancel()
       
    58     {
       
    59     }
       
    60 
       
    61 void CVPbkEmptyBatchOperation::IssueRequest()
       
    62     {
       
    63     TRequestStatus* status = &iStatus;
       
    64     User::RequestComplete(status, KErrNone);
       
    65     SetActive();
       
    66     }
       
    67 
       
    68 
       
    69 // End of File