pressrv_plat/authorization_api/inc/prescondsphere.h
changeset 0 c8caa15ef882
equal deleted inserted replaced
-1:000000000000 0:c8caa15ef882
       
     1 /*
       
     2 * Copyright (c) 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:    RLS and Presence XDM, This class represents sphere part of 
       
    15 *  Presence Condition
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __PRESCONDSPHERE_H__
       
    22 #define __PRESCONDSPHERE_H__
       
    23 
       
    24 // Includes
       
    25 #include <e32std.h>
       
    26 #include <e32base.h>
       
    27 #include <badesca.h>
       
    28 #include <rlspresxdmconsts.h>
       
    29 
       
    30 // Forward declarations
       
    31 class CPresenceXDM;
       
    32 class CXdmDocumentNode;
       
    33 
       
    34 // Class declaration
       
    35 /** 
       
    36 * This class should be used in conjunction with an already created CPresenceXDM.
       
    37 *  The CPresenceXDM deals with the Presence rules as a whole and has communication
       
    38 *  with the server.
       
    39 *  TPresCondSphere is used to manipulate the sphere part of a Condition in a rule. 
       
    40 *  Remember to call Init function after constructing this object.
       
    41 *  
       
    42 *  @lib rlspresxdm.lib
       
    43 *  @since S60 3.2
       
    44 */
       
    45 class TPresCondSphere
       
    46     {
       
    47     public:
       
    48     
       
    49         /**
       
    50         * C++ Constructor, After contructing Init must be called before using
       
    51         * this object.
       
    52         */                                        
       
    53         IMPORT_C TPresCondSphere();
       
    54         
       
    55         /**
       
    56         * Initializes the object with the given pointer to CPresenceXDM.
       
    57         * This function must be called before using other functions.
       
    58         *
       
    59         * @param CPresenceXDM* pointer to created CPresenceXDM
       
    60         */
       
    61         IMPORT_C void Init(CPresenceXDM* const aPresXDM);
       
    62         
       
    63         /**
       
    64         * Adds a condition sphere to a rule
       
    65         *
       
    66         * @param TDesC& aRuleID rule ID
       
    67         * @param TDesC& aSphere Value of the sphere to be added
       
    68         * @return TInt KErrNone, KErrNotFound if rule doesnt found
       
    69         */
       
    70         IMPORT_C TInt AddOrReplaceSphereL(const TDesC& aRuleID, 
       
    71                                                         const TDesC& aSphere);
       
    72                                                         
       
    73                                                         
       
    74         /**
       
    75         * Gets a condition sphere from a rule
       
    76         *
       
    77         * @param TDesC& aRuleID rule ID
       
    78         * @param TDesC& aSphere returned value of the sphere
       
    79         * @return TInt KErrNone, KErrNotFound if rule or no sphere found
       
    80         */
       
    81         IMPORT_C TInt GetSphereL(const TDesC& aRuleID, TPtrC& aSphere);
       
    82                                                         
       
    83                                                         
       
    84         /**
       
    85         * Deletes condition sphere from a rule
       
    86         *
       
    87         * @param TDesC& aRuleID rule ID
       
    88         * @return TInt KErrNone, KErrNotFound if rule or sphere doesnt found
       
    89         */
       
    90         IMPORT_C TInt DeleteSphereL(const TDesC& aRuleID);
       
    91 
       
    92                                        
       
    93     private:
       
    94     
       
    95         /**
       
    96         * Gets the Sphere node pointer in a rule
       
    97         *
       
    98         * @param TDesC& aRuleID rule ID.
       
    99         * @param TBool aCreate if ETrue, creates Sphere node if not exist
       
   100         * @return CXdmDocumentNode* pointer to Sphere node or NULL
       
   101         */
       
   102         CXdmDocumentNode* GetSphereNodeL(const TDesC& aRuleID,
       
   103                                                         TBool aCreate);
       
   104                                                             
       
   105     private: // data
       
   106         
       
   107         // Pointer to CPresenceXDM - not owned
       
   108         CPresenceXDM*           iPresXDM;      // not owned
       
   109         
       
   110     };
       
   111     
       
   112    
       
   113 #endif //__PRESCONDSPHERE_H__
       
   114