mmsharinguis_plat/multimedia_sharing_manager_api/inc/musmanager.h
changeset 22 496ad160a278
equal deleted inserted replaced
15:ccd8e69b5392 22:496ad160a278
       
     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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MUSMANAGER_H
       
    20 #define MUSMANAGER_H
       
    21 
       
    22 #include "musmanagercommon.h"
       
    23 //#include "musunittesting.h"
       
    24 
       
    25 #include <e32base.h>
       
    26 #include <sipstrconsts.h> 
       
    27 
       
    28 class CMusManagerImpl;
       
    29 class MMusAvailabilityObserver;
       
    30 
       
    31 /**
       
    32  *  Class to manager MultimediaSharing application.
       
    33  *
       
    34  *  Class CMusManager provides an interface to monitor
       
    35  *  the system's ability to initiate a MultimediaSharing
       
    36  *  session. Also, MultimediaSharing application can be started
       
    37  *  via this interface. Application can be ordered to close 
       
    38  *  itself by calling the stop application function.
       
    39  *
       
    40  *  MultimediaSharing availability is a variable of a system
       
    41  *  that describes that is a MultimediaSharing session currently
       
    42  *  possible, or not. It depends on call state, network state,
       
    43  *  SIP profiles and SIP OPTIONS. 
       
    44  *
       
    45  *  @lib musmanagerclient.dll
       
    46  */
       
    47 class CMusManager : public CBase
       
    48     {
       
    49 public:
       
    50 
       
    51     enum TRequestType
       
    52         {
       
    53         ESipOptions = 0x1028238D,
       
    54         ESipInviteDesired = 0x10282391,
       
    55         ESipInviteDesired2WayVideo = 0x10282392,
       
    56         ESipInviteNotDesired = 0x1028238D
       
    57         };
       
    58        
       
    59 
       
    60 public: // first phase constructors and destructor
       
    61 
       
    62     IMPORT_C static CMusManager* NewL();
       
    63 
       
    64     IMPORT_C static CMusManager* NewLC();
       
    65     
       
    66     /**
       
    67      * Creates Mus Manager instance allowing the clients to pass 
       
    68      * an observer interface through which the clients will be capable 
       
    69      * to listen for the availability state of Multimedia Sharing
       
    70      *
       
    71      * @param aAvailabilityObserver pointer to the implementation of 
       
    72      *              availabilty observer interface
       
    73      *
       
    74      * @since S60 v5.0     
       
    75      */
       
    76     IMPORT_C static CMusManager* NewL( 
       
    77                     MMusAvailabilityObserver* aAvailabilityObserver );
       
    78 
       
    79     /**
       
    80      * Creates Mus Manager instance allowing the clients to pass 
       
    81      * an observer interface through which the clients will be capable 
       
    82      * to listen for the availability state of Multimedia Sharing
       
    83      * Mus Manager instance is left on cleanup stack.
       
    84      *
       
    85      * @param aAvailabilityObserver pointer to the implementation of 
       
    86      *              availabilty observer interface
       
    87      *
       
    88      * @since S60 v5.0          
       
    89      */
       
    90     IMPORT_C static CMusManager* NewLC( 
       
    91                     MMusAvailabilityObserver* aAvailabilityObserver );
       
    92     
       
    93     virtual ~CMusManager();
       
    94     
       
    95 public: // functions related to availability of MultimediaSharing
       
    96 
       
    97     /**
       
    98      * This function causes following things:
       
    99      * - MS manager starts to monitor call and network state
       
   100      * - In case of active call, MS manager
       
   101      *     - resolves the SIP address of the remote host
       
   102      *     - makes a capability query (SIP OPTIONS)
       
   103      * 
       
   104      * This function must be called before a MultimediaSharing
       
   105      * session is tried to be established. Otherwise, the internal state of 
       
   106      * MultimediaSharing will remain as undefined. In that state,
       
   107      * MultimediaSharing Manager will not start the application.
       
   108      *
       
   109      * @since S60 v3.2
       
   110      */
       
   111     IMPORT_C void ExamineAvailabilityL();
       
   112     
       
   113     /**
       
   114      * Returns the current availability status.
       
   115      *
       
   116      * @since S60 v3.2
       
   117      * @return The current availability status.
       
   118      */
       
   119     IMPORT_C MultimediaSharing::TMusAvailabilityStatus AvailabilityL();
       
   120     
       
   121 public: // functions related to application start-up   
       
   122  
       
   123  	 /**
       
   124      * This function allows clients to request coomand's to be executed by 
       
   125      * the MUS manager server.
       
   126      *
       
   127      * In erroneous cases, this function will leave
       
   128      * with an error code that describes the error. Positive leave codes
       
   129      * are defined in MultimediaSharing::TMusAvailabilityStatus.
       
   130      *
       
   131      * @param aRequest Defines the coomand type. 
       
   132      *                 
       
   133      */
       
   134     IMPORT_C void HandleCommandL( MultimediaSharing::TCommandType aCommandType );
       
   135  
       
   136  
       
   137     /**
       
   138      * Orders MultimediaSharing subsystem to handle a SIP request. 
       
   139      * In some cases, this function call starts the application.
       
   140      *
       
   141      * In erroneous cases, this function will leave
       
   142      * with an error code that describes the error. Positive leave codes
       
   143      * are defined in MultimediaSharing::TMusAvailabilityStatus.
       
   144      *
       
   145      * @param aRequest Defines the request type. 
       
   146      *                 Must be SipStrConsts::EOptions or SipStrConsts::EInvite
       
   147      */
       
   148     IMPORT_C void HandleSipRequestL( TRequestType aRequestType );
       
   149     
       
   150     /**
       
   151      * Starts the MultimediaSharing application
       
   152      *
       
   153      * If the application can't be started, this function will leave
       
   154      * with an error code that describes the error. Positive leave codes
       
   155      * are defined in MultimediaSharing::TMusAvailabilityStatus.
       
   156      *
       
   157      * @param aUseCase Describes the desired use case and 
       
   158                        affects the default view.
       
   159      */
       
   160     IMPORT_C void StartApplicationL( MultimediaSharing::TMusUseCase aUseCase );
       
   161     
       
   162 public: // functions to related application closing
       
   163     
       
   164     /**
       
   165      * This function causes the application to get a stop signal.
       
   166      * Application will close itself smoothly.
       
   167      *
       
   168      */
       
   169     IMPORT_C void StopApplicationL();
       
   170 
       
   171 private: // second phase constructors
       
   172 
       
   173     CMusManager();
       
   174 
       
   175     void ConstructL();
       
   176     
       
   177     void ConstructL( MMusAvailabilityObserver* aAvailabilityObserver );
       
   178 
       
   179 private: // data
       
   180 
       
   181     /**
       
   182      * The actual implementation of the interface.
       
   183      * Own. 
       
   184      */
       
   185     CMusManagerImpl* iImpl;
       
   186     };
       
   187 
       
   188 #endif // ? MUSMANAGER_H