pressrv_plat/authorization_api/inc/presenceactionxdm.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 Presence Action
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __PRESENCEACTIONXDM_H__
       
    21 #define __PRESENCEACTIONXDM_H__
       
    22 
       
    23 // Includes
       
    24 #include <e32base.h>
       
    25 #include <rlspresxdmconsts.h>
       
    26 
       
    27 //Forward declarations
       
    28 class CXdmDocumentNode;
       
    29 class CPresenceXDM;
       
    30 
       
    31 
       
    32 // Class declaration
       
    33 /** 
       
    34 * This class should be used in conjunction with an already created CPresenceXDM.
       
    35 *  The CPresenceXDM deals with the Presence rules as a whole and has communication
       
    36 *  with the server.
       
    37 *  TPresenceActionXDM is used to manipulate the Action part of a rule. 
       
    38 *  Remember to call Init function after constructing this object.
       
    39 *  
       
    40 *  @lib rlspresxdm.lib
       
    41 *  @since S60 3.2
       
    42 */
       
    43 class TPresenceActionXDM
       
    44     {
       
    45     public:
       
    46     
       
    47         /**
       
    48         * C++ Constructor, After contructing Init must be called before using
       
    49         * this object.
       
    50         */                                        
       
    51         IMPORT_C TPresenceActionXDM();
       
    52 
       
    53         /**
       
    54         * Initializes the object with the given pointer to CPresenceXDM.
       
    55         * This function must be called before using other functions.
       
    56         *
       
    57         * @param CPresenceXDM* pointer to created CPresenceXDM
       
    58         * @return none
       
    59         */
       
    60         IMPORT_C void Init(CPresenceXDM* const aPresXDM);
       
    61         
       
    62 
       
    63         /**
       
    64         * Adds or replace action contents.
       
    65         *
       
    66         * @param TDesC& aRuleID rule ID 
       
    67         * @param TDesC& aAction it can be block,confirm, polite-block or allow,
       
    68         *   use constants from rlspresxdmconsts.h
       
    69         * @return TInt KErrNone, KErrNotFound if rule doesnt found,
       
    70         *   KErrArgument if invalid aAction
       
    71         */
       
    72         IMPORT_C TInt AddOrReplaceActionL(const TDesC& aRuleID, 
       
    73                                                         const TDesC& aAction);
       
    74                                                                 
       
    75         /**
       
    76         * Removes action from a rule.
       
    77         *
       
    78         * @param TDesC& aRuleID rule ID 
       
    79         * @return TInt KErrNone, KErrNotFound if rule or action doesnt found
       
    80         */
       
    81         IMPORT_C TInt RemoveActionL(const TDesC& aRuleID);
       
    82         
       
    83         /**
       
    84         * Gets Action contents from a rule.
       
    85         *
       
    86         * @param TDesC& aRuleID rule ID
       
    87         * @param TPtrC& aAction action which can be block,confirm, polite-block or allow
       
    88         * @return TInt KErrNotFound if rule or action doesnt found.
       
    89         */
       
    90         IMPORT_C TInt GetActionL(const TDesC& aRuleID, TDes& aAction);
       
    91         
       
    92     private:
       
    93     
       
    94         /**
       
    95         * Gets the SubHandling node pointer in a rule
       
    96         *
       
    97         * @param TDesC& aRuleID rule ID.
       
    98         * @param TBool aCreate if ETrue, creates SubHandling node if not exist
       
    99         * @return CXdmDocumentNode* pointer to SubHandling node or NULL
       
   100         */
       
   101         CXdmDocumentNode* GetSubHandlingNodeL(const TDesC& aRuleID,  
       
   102                                                         TBool aCreate);
       
   103                                                         
       
   104         /**
       
   105         * Finds whether the provided action is valid or not
       
   106         *
       
   107         * @param TDesC& aAction, as a discriptor
       
   108         * @return ETrue of action is valid
       
   109         */
       
   110         TBool IsValidAction(const TDesC& aAction);
       
   111 
       
   112                                                         
       
   113     private: // data
       
   114         
       
   115         // Pointer to CPresenceXDM - not owned
       
   116         CPresenceXDM*           iPresXDM;      // not owned
       
   117 
       
   118 
       
   119     };
       
   120     
       
   121 #endif //__PRESENCEACTIONXDM_H__