mmsharing/livecommsui/lcuiengine/inc/lcuiengine_p.h
changeset 22 496ad160a278
child 25 53c1c4459a94
equal deleted inserted replaced
15:ccd8e69b5392 22:496ad160a278
       
     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 LCUIENGINEPRIVATE_H
       
    18 #define LCUIENGINEPRIVATE_H
       
    19 
       
    20 //USER
       
    21 #include "lcsessionobserver.h"
       
    22 #include "lcuiprovider.h"
       
    23 
       
    24 //SYSTEM
       
    25 #include <QObject>
       
    26 #include <QString>
       
    27 #include <QTime>
       
    28 #include <lcuiengine.h>
       
    29 #include <lcengine.h>
       
    30 
       
    31 class MLcSession;
       
    32 class MLcAudioControl;
       
    33 class MLcZoomControl;
       
    34 class HbDialog;
       
    35 class HbMessageBox;
       
    36 class QTimer;
       
    37 class QRectF;
       
    38 class LcUiEngine;
       
    39 class HbView;
       
    40 class LcActivityManager;
       
    41 
       
    42 /*
       
    43  * Live Comms UI Engine 
       
    44  */
       
    45 class LcUiEnginePrivate : public QObject, 
       
    46                    public MLcSessionObserver,
       
    47                    public MLcUiProvider
       
    48 {
       
    49     Q_OBJECT
       
    50     friend class UT_LcUiEngine;
       
    51 
       
    52 public:
       
    53     
       
    54     explicit LcUiEnginePrivate(LcUiEngine& uiEngine,
       
    55                                const QString &engineName,
       
    56                                const QString &applicationDisplayName);
       
    57     ~LcUiEnginePrivate();
       
    58     
       
    59 public slots:
       
    60 
       
    61     void zoom( int value );
       
    62     void stop();
       
    63     void stopLocalVideo();
       
    64     void startLocalVideo();
       
    65         
       
    66 public: // API
       
    67     
       
    68     void start();
       
    69     const QString& sessionTitle() const;
       
    70     const QString& recipient() const;
       
    71     const QString& phoneNumber() const;
       
    72     LcViewLayoutHint viewLayout() const;
       
    73     void setContentAreas(const QRectF& sharedContent,
       
    74                          const QRectF& receivedContent);
       
    75     bool setOrientation(Qt::Orientation orientation );
       
    76     void setUiComponents(HbProgressDialog* invitingNote,
       
    77                          HbProgressDialog* waitingNote,
       
    78                          HbDialog* acceptQuery,
       
    79                          HbDialog* recipientQuery,
       
    80                          HbDialog* shareOwnVideoQuery );
       
    81     void toggleMute();
       
    82     bool isMuted() const;
       
    83     void toggleSpeaker();
       
    84     bool isSpeakerOn() const;
       
    85     int zoomValues( LcControlValues& values ) const;
       
    86     void toggleDisableCamera();
       
    87     void setMainCamera(const bool aMainCamera);
       
    88     bool mainCamera() const;
       
    89     void toggleCamera();
       
    90     bool fullScreenMode();
       
    91     void setFullScreenMode(bool aMode);
       
    92     void updateSession();
       
    93     bool isLocalPlayerPlaying() const;
       
    94     bool isRemotePlayerPlaying() const;
       
    95     bool isMinimized()const;
       
    96     void minimize();
       
    97     void maximize();
       
    98     void shareImage(const QString&){};
       
    99     void shareCamera(){};
       
   100     void setCurrentView(HbView* view);
       
   101     bool SendDialTone(const QChar aKey );
       
   102     
       
   103 protected: // From QObject
       
   104     
       
   105     void timerEvent(QTimerEvent *event);
       
   106 
       
   107 private slots:
       
   108     
       
   109     void startReceiving();
       
   110     void stopForcefully();
       
   111     void handleEngineForegroundStatus();
       
   112     
       
   113 private: // From MLcSessionObserver
       
   114     
       
   115     void StateChanged( MLcSession& aSession );
       
   116     void StateChanged( MLcVideoPlayer& aPlayer );
       
   117     void Updated( MLcSession& aSession );
       
   118     void Updated( MLcVideoPlayer& aPlayer );
       
   119     void Failed( MLcSession& aSession, TInt aError );
       
   120     void Failed( MLcVideoPlayer& aPlayer, TInt aError );
       
   121     void SessionTimeChanged( MLcSession& aSession, const TTimeIntervalSeconds& aSeconds );
       
   122 
       
   123 private: // From MLcUiProvider
       
   124 
       
   125     TBool SelectRecipient( MDesCArray& aRecipientAddresses, TDes& aSelectedRecipientAddress );        
       
   126     TBool InputRecipient( TDes& aRecipientAddress );
       
   127     void HandleForegroundStatus( TBool aForeground );
       
   128     void BlockUi( TBool aBlocked );    
       
   129 
       
   130 private: // New functions
       
   131     
       
   132     LcViewLayoutHint setViewLayout();
       
   133     void emitViewLayoutChanged();
       
   134     void startLiveContent();
       
   135     void startPlayback(); 
       
   136     void startRemoteVideo();
       
   137     void startCloseTimer();
       
   138     void cancelCloseTimer();
       
   139     void hideNotes( bool hideWaitingNote );
       
   140     void completeAction( const char* actionMethod );
       
   141     void setPendingAction( const char* actionMethod );
       
   142     void completePendingAction();
       
   143     bool usingVideoTelephoneEngine();
       
   144     MLcSession& session() const;
       
   145     MLcVideoPlayer* visibleLocalPlayer() const;
       
   146     MLcVideoPlayer* visibleRemotePlayer() const;
       
   147     MLcAudioControl* audioControl() const;
       
   148     MLcZoomControl* zoomControl() const;
       
   149     bool featureSupported( CLcEngine::TLcFeature feature );
       
   150     void startSessionDurationTimer();
       
   151     void stopSessionDurationTimer();
       
   152     void fillRemoteInfo(bool informChanges);
       
   153     void startStopGuardTimer();
       
   154     bool isAllowedToShareVideo();
       
   155     
       
   156 private: // New functions wrapping the leaving functions in LC plug-in API
       
   157     
       
   158     int establishSession();
       
   159     int terminateSession();
       
   160     int setWindowRect( MLcVideoPlayer* player, TRect rect );
       
   161     int enableWindow( MLcVideoPlayer* player, bool enable );
       
   162     int play( MLcVideoPlayer* player );
       
   163     int pause( MLcVideoPlayer* player );
       
   164     int enableSpeaker( bool enable );
       
   165     int muteMic( bool mute );
       
   166 
       
   167 private: // Data
       
   168     
       
   169     QByteArray mEngineName;
       
   170     QString mSessionTitle;
       
   171     QString mRecipient;
       
   172     QString mPhoneNumber;
       
   173     LcViewLayoutHint mViewLayout;
       
   174     CLcEngine* mLiveCommsEngine;
       
   175     QTimer* mCloseTimer;
       
   176     HbProgressDialog* mInvitingNote; // Not owned
       
   177     HbProgressDialog* mWaitingNote; // Not owned
       
   178     HbDialog* mAcceptQuery; // Not owned
       
   179     HbDialog* mRecipientQuery; // Not owned
       
   180     HbDialog* mShareOwnVideoQuery; // Not Owned
       
   181     QString mPendingAction;
       
   182     bool mBlocked;
       
   183     bool mFullScreen;
       
   184     int mSessionDurationTimerId;
       
   185     QTime mSessionDurationStartTime;
       
   186     bool mMainCamera;
       
   187     LcUiEngine& mUiEngine;
       
   188     bool mIsMinimized;
       
   189     bool mFirstForegroundSwitch;
       
   190     int mViewReadySimulationTimerId;
       
   191     HbView* mCurrentView; // Not owned
       
   192     TRect mLocalRect;
       
   193     TRect mRemoteRect;
       
   194     LcActivityManager* mActivityManager;
       
   195     
       
   196 friend class LcUiEngine;    
       
   197 };
       
   198 
       
   199 #endif // LCUIENGINEPRIVATE_H
       
   200 
       
   201 
       
   202 // End of file