wvuing/wvuiada/Src/CCAImpsFundClient.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Implements fundamental services interface.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CCAIMPSFUNDCLIENT_H
       
    21 #define CCAIMPSFUNDCLIENT_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "MCAImpsFundClient.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class RImpsEng;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 *  Implements MCAImpsFundClient.
       
    33 *  Forwards requests to RImpsFundClient
       
    34 *
       
    35 *  @lib CAAdapter.dll
       
    36 *  @since 1.2
       
    37 */
       
    38 class CCAImpsFundClient : public CBase, public MCAImpsFundClient
       
    39     {
       
    40     public:  // Constructors and destructor
       
    41 
       
    42         /**
       
    43         * Two-phased constructor.
       
    44         * @param Reference to RImpsEng
       
    45         */
       
    46         static CCAImpsFundClient* NewL( RImpsEng& aImpsEng );
       
    47 
       
    48         /**
       
    49         * Destructor.
       
    50         */
       
    51         virtual ~CCAImpsFundClient();
       
    52 
       
    53     public: // Functions from base classes
       
    54 
       
    55         // INITILIZATION AND CONNECT
       
    56 
       
    57         /**
       
    58         * Registers the listener objects for Fundamental events and connects to
       
    59         * the Symbian OS Server.
       
    60         * @since 1.2
       
    61         * @param aSearchObs search result observer. May be NULL. Ownership NOT transferred.
       
    62         * @param aInviteObs invite observer. May be NULL. Ownership NOT transferred.
       
    63         * @param aPriority Observer priority. Refer to CActive priority.
       
    64         */
       
    65         virtual void RegisterL( MImpsSearchHandler2* aSearchObs,
       
    66                                 MImpsInviteHandler2* aInviteObs,
       
    67                                 TInt aPriority );
       
    68 
       
    69         /**
       
    70         * Unregisters the listener object and disconnects from the server.
       
    71         * @since 1.2
       
    72         */
       
    73         virtual void Unregister();
       
    74 
       
    75         // Fundamental SERVICES
       
    76 
       
    77         /**
       
    78         * Start search
       
    79         * @since 1.2
       
    80         * @param aPairs defines what is to be searched
       
    81         * @param aSearchLimit how many results you want
       
    82         * @return oparation-id (positive)
       
    83         */
       
    84         TInt SearchFirstL( const CSearchPairs& aPairs,
       
    85                            TInt aSearchLimit );
       
    86 
       
    87         /**
       
    88         * Continue search
       
    89         * @since 1.2
       
    90         * @param aSearchID which search is to be continued
       
    91         * @param aIndex from which index the search is continued
       
    92         * @return oparation-id (positive)
       
    93         */
       
    94         TInt SearchNextL( TInt aSearchID, TInt aIndex );
       
    95 
       
    96 
       
    97         /**
       
    98         * Stop search
       
    99         * @since 1.2
       
   100         * @param aSearchID which search is to be continued
       
   101         * @return oparation-id (positive)
       
   102         */
       
   103         TInt StopSearchL( TInt aSearchID );
       
   104 
       
   105         /**
       
   106         * Send group invite request
       
   107         * InviteGroupRequest
       
   108         * @since 1.2
       
   109         * @param aInviteId Generated invite id
       
   110         * @param aUserId IDs of the users to be invited
       
   111         * @param aScreenName Screen names (<SName>) of the users to be invited
       
   112         * @param aGroupName The group (<GroupID>) in which the screen name is unique
       
   113         * @param aInviteGroup ID of the group to which the users are invited to join
       
   114         * @param aOwnScreenName Screen name of the inviter
       
   115         * @param aOwnGroupName Group name of the inviter
       
   116         * @param aInviteReason A short text describing the reason of the invite
       
   117         * @param aValidityPeriod How long the invitation is valid
       
   118         * @return oparation-id (positive)
       
   119         */
       
   120         TInt InviteGroupRequestL( const TDesC& aInviteId,
       
   121                                   const MDesCArray* aUserId,
       
   122                                   const MDesCArray* aScreenName,
       
   123                                   const MDesCArray* aGroupName,
       
   124                                   const TDesC& aInviteGroup,
       
   125                                   const TDesC& aOwnScreenName,
       
   126                                   const TDesC& aOwnGroupName,
       
   127                                   const TDesC& aInviteReason,
       
   128                                   const TInt aValidityPeriod );
       
   129 
       
   130         /**
       
   131         * Cancel a group invite request
       
   132         * CancelGroupInviteRequest
       
   133         * @since 1.2
       
   134         * @param aInviteId Invite to be cancelled
       
   135         * @param aUserId IDs of the users
       
   136         * @param aScreenName ID of the group (<GroupID>) in which the screen name is unique
       
   137         * @param aGroupName Name of the group
       
   138         * @param aCancelReason A short text describing the reason for the cancelling.
       
   139         * @param aOwnScreenName Screen name of the canceller
       
   140         * @param aOwnGroupName Group name of the canceller.
       
   141         * @return oparation-id (positive)
       
   142         */
       
   143         TInt CancelGroupInviteRequestL( const TDesC& aInviteId,
       
   144                                         const MDesCArray* aUserId,
       
   145                                         const MDesCArray* aScreenName,
       
   146                                         const MDesCArray* aGroupName,
       
   147                                         const TDesC& aCancelReason,
       
   148                                         const TDesC& aOwnScreenName,
       
   149                                         const TDesC& aOwnGroupName );
       
   150 
       
   151         /**
       
   152         * Send response to invite
       
   153         * InviteUserResponse
       
   154         * @since 1.2
       
   155         * @param aInviteId         = ID of the invite response
       
   156         * @param aAcceptance       = Do we meet the claim?
       
   157         * @param aInviteResponse   = Textual description of the response
       
   158         * @param aOwnScreenName    = Screen name of the responding user
       
   159         * @param aOwnGroupName     = Group name of the responding user
       
   160         * @return oparation-id (positive)
       
   161         */
       
   162         TInt GroupInviteUserResponseL( const TDesC& aInviteId,
       
   163                                        TBool aAcceptance,
       
   164                                        const TDesC& aInviteResponse,
       
   165                                        const TDesC& aOwnScreenName,
       
   166                                        const TDesC& aOwnGroupName );
       
   167 
       
   168         /**
       
   169         * Available services accessor
       
   170         * Notice that there are no services in NOT_LOGGED state, i.e.
       
   171         * before login has been executed successfully from any client.
       
   172         * @param aServices Service tree having all supported features and functions.
       
   173         * @since 1.2
       
   174         */
       
   175         virtual void GetServicesL( TImpsServices& aServices );
       
   176 
       
   177         /**
       
   178         * Register an error event observer.
       
   179         * If this is not registered then a client does not
       
   180         * receive error events from WV engine.
       
   181         * An application may implement only one HandleErrorL method
       
   182         * and give pointer to it in each WV client instance.
       
   183         * @since 1.2
       
   184         * @param aObs error event observer
       
   185         */
       
   186         virtual void RegisterErrorObserverL( MImpsErrorHandler2 &aObs );
       
   187 
       
   188         /**
       
   189         * Registers the service status change observer.
       
   190         * This can be called any time
       
   191         * @since 1.2
       
   192         * @param aObs status observer implementation. Ownership NOT transferred.
       
   193         */
       
   194         virtual void RegisterStatusObserverL( MImpsStatusHandler2 *aObs );
       
   195 
       
   196         /**
       
   197         * Unregisters an error observer.
       
   198         * Forwards the call to WV Engine always
       
   199         * This method is not necessary if unregister of the particular
       
   200         * client has been executed (Unregister).
       
   201         * @since 1.2
       
   202         */
       
   203         virtual void UnregisterErrorObserverL();
       
   204 
       
   205         /**
       
   206         * Unregisters the service status change observer.
       
   207         * Forwards the call to WV Engine always
       
   208         * This method is not necessary if unregister of the particular
       
   209         * client type has been executed (Unregister).
       
   210         * @since 1.2
       
   211         */
       
   212         virtual void UnregisterStatusObserverL();
       
   213 
       
   214         /**
       
   215         * Internal use only.
       
   216         * Error observer accessor
       
   217         * @since 1.2
       
   218         * @return error observer pointer. Ownership NOT transferred.
       
   219         */
       
   220         virtual MImpsErrorHandler2* ErrorHandler() const;
       
   221 
       
   222         /**
       
   223         * Internal use only.
       
   224         * Status observer accessor. This is missing from WV Engine. Introduced for consistency.
       
   225         * @since 1.2
       
   226         * @return Status observer pointer. Ownership NOT transferred.
       
   227         */
       
   228         virtual MImpsStatusHandler2* StatusHandler() const;
       
   229 
       
   230         /**
       
   231         * Returns actual WV Engine interface class pointer which is registered.
       
   232         * @since 1.2
       
   233         * @return RImpsFundClient pointer which is registered and can be used.
       
   234         *  Ownership NOT transferred.
       
   235         */
       
   236         RImpsFundClient2* InterfaceL();
       
   237 
       
   238     private:  // New functions
       
   239 
       
   240         /**
       
   241         * C++ default constructor.
       
   242         * @param Reference to RImpsEng
       
   243         */
       
   244         CCAImpsFundClient( RImpsEng& aImpsEng );
       
   245 
       
   246     private:    // Data
       
   247 
       
   248         // WV Engine fundamental interface.
       
   249         RImpsFundClient2 iClient;
       
   250 
       
   251         // Indicator if we are doing lazy initialization with WV Engine.
       
   252         TBool	iLazyInitialization;
       
   253 
       
   254         // Indicator if we have registered WV Engine interface.
       
   255         TBool   iRegistered;
       
   256 
       
   257         // Store priority if we are doing lazy initialization.
       
   258         TInt	iPriority;
       
   259 
       
   260         // Search observer, stored in lazy initialization. Doens't own.
       
   261         MImpsSearchHandler2* iSearchHandler;
       
   262 
       
   263         // Invite observer, stored in lazy initialization. Doens't own.
       
   264         MImpsInviteHandler2* iInviteHandler;
       
   265 
       
   266         // Status observer, stored in lazy initialization. Doens't own.
       
   267         MImpsStatusHandler2* iStatusHandler;
       
   268 
       
   269         // Error observer, stored in lazy initialization. Doens't own.
       
   270         MImpsErrorHandler2* iErrorHandler;
       
   271 
       
   272         // Refernce to IMPS engine server session instance.
       
   273         RImpsEng& iImpsEng;
       
   274     };
       
   275 
       
   276 #endif      // MCAIMPSFUNDCLIENT_H
       
   277 
       
   278 // End of File