locationdataharvester/mylocationsengine/inc/contactsubscriber.h
branchRCL_3
changeset 17 1fc85118c3ae
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
       
     1 /*
       
     2  * Copyright (c) 2010 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: Subscribe notification .
       
    15  *
       
    16  */
       
    17 #ifndef CONTACTSUBSCRIBER_H
       
    18 #define CONTACTSUBSCRIBER_H
       
    19 
       
    20 // INCLUDES
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <e32property.h>
       
    24 #include "notification.h" 
       
    25 class CContactSubscriber : public CActive
       
    26 {
       
    27 public:
       
    28     /** 
       
    29      * CContactSubscriber::NewL()
       
    30      */
       
    31     static CContactSubscriber* NewL(MNotifyChange* aNotifyChange);
       
    32 
       
    33     /** 
       
    34      * CContactSubscriber::NewL()
       
    35      */
       
    36     static CContactSubscriber* NewLC(MNotifyChange* aNotifyChange);
       
    37     /**
       
    38      * ~CContactSubscriber.
       
    39      * Virtual Destructor.
       
    40      */
       
    41     virtual ~ CContactSubscriber();
       
    42 
       
    43 private:
       
    44     /**
       
    45      * ConstructL.
       
    46      * 2nd phase constructor.
       
    47      */
       
    48     void ConstructL();
       
    49     /**
       
    50      * CMyLocationsEngine.
       
    51      * C++ default constructor. 
       
    52      */
       
    53     CContactSubscriber(MNotifyChange* aNotifyChange);
       
    54 #ifdef MYLOCATIONENGINE_UNIT_TEST
       
    55 public:
       
    56 #else
       
    57 private:
       
    58 #endif
       
    59     
       
    60     /**
       
    61      start subscribe for contact entry
       
    62      */
       
    63     void SubscribeChangeNotiFication();
       
    64 
       
    65     /**
       
    66      *  Handles active object's request completion event. 
       
    67      */
       
    68     void RunL();
       
    69     /** 
       
    70      * Implements cancellation of an outstanding request. 
       
    71      */
       
    72     void DoCancel();
       
    73 private:   
       
    74     //observer to provide notification on completion of event
       
    75     MNotifyChange& iNotifyChange;
       
    76     RProperty iProperty;
       
    77 };
       
    78 #endif // CONTACTSUBSCRIBER_H