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