1.1 --- a/epoc32/include/app/imconnection.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,198 +0,0 @@
1.4 -/*
1.5 -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
1.6 -* All rights reserved.
1.7 -* This component and the accompanying materials are made available
1.8 -* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 -* which accompanies this distribution, and is available
1.10 -* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 -*
1.12 -* Initial Contributors:
1.13 -* Nokia Corporation - initial contribution.
1.14 -*
1.15 -* Contributors:
1.16 -*
1.17 -* Description: IM Connection interface
1.18 -*
1.19 -*/
1.20 -
1.21 -
1.22 -#ifndef IMCONNECTION_H
1.23 -#define IMCONNECTION_H
1.24 -
1.25 -// INCLUDES
1.26 -#include <e32base.h>
1.27 -#include <ecom/ecom.h>
1.28 -
1.29 -// DATA TYPES
1.30 -enum TImConnectionStatus
1.31 - {
1.32 - ELoggedIn = 0,
1.33 - ENotLoggedIn
1.34 - };
1.35 -
1.36 -// FORWARD DECLARATIONS
1.37 -class MImClient;
1.38 -class MImConnectionObserver;
1.39 -
1.40 -// CLASS DECLARATION
1.41 -
1.42 -/**
1.43 -* Instant Messaging API class
1.44 -* By creating this class the user automatically connects to the Symbian server
1.45 -* but to do something reasonable the IM interface has to be created using
1.46 -* this class. The following order of calling the methods is one possibility to
1.47 -* use this class:
1.48 -* 1. NewL() - instantiate the object
1.49 -* 2. RegisterObserverL() - register the observer methods
1.50 -* 3. LoginL() - connect to the protocol stack and login to remote IM server
1.51 -* 4. CreateImClientL() - get the IM interface
1.52 -*
1.53 -* All the error codes are returned using the leave mechanism.
1.54 -*
1.55 -* @lib imclient.dll
1.56 -* @since S60 3.0
1.57 -*/
1.58 -class CImConnection : public CBase
1.59 - {
1.60 - public:
1.61 -
1.62 - /**
1.63 - * Factory method for creating the class instance.
1.64 - * @since S60 3.0
1.65 - * @param aApplicationId the ApplicationId of the application
1.66 - * @return CImConnection
1.67 - */
1.68 - static CImConnection* NewL(
1.69 - const TDesC& aApplicationId );
1.70 -
1.71 - // Destructor
1.72 - virtual ~CImConnection( );
1.73 -
1.74 -
1.75 - public: // New functions
1.76 -
1.77 - /**
1.78 - * Creates the IM interface to sending and receiving IMs
1.79 - * @since S60 3.0
1.80 - * @return MImClient
1.81 - */
1.82 - virtual MImClient* CreateImClientL( ) = 0;
1.83 -
1.84 - /**
1.85 - * Method for registering the IM Connection observer to the API.
1.86 - * This method is synchronous.
1.87 - * @since S60 3.0
1.88 - * @param aObserver observer object which receives the notification
1.89 - * @leave KImApiErrAlreadyRegistered if it was registered already or other system wide error code
1.90 - */
1.91 - virtual void RegisterObserverL(
1.92 - MImConnectionObserver* aObserver ) = 0;
1.93 -
1.94 - /**
1.95 - * Method for unregistering the IM Connection observer.
1.96 - * This method is synchronous.
1.97 - * @since S60 2.6
1.98 - */
1.99 - virtual void UnregisterObserver( ) = 0;
1.100 -
1.101 - /**
1.102 - * Method for getting the connection status.
1.103 - * This method is synchronous.
1.104 - * @since S60 3.0
1.105 - * @return connection status enum
1.106 - */
1.107 - virtual TImConnectionStatus ImConnectionStatus( ) = 0;
1.108 -
1.109 - /**
1.110 - * Connects the application to the protocol stack and logs in to the
1.111 - * remote SAP server using the given login info.
1.112 - * This method is asynchronous and the completion is signaled by
1.113 - * HandleLoginL() observer method.
1.114 - * @since S60 3.0
1.115 - * @return connection status enum
1.116 - * @leave KImApiErrLoginInProgress already logging in
1.117 - * @leave KImApiErrLogoutInProgress logout is ongoing
1.118 - * @leave KImApiErrCancelLoginInProgress cancel login is ongoing
1.119 - * @leave KImApiErrAlreadyLoggedIn already logged in
1.120 - */
1.121 - virtual void LoginL(
1.122 - const TDesC& aServer,
1.123 - const TDesC& aUserID,
1.124 - const TDesC& aPassword,
1.125 - const TUint32 aAP ) = 0;
1.126 -
1.127 - /**
1.128 - * Cancels the ongoing login operation.
1.129 - * This method is asynchronous and the completion is signaled by
1.130 - * HandleCancelLoginL() observer method.
1.131 - * @since S60 3.0
1.132 - * @leave KImApiErrNotLogged not logged in
1.133 - * @leave KImApiErrLogoutInProgress logout is ongoing
1.134 - * @leave KImApiErrCancelLoginInProgress cancel login is ongoing
1.135 - * @leave KImApiErrAlreadyLoggedIn already logged in
1.136 - */
1.137 - virtual void CancelLoginL( ) = 0;
1.138 -
1.139 - /**
1.140 - * Logs out from current session.
1.141 - * This method is asynchronous and the completion is signaled by
1.142 - * HandleLogoutL() observer method.
1.143 - * Possible leave reasons:
1.144 - * @since S60 3.0
1.145 - * @leave KImApiErrNotLogged not logged in
1.146 - * @leave KImApiErrLogoutInProgress logout is ongoing
1.147 - * @leave KImApiErrCancelLoginInProgress cancel login is ongoing
1.148 - */
1.149 - virtual void LogoutL( ) = 0;
1.150 -
1.151 - protected:
1.152 - // C++ constructor
1.153 - inline CImConnection( );
1.154 -
1.155 - private:
1.156 - // Unique instance identifier key (needed for ECom)
1.157 - TUid iDtor_ID_Key;
1.158 -
1.159 - };
1.160 -
1.161 -/**
1.162 -* Connection Observer interface
1.163 -*
1.164 -* @lib imclient.dll
1.165 -* @since S60 3.0
1.166 -*/
1.167 -class MImConnectionObserver
1.168 - {
1.169 - public:
1.170 -
1.171 - /**
1.172 - * Method is called when the LoginL() is completed.
1.173 - * @since S60 3.0
1.174 - * @param aErrorCode status code
1.175 - */
1.176 - virtual void HandleLoginL(
1.177 - const TInt aErrorCode ) = 0;
1.178 -
1.179 - /**
1.180 - * Method is called when the CancelLoginL() is completed.
1.181 - * @since S60 3.0
1.182 - * @param aErrorCode status code
1.183 - */
1.184 - virtual void HandleCancelLoginL(
1.185 - const TInt aErrorCode ) = 0;
1.186 -
1.187 - /**
1.188 - * Method is called when the LogoutL() is completed.
1.189 - * Also called in situations when the Logout was initiated by the server
1.190 - * or another client which was using the same connection
1.191 - * @since S60 3.0
1.192 - * @param aErrorCode status code
1.193 - */
1.194 - virtual void HandleLogoutL(
1.195 - const TInt aErrorCode ) = 0;
1.196 -
1.197 - };
1.198 -
1.199 -#include "imconnection.inl"
1.200 -
1.201 -#endif