voipplugins/ipapputils/inc/csipclientresolverutils.h
changeset 0 a4daefaec16c
equal deleted inserted replaced
-1:000000000000 0:a4daefaec16c
       
     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:  Utility class to handle SIP client resolver cenrep table.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_SIPCLIENTRESOLVERUTILS_H
       
    20 #define C_SIPCLIENTRESOLVERUTILS_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <spdefinitions.h>
       
    24 
       
    25 class CRepository;
       
    26 
       
    27 /**
       
    28  *  Utility class to handle SIP client resolver cenrep table.
       
    29  *
       
    30  *  @code
       
    31  *      iSipClientResolver = CSipClientResolverUtils::NewL();
       
    32  *      iSipClientResolver->RegisterClientWithUserL( 
       
    33  *              KImplementation, iContactHeaderUser, KResolver );
       
    34  *      delete iSipClientResolver;
       
    35  *  @endcode
       
    36  *
       
    37  *  @lib ipapputils.lib
       
    38  *  @since S60 v3.2 
       
    39  */
       
    40 NONSHARABLE_CLASS( CSipClientResolverUtils ) : public CBase
       
    41     {
       
    42 public:
       
    43 
       
    44     /**
       
    45      * Two-phased constructor.
       
    46      */
       
    47     IMPORT_C static CSipClientResolverUtils* NewL();
       
    48     /**
       
    49      * Two-phased constructor.
       
    50      */
       
    51     IMPORT_C static CSipClientResolverUtils* NewLC();
       
    52 
       
    53     /**
       
    54     * Destructor.
       
    55     */
       
    56     IMPORT_C virtual ~CSipClientResolverUtils();
       
    57 
       
    58     /**
       
    59      * Register to SIP client resolver to be able to receive incoming sessions.
       
    60      *
       
    61      * @since S60 3.2
       
    62      * @param aImplementation UID of client who handles incoming session
       
    63      * @param aProfileContactHeaderUser Globally unique identifier of SIP profile
       
    64      * @param aResolver UID of client resolver plug-in
       
    65      * @return 
       
    66      */
       
    67     IMPORT_C void RegisterClientWithUserL( 
       
    68                 const TUid& aImplementation,
       
    69                 const TDesC8& aProfileContactHeaderUser, 
       
    70                 const TUid& aResolver ) const;
       
    71 
       
    72     /**
       
    73      * Un-register from SIP client resolver to deny accepting incoming sessions.
       
    74      *
       
    75      * @since S60 3.2
       
    76      * @param aImplementation UID of client who handles incoming session
       
    77      * @param aProfileContactHeaderUser Globally unique identifier of SIP profile
       
    78      * @return 
       
    79      */
       
    80     IMPORT_C void UnRegisterClientWithUserL( 
       
    81                 const TUid& aImplementation,
       
    82                 const TDesC8& aProfileContactHeaderUser ) const;
       
    83 
       
    84     /**
       
    85      * Resolve implementation Uid for incoming session.
       
    86      *
       
    87      * @since S60 3.2
       
    88      * @param aImplementation UID of client who handles incoming session
       
    89      * @param aProfileContactHeaderUser Globally unique identifier of SIP profile
       
    90      * @return 
       
    91      */
       
    92     IMPORT_C void GetImplementationUidWithUserL( 
       
    93         const TDesC8& aProfileContactHeaderUser,
       
    94         TUid& aImplementation ) const;
       
    95     
       
    96     /**
       
    97      * Return all implementation Uids bases on contact header
       
    98      *
       
    99      * @since S60 5.0
       
   100      * @param aProfileContactHeaderUser Globally unique identifier of SIP profile
       
   101      * @param aImplementationUids UIDs of clients which handle incoming session
       
   102      * @return 
       
   103      */
       
   104     IMPORT_C void GetAllImplementationUidsWithUserL( 
       
   105         const TDesC8& aProfileContactHeaderUser,
       
   106         RArray<TUid>& aImplementationUids ) const;
       
   107     
       
   108 private:
       
   109 
       
   110     /**
       
   111      * C++ default constructor.
       
   112      */
       
   113     CSipClientResolverUtils();
       
   114 
       
   115     /**
       
   116      * By default Symbian 2nd phase constructor is private.
       
   117      */
       
   118     void ConstructL();
       
   119 
       
   120     /**
       
   121      * Finds all rows that match given search criterias.
       
   122      *
       
   123      * @since S60 3.2
       
   124      * @param aProfileContactHeaderUser Globally unique identifier of SIP profile
       
   125      * @param aFoundKeys On return contains keys that matched requested rows
       
   126      * @return 
       
   127      */
       
   128     void GetClientWithUserL(
       
   129                 const TDesC8& aProfileContactHeaderUser, 
       
   130                 RArray<TUint32>& aFoundKeys ) const;
       
   131                     
       
   132     /**
       
   133      * Creates unique key
       
   134      *
       
   135      * @since S60 3.2
       
   136      * @param aNewKey New unique key to be used when inserting row to table
       
   137      * @return 
       
   138      */
       
   139     void CreateNewKeyL( TUint32& aNewKey ) const;
       
   140     
       
   141     /**
       
   142      * Gets call provider Uids.
       
   143      * @param aUidArray Array containing all call provider Uids.
       
   144      */
       
   145     void CallProviderUidsL( RArray<TUint>& aUidArray ) const;   
       
   146      
       
   147     /**
       
   148      * Checks if implementation uid found by key in repository
       
   149      * matches given uid.
       
   150      *
       
   151      * @since S60 5.0
       
   152      * @param aKey unique key identifieng row in repository
       
   153      * @param aImplementation implementation uid
       
   154      * @return ETrue if uid matches
       
   155      */
       
   156     TBool CheckImplementationUidL( 
       
   157         const TUint32& aKey, const TUid& aImplementation ) const;
       
   158 
       
   159 private: // data
       
   160 
       
   161     /**
       
   162      * Instance of central repository
       
   163      * Own.
       
   164      */
       
   165     CRepository* iRepository;
       
   166 
       
   167 #ifdef _DEBUG
       
   168         friend class T_CSipClientResolverUtils;
       
   169 #endif
       
   170     };
       
   171 
       
   172 #endif // C_SIPCLIENTRESOLVERUTILS_H