mmappfw_plat/qt_telephony_multimedia_service_api/inc/qtmscall.h
changeset 27 cbb1bfb7ebfb
child 50 762d760dcfdf
equal deleted inserted replaced
25:d881023c13eb 27:cbb1bfb7ebfb
       
     1 /*
       
     2  * Copyright (c) 2010 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: QT Bindings for TMS
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef QTMS_CALL_H
       
    19 #define QTMS_CALL_H
       
    20 
       
    21 #include <qtms.h>
       
    22 #include <QObject>
       
    23 #include "qtmswrapperexport.h"
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 namespace TMS {
       
    27 class TMSCall;
       
    28 }
       
    29 
       
    30 namespace QTMS {
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class QTMSStream;
       
    34 
       
    35 /**
       
    36  * QTMSCall class
       
    37  *
       
    38  * This class instantiates QTMS call object of one of the following types:
       
    39  *  QTMS_CALL_CS
       
    40  *  QTMS_CALL_ECS
       
    41  *  QTMS_CALL_IP
       
    42  *
       
    43  * Each QTMS call contains at least 1 stream (uplink or downlink).
       
    44  *
       
    45  * Usage:
       
    46  * <code>
       
    47  * QTMSFactory *iFactory;
       
    48  * QTMSCall *iCall;
       
    49  * QTMSStream *iUplink;
       
    50  * QTMSStream *iDownlink;
       
    51  * gint err;
       
    52  * err = QTMSFactory::CreateFactory(iFactory);
       
    53  * err = iFactory->CreateCall(QTMS_CALL_IP, iCall);
       
    54  * err = iCall->CreateStream(QTMS_STREAM_UPLINK, iUplink);
       
    55  * err = iCall->CreateStream(QTMS_STREAM_DOWNLINK, iDownlink);
       
    56  * ...
       
    57  * err = iCall->DeleteStream(iDownlink);
       
    58  * err = iCall->DeleteStream(iUplink);
       
    59  * err = iFactory->DeleteCall(iCall);
       
    60  * delete iFactory;
       
    61  * ...
       
    62  * </code>
       
    63  *
       
    64  * @lib QTMSapi.lib
       
    65  *
       
    66  */
       
    67 class QTMS_WRAPPER_DLL_EXPORT QTMSCall : public QObject
       
    68     {
       
    69     Q_OBJECT
       
    70 public:
       
    71     /**
       
    72      * Destructor
       
    73      *
       
    74      */
       
    75     virtual ~QTMSCall();
       
    76 
       
    77     /**
       
    78      * Return call type.
       
    79      *
       
    80      * This function can be called at any time.
       
    81      *
       
    82      * Possible call types are as follows:
       
    83      *  QTMS_CALL_CS,
       
    84      *  QTMS_CALL_ECS
       
    85      *  QTMS_CALL_IP
       
    86      *
       
    87      * @return
       
    88      *      Call type as indicated above.
       
    89      *
       
    90      */
       
    91     QTMSCallType GetCallType();
       
    92 
       
    93     /**
       
    94      * Get call context ID.
       
    95      *
       
    96      * This ID is passed during the creation of the call object.
       
    97      *
       
    98      * @param  ctxid
       
    99      *      Context ID.
       
   100      *
       
   101      * @return
       
   102      *      QTMS_RESULT_SUCCESS if the operation was successful.
       
   103      *      QTMS_RESULT_FATAL_ERROR if an error occured.
       
   104      *
       
   105      */
       
   106     gint GetCallContextId(guint& ctxid);
       
   107 
       
   108     /**
       
   109      * Create QTMS stream of the given type.
       
   110      *
       
   111      * @param  type
       
   112      *      Stream type to be created.
       
   113      *
       
   114      * @param  strm
       
   115      *      Created stream.
       
   116      *
       
   117      * @return
       
   118      *      QTMS_RESULT_SUCCESS if the operation was successful.
       
   119      *      QTMS_RESULT_INSUFFICIENT_MEMORY if call creation failed due to
       
   120      *      insufficient memory.
       
   121      *      QTMS_RESULT_STREAM_TYPE_NOT_SUPPORTED if stream type is not
       
   122      *      supported.
       
   123      *      QTMS_RESULT_FATAL_ERROR if an error occured.
       
   124      *      QTMS_REASON_EMERGENCY_CALL_ONGOING if emergency call is active.
       
   125      *      QTMS_REASON_PERMISSION_DENIED if permission is denied.
       
   126      *
       
   127      */
       
   128     gint CreateStream(const QTMSStreamType type, QTMSStream*& strm);
       
   129 
       
   130     /**
       
   131      * Delete stream object.
       
   132      *
       
   133      * @param  strm
       
   134      *      Stream to be deleted.
       
   135      *
       
   136      * @return
       
   137      *      QTMS_RESULT_SUCCESS if the operation was successful.
       
   138      *      QTMS_RESULT_INVALID_ARGUMENT if the stream is not valid.
       
   139      */
       
   140     gint DeleteStream(QTMSStream*& strm);
       
   141 
       
   142 protected:
       
   143     /**
       
   144      * Constructor
       
   145      */
       
   146     QTMSCall();
       
   147 
       
   148 protected:
       
   149     TMS::TMSCall* iTmsCall;
       
   150     };
       
   151 
       
   152 } //namespace QTMS
       
   153 
       
   154 #endif //QTMS_CALL_H
       
   155 
       
   156 // End of file
       
   157