pressrv_plat/authorization_api/inc/prescondmisc.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 those parts of 
       
    15 *  presence identity which are not present in any other class.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __PRESCONDMISC_H__
       
    22 #define __PRESCONDMISC_H__
       
    23 
       
    24 // Includes
       
    25 #include <e32std.h>
       
    26 #include <e32base.h>
       
    27 #include <badesca.h>
       
    28 
       
    29 #include <rlspresxdmconsts.h>
       
    30 
       
    31 // Forward declarations
       
    32 class CPresenceXDM;
       
    33 class CXdmDocumentNode;
       
    34 
       
    35 // Class declaration
       
    36 /** 
       
    37 * This class should be used in conjunction with an already created CPresenceXDM.
       
    38 *  The CPresenceXDM deals with the Presence rules as a whole and has communication
       
    39 *  with the server.
       
    40 *  TPresCondMisc is used to manipulate the those Presence rule's conditions
       
    41 *  which are not present in any other class. This class supports following
       
    42 *  conditions: external-list, anonymous-request and other-identity.
       
    43 *  
       
    44 *  @lib rlspresxdm.lib
       
    45 *  @since S60 3.2
       
    46 */
       
    47 class TPresCondMisc
       
    48     {
       
    49     public:
       
    50     
       
    51         /**
       
    52         * C++ Constructor, After contructing Init must be called before using
       
    53         * this object.
       
    54         */                                        
       
    55         IMPORT_C TPresCondMisc();
       
    56         
       
    57         /**
       
    58         * Initializes the object with the given pointer to CPresenceXDM.
       
    59         * This function must be called before using other functions.
       
    60         *
       
    61         * @param CPresenceXDM* pointer to created CPresenceXDM
       
    62         */
       
    63         IMPORT_C void Init(CPresenceXDM* const aPresXDM);
       
    64         
       
    65         /**
       
    66         * Adds condition's other-identity element to a rule. This functions doesnt give
       
    67         * error if other-identity element already exists.
       
    68         *
       
    69         * @param TDesC& aRuleId rule ID  
       
    70         * @return TInt KErrNone, KErrNotFound if rule doesnt found
       
    71         */
       
    72         IMPORT_C TInt AddOtherIdentityL(const TDesC& aRuleId);
       
    73         
       
    74         /**
       
    75         * Finds if other-identity element exist in a rule
       
    76         *
       
    77         * @param TDesC& aRuleId rule ID
       
    78         * @return TBool ETrue if other-identity element found
       
    79         */
       
    80         IMPORT_C TBool IsOtherIdentityExistL(const TDesC& aRuleId);
       
    81         
       
    82         /**
       
    83         * Removes other-identity element from a rule
       
    84         *
       
    85         * @param TDesC& aRuleId rule ID 
       
    86         * @return KErrNotFound if rule or other-identity element not found.
       
    87         */
       
    88         IMPORT_C TInt RemoveOtherIdentityL(const TDesC& aRuleId);
       
    89         
       
    90         /**
       
    91         * Adds condition's anonymous-request element to a rule. This functions doesnt give
       
    92         * error if anonymous-request element already exists.
       
    93         *
       
    94         * @param TDesC& aRuleId rule ID  
       
    95         * @return TInt KErrNone, KErrNotFound if rule doesnt found
       
    96         */
       
    97         IMPORT_C TInt AddAnonymousRequestL(const TDesC& aRuleId);
       
    98         
       
    99         /**
       
   100         * Finds if anonymous-request element exist in a rule
       
   101         *
       
   102         * @param TDesC& aRuleId rule ID
       
   103         * @return TBool ETrue if anonymous-request element found
       
   104         */
       
   105         IMPORT_C TBool IsAnonymousRequestExistL(const TDesC& aRuleId);
       
   106         
       
   107         /**
       
   108         * Removes anonymous-request element from a rule
       
   109         *
       
   110         * @param TDesC& aRuleId rule ID 
       
   111         * @return KErrNotFound if rule or anonymous-request element not found.
       
   112         */
       
   113         IMPORT_C TInt RemoveAnonymousRequestL(const TDesC& aRuleId);
       
   114         
       
   115         /**
       
   116         * Adds a condition's external-list with 'anc' attribute containing a Uri
       
   117         *
       
   118         * @param TDesC& aRuleId rule ID
       
   119         * @param aUri an external list to be added
       
   120         * @return TInt KErrNone, KErrNotFound if rule doesnt found or
       
   121         *   KErrAlreadyExists in case already exists
       
   122         */
       
   123         IMPORT_C TInt AddExternListL(const TDesC& aRuleId, const TDesC& aUri);
       
   124         
       
   125         /**
       
   126         * Finds if an external list is exist in a rule
       
   127         *
       
   128         * @param TDesC& aRuleId rule ID
       
   129         * @param aUri an external list to be find
       
   130         * @return TBool ETrue if given external list is exist in the rule
       
   131         */
       
   132         IMPORT_C TBool IsExternListExistL(const TDesC& aRuleId, const TDesC& aUri);
       
   133                                                         
       
   134         /**
       
   135         * Gets condition's external-lists from a rule
       
   136         *
       
   137         * @param TDesC& aRuleId rule ID 
       
   138         * @param aUris contains returned array of external Uris
       
   139         */
       
   140         IMPORT_C void GetExternalListsL(const TDesC& aRuleId, 
       
   141                                                     CDesCArray& aUris);
       
   142                                                     
       
   143         /**
       
   144         * Delete specific external list if found.
       
   145         *
       
   146         * @param TDesC& aRuleId rule ID 
       
   147         * @param aUri an external list to be removed
       
   148         * @return KErrNotFound if rule or external list not found. 
       
   149         */
       
   150         IMPORT_C TInt DeleteExternalListL(const TDesC& aRuleId, 
       
   151                                                             const TDesC& aUri);
       
   152                                                             
       
   153         /**
       
   154         * Deletes specific external lists if they found.
       
   155         *
       
   156         * @param TDesC& aRuleId rule ID 
       
   157         * @param aUris contains array of external lists to be deleted.
       
   158         */
       
   159         IMPORT_C void DeleteExternalListsL(const TDesC& aRuleId,
       
   160                                                 const MDesCArray& aUris);
       
   161                                                     
       
   162         /**
       
   163         * Deletes all external lists from a rule if found
       
   164         *
       
   165         * @param TDesC& aRuleId rule ID
       
   166         */
       
   167         IMPORT_C void DeleteAllExternalListsL(const TDesC& aRuleId);
       
   168 
       
   169     private: // data
       
   170         
       
   171         // Pointer to CPresenceXDM - not owned
       
   172         CPresenceXDM*           iPresXDM;
       
   173         
       
   174     };
       
   175     
       
   176    
       
   177 #endif //__PRESCONDMISC_H__