locationcentre/lcservice/inc/lcnotificationao.h
branchRCL_3
changeset 16 4721bd00d3da
parent 14 3a25f69541ff
child 21 e15b7f06eba6
equal deleted inserted replaced
14:3a25f69541ff 16:4721bd00d3da
     1 /*
       
     2 * Copyright (c) 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:  Location Centre Notification Active Object.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_LCNOTIFICATIONAO_H
       
    20 #define C_LCNOTIFICATIONAO_H
       
    21 
       
    22 // SYSTEM INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // USER INCLUDES
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MLcNotification;
       
    29 class RLcClientSession;
       
    30 
       
    31 /**
       
    32  *  Location Centre Notification Active Object.
       
    33  *
       
    34  *  This  class is used to handle Asynchronous Notification requests.
       
    35  *
       
    36  *  @since S60 v5.0
       
    37  */
       
    38 NONSHARABLE_CLASS( CLcNotificationAO ): public CActive
       
    39     {
       
    40 public:
       
    41     /**
       
    42      * Constructs a new instance of Location Centre Notification
       
    43      * Active Object.
       
    44      *
       
    45      * @param[in] aObserver Notification Observer.
       
    46      * @return The new instance of Location Centre Notification
       
    47      * Active Object.
       
    48      * @leave System wide error code if the object creation fails.         
       
    49      */
       
    50     static CLcNotificationAO* NewL( 
       
    51                     MLcNotification&    aObserver,
       
    52                     RLcClientSession&   aClientSession );    
       
    53 
       
    54     /**
       
    55      * C++ Destructor.
       
    56      * Frees all the resources associated with this Location Centre
       
    57      * Notification Active Object.
       
    58      */
       
    59     virtual ~CLcNotificationAO();
       
    60      
       
    61     /**
       
    62      * Issue a notification request to the Location Centre server. This
       
    63      * is a recurring request which keeps providing notifications
       
    64      * through the MLcNotification observer until a CancelRequest()
       
    65      * is called.
       
    66      */
       
    67     void IssueRequest();
       
    68     
       
    69     /**
       
    70      * Cancels the outstanding notification request issued through the
       
    71      * IssueRequest() call.
       
    72      */
       
    73     void CancelRequest();
       
    74 
       
    75 protected: // Inherited from Base classes
       
    76 
       
    77     /**
       
    78      * Inherited from CActive
       
    79      */
       
    80     void RunL();
       
    81     
       
    82     /**
       
    83      * Inherited from CActive
       
    84      */    
       
    85     void DoCancel();
       
    86              
       
    87 private:
       
    88     /**
       
    89      * C++ Default constructor
       
    90      */
       
    91     CLcNotificationAO( MLcNotification&    aObserver,
       
    92                        RLcClientSession&   aClientSession ); 
       
    93     
       
    94 private:
       
    95     /**
       
    96      * Observer to communicate the notification requests.
       
    97      */
       
    98     MLcNotification&                iObserver;
       
    99     
       
   100     RLcClientSession&               iClientSession;
       
   101     };
       
   102 
       
   103 #endif // C_LCNOTIFICATIONAO_H