mmsharinguis_plat/live_comms_plugin_api/inc/lcsession.h
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 35 6c57ef9392d2
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
     1 /*
       
     2 * Copyright (c) 2009 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MLCSESSION_H
       
    19 #define MLCSESSION_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32std.h>
       
    23 
       
    24 // FORWARD DECLARATIONS
       
    25 class MLcSessionObserver;
       
    26 class MLcUiProvider;
       
    27 class MLcVideoPlayer;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 /**
       
    31 * A class representing a Live Comms session. 
       
    32 */
       
    33 class MLcSession
       
    34     {
       
    35     public:
       
    36 
       
    37         /**
       
    38         * The list of possible session states.
       
    39         */
       
    40         enum TLcSessionState
       
    41             {
       
    42             EUninitialized,
       
    43             EInitialized,
       
    44             EReceived,
       
    45             EOpening,
       
    46             EOpen,
       
    47             EClosing,
       
    48             EClosed
       
    49             };
       
    50 
       
    51         /**
       
    52         * The possible failure reasons for a session.
       
    53         */
       
    54         enum TLcSessionFailure
       
    55             {
       
    56             ENoAnswer = 1,
       
    57             ERecipientNotFound,
       
    58             ESessionCancelled,
       
    59             ESessionRejected,
       
    60             ERecipientBusy,
       
    61             ERecipientTemporarilyNotAvailable,
       
    62             EDiskFull,
       
    63             EConnectionLost,
       
    64             EMediaInactivityTimeout,
       
    65             };
       
    66         
       
    67         /**
       
    68         * Returns the current session state.
       
    69         * @return the session state
       
    70         */
       
    71         virtual TLcSessionState LcSessionState() const = 0;
       
    72 
       
    73         /**
       
    74         * Sets the observer for the session related events.
       
    75         * @param aObserver the observer
       
    76         */
       
    77         virtual void SetLcSessionObserver( MLcSessionObserver* aObserver ) = 0;
       
    78 
       
    79         /**
       
    80         * Sets the callback for the UI prompts.
       
    81         * @param aUiProvider callback for UI prompts
       
    82         */
       
    83         virtual void SetLcUiProvider( MLcUiProvider* aUiProvider ) = 0;        
       
    84         
       
    85         /**
       
    86         * Establishes the session.
       
    87         * In case of a MO session initiates the session negotiation.
       
    88         * In case of a MT session accepts the incoming session. 
       
    89         */
       
    90         virtual void EstablishLcSessionL() = 0;
       
    91     
       
    92         /**
       
    93         * Terminates the session.
       
    94         * Can be used for terminating an existing session as well as 
       
    95         * cancelling a MO session that has not yet been established.
       
    96         * Can also be used for rejecting an incoming session.  
       
    97         */
       
    98         virtual void TerminateLcSessionL() = 0;
       
    99        
       
   100         /**
       
   101         * Returns the video player for the received media.
       
   102         * Is present if the session contains video 
       
   103         * received from the remote participant.
       
   104         * @return the remote video player or NULL if not present
       
   105         */
       
   106         virtual MLcVideoPlayer* RemoteVideoPlayer() = 0;
       
   107     
       
   108         /**
       
   109         * Returns the video player for the media that is being sent.
       
   110         * Is present if the session contains outgoing video.
       
   111         * @return the local video player or NULL if not present
       
   112         */
       
   113         virtual MLcVideoPlayer* LocalVideoPlayer() = 0;
       
   114        
       
   115         /**
       
   116         * Returns the own display name for the session.
       
   117         * @return the local display name or KNullDesC if local
       
   118         * display name is not known
       
   119         */
       
   120         virtual const TDesC& LocalDisplayName() = 0;
       
   121     
       
   122         /**
       
   123         * Returns the remote party's display name for the session.
       
   124         * @return the remote display name or KNullDesC if remote 
       
   125         * display name is not known
       
   126         */
       
   127         virtual const TDesC& RemoteDisplayName() = 0;
       
   128 
       
   129         /**
       
   130         * Sets a parameter for the session.
       
   131         * The parameters can be plug-in specific.
       
   132         * @param aId the identifier for the parameter
       
   133         * @param aValue the value for the parameter
       
   134         */
       
   135         virtual TInt SetParameter( TInt aId, TInt aValue ) = 0;
       
   136 
       
   137         /**
       
   138         * Returns a value for a session parameter.
       
   139         * @param aId the identifier for the parameter
       
   140         * @return the value for the parameter or an error if not present
       
   141         */
       
   142         virtual TInt ParameterValue( TInt aId ) = 0;        
       
   143         
       
   144         /**
       
   145         * Checks whether application should be started in background mode. 
       
   146         * In background mode session will be pre-set up without user   
       
   147         * interaction and will be in paused state.
       
   148         * @return ETrue if background mode should be used
       
   149         */
       
   150         virtual TBool IsBackgroundStartup() = 0;
       
   151         
       
   152         /**
       
   153         * Engine can be informed about application foreground status via
       
   154         * this method.
       
   155         * @param aIsForeground ETrue if application is at foreground, EFalse
       
   156         *   if at background
       
   157         * @return KErrNone if succesfully handled
       
   158         */
       
   159         virtual TInt SetForegroundStatus( TBool aIsForeground ) = 0;
       
   160         
       
   161         /**
       
   162         * Returns remote party details for the session
       
   163         * @return remote party details or KNullDesC if those are not known
       
   164         */
       
   165         virtual const TDesC& RemoteDetails() = 0;
       
   166         
       
   167         /**
       
   168         * Updates established session. 
       
   169         * All the changes, if they are not yet delivered, to players, windows 
       
   170         * and session parameters has been commited after the call.
       
   171         */
       
   172         virtual void UpdateLcSessionL() = 0;
       
   173         
       
   174         /**
       
   175         * Send DTMF signals. 
       
   176         * @param aKey Key pressed from dialpad. Key can be  [0-9],*,#,A,B,C,D.
       
   177         * which is 16 key combination of DTMF.
       
   178         * Send DTMF signals to remote party.
       
   179         * @return ETrue upon success else EFalse.
       
   180         */
       
   181         virtual TBool SendDialTone( TChar aKey) = 0;
       
   182     };
       
   183     
       
   184 #endif // MLCSESSION_H
       
   185 
       
   186 // end of file