logsui/logsengine/inc/logscall.h
changeset 0 4a5361db8937
child 15 76d2cf7a585e
equal deleted inserted replaced
-1:000000000000 0:4a5361db8937
       
     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 #ifndef LOGSCALL_H
       
    18 #define LOGSCALL_H
       
    19 
       
    20 #include <QObject>
       
    21 #include <QList>
       
    22 #include <logsexport.h>
       
    23 
       
    24 #include "logsevent.h"
       
    25 
       
    26 
       
    27 /**
       
    28  * LogsCall can be used to  make a call
       
    29  * from logs model.
       
    30  */
       
    31 class LogsCall : public QObject 
       
    32 {
       
    33     Q_OBJECT
       
    34   
       
    35 public:
       
    36     
       
    37     enum CallType {
       
    38         TypeLogsCallNotAvailable = 0,
       
    39         TypeLogsVoiceCall,
       
    40         TypeLogsVideoCall,
       
    41         TypeLogsVoIPCall
       
    42     };
       
    43     
       
    44 public: 
       
    45  		
       
    46     explicit LogsCall(LogsEvent& aEvent);
       
    47     explicit LogsCall(unsigned int contactId, const QString& number);
       
    48     
       
    49     LOGSENGINE_EXPORT ~LogsCall();
       
    50  		
       
    51     LOGSENGINE_EXPORT QList<LogsCall::CallType> allowedCallTypes();
       
    52     
       
    53     LOGSENGINE_EXPORT LogsCall::CallType defaultCallType();
       
    54     
       
    55     LOGSENGINE_EXPORT static void callToNumber(LogsCall::CallType callType, const QString& number,
       
    56             unsigned int serviceId = 0);
       
    57     
       
    58     bool isAllowedCallType();
       
    59     
       
    60 public slots:
       
    61 
       
    62     LOGSENGINE_EXPORT void call(LogsCall::CallType callType);
       
    63     LOGSENGINE_EXPORT void initiateCallback();
       
    64     
       
    65 private: 
       
    66     
       
    67     static void createcall(QString service, QString type, QString num, bool sync);
       
    68     static void createCallWithService(QString service, QString type, QString num, 
       
    69             bool sync, unsigned int serviceId );
       
    70         
       
    71 private: //data 
       
    72     
       
    73     QList<LogsCall::CallType> mCalls;
       
    74     CallType mDefaultCall;
       
    75     QString mNumber;
       
    76     unsigned int mServiceId;
       
    77     
       
    78 private:
       
    79     friend class UT_LogsCall;
       
    80     
       
    81 };
       
    82                   
       
    83 #endif // LOGSCALL_H