presetserver/clientinc/psservnotifier.h
changeset 0 09774dfdd46b
child 12 608f67c22514
equal deleted inserted replaced
-1:000000000000 0:09774dfdd46b
       
     1 /*
       
     2 * Copyright (c) 2006-2006 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:  Client-server preset notifier
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef R_RPSPRESETNOTIFIER_H
       
    20 #define R_RPSPRESETNOTIFIER_H
       
    21 
       
    22 #include <pscommon.h>
       
    23 #include <pspresetobserver.h>
       
    24 
       
    25 class RPSServ;
       
    26 
       
    27 /**
       
    28  * Client-server preset notifier.
       
    29  */
       
    30 class RPSServNotifier
       
    31     {
       
    32 
       
    33 public:
       
    34 
       
    35     /**
       
    36      * Constructor.
       
    37      *
       
    38      * @param   aServer     Session with the preset server.
       
    39      * @param   aId         The ID of the preset to observe, or <code>KErrNotFound</code>
       
    40      *                      if all changes should result in a notification.
       
    41      */    
       
    42     RPSServNotifier( RPSServ& aServer, TInt aId );
       
    43 
       
    44     /**
       
    45      * Closes all resources allocated.
       
    46      */    
       
    47     void Close();
       
    48 
       
    49     /**
       
    50      * Request a notify when the preset with the supplied identifier is changed.
       
    51      *
       
    52      * @param   aStatus         The request status to signal when the preset is changed.
       
    53      */    
       
    54     void Notify( TRequestStatus& aStatus );
       
    55 
       
    56     /**
       
    57      * Cancels the pending notify request.
       
    58      */    
       
    59     void CancelNotify();
       
    60 
       
    61     /**
       
    62      * Returns the id of the preset.
       
    63      *
       
    64      * @return  Id of the preset.
       
    65      */
       
    66     TInt Id() const;
       
    67 
       
    68     /**
       
    69      * Returns the data handler of the preset.
       
    70      *
       
    71      * @return  Data handler of the preset.
       
    72      */
       
    73     TUid DataHandler() const;
       
    74 
       
    75     /**
       
    76      * Returns the reason of the change.
       
    77      *
       
    78      * @return  Reason of the change.
       
    79      */
       
    80     MPSPresetObserver::TPSReason Reason() const;    
       
    81 
       
    82 private:
       
    83 
       
    84     /** The preset server. */
       
    85     RPSServ& iServer;
       
    86     /** Packaged data of the latest notify. */
       
    87     TPckgBuf<TPSNotifyDataPackage> iData;
       
    88     /** The ID of the preset to observe, or <code>KErrNotFound</code> if all changes should result in a notification. */
       
    89     TInt iId;
       
    90 
       
    91     };
       
    92 
       
    93 #endif // R_RPSPRESETNOTIFIER_H