camerauis/cameraxui/cxui/src/cxuipostcaptureview.cpp
changeset 40 2922f70fca82
parent 39 c5025ea871a1
child 41 67457b2ffb33
equal deleted inserted replaced
39:c5025ea871a1 40:2922f70fca82
    15 *
    15 *
    16 */
    16 */
    17 #include <QDebug>
    17 #include <QDebug>
    18 #include <QPixmap>
    18 #include <QPixmap>
    19 #include <QTimer>
    19 #include <QTimer>
    20 #include <QGraphicsSceneEvent>
       
    21 #include <QFileInfo>
    20 #include <QFileInfo>
    22 #include <QApplication>
    21 #include <QApplication>
    23 #include <QGraphicsRectItem>
    22 #include <QGraphicsRectItem>
    24 #include <QBrush>
    23 #include <QBrush>
    25 #include <QDir>
    24 #include <QDir>
    74     mStillToolbar(NULL),
    73     mStillToolbar(NULL),
    75     mVideoToolbar(NULL),
    74     mVideoToolbar(NULL),
    76     mEmbeddedToolbar(NULL),
    75     mEmbeddedToolbar(NULL),
    77     mBackgroundItem(NULL),
    76     mBackgroundItem(NULL),
    78     mImageLabel(NULL),
    77     mImageLabel(NULL),
       
    78     mShareUi(NULL),
    79     mStopViewfinderTimer(this),
    79     mStopViewfinderTimer(this),
    80     mReleaseCameraTimer(this),
    80     mReleaseCameraTimer(this),
    81     mPostcaptureTimer(this),
    81     mPostcaptureTimer(this),
    82     mTimersStarted(false),
    82     mTimersStarted(false),
    83     mDeleteNoteOpen(false)
    83     mDeleteNoteOpen(false)
    95 CxuiPostcaptureView::~CxuiPostcaptureView()
    95 CxuiPostcaptureView::~CxuiPostcaptureView()
    96 {
    96 {
    97     CX_DEBUG_ENTER_FUNCTION();
    97     CX_DEBUG_ENTER_FUNCTION();
    98     QCoreApplication::instance()->removeEventFilter(this);
    98     QCoreApplication::instance()->removeEventFilter(this);
    99     stopTimers();
    99     stopTimers();
       
   100     delete mShareUi;
   100     CX_DEBUG_EXIT_FUNCTION();
   101     CX_DEBUG_EXIT_FUNCTION();
   101 }
   102 }
   102 
   103 
   103 // ---------------------------------------------------------------------------
   104 // ---------------------------------------------------------------------------
   104 // CxuiPostcaptureView::construct
   105 // CxuiPostcaptureView::construct
   123     CX_DEBUG_ASSERT(mDocumentLoader);
   124     CX_DEBUG_ASSERT(mDocumentLoader);
   124     QGraphicsWidget *widget = 0;
   125     QGraphicsWidget *widget = 0;
   125     widget = mDocumentLoader->findWidget(POST_CAPTURE_SNAPSHOT_LABEL);
   126     widget = mDocumentLoader->findWidget(POST_CAPTURE_SNAPSHOT_LABEL);
   126     mImageLabel = qobject_cast<HbLabel *>(widget);
   127     mImageLabel = qobject_cast<HbLabel *>(widget);
   127     CX_DEBUG_ASSERT(mImageLabel);
   128     CX_DEBUG_ASSERT(mImageLabel);
       
   129 
       
   130     mShareUi = new ShareUi();
   128 
   131 
   129     // get toolbar pointers from the documentloader
   132     // get toolbar pointers from the documentloader
   130     widget = mDocumentLoader->findWidget(STILL_POST_CAPTURE_TOOLBAR);
   133     widget = mDocumentLoader->findWidget(STILL_POST_CAPTURE_TOOLBAR);
   131     // This resize is a workaround to get toolbar shown correctly.
   134     // This resize is a workaround to get toolbar shown correctly.
   132     widget->resize(60, 300);
   135     widget->resize(60, 300);
   204 /*!
   207 /*!
   205     Slot for starting video playing.
   208     Slot for starting video playing.
   206  */
   209  */
   207 void CxuiPostcaptureView::playVideo()
   210 void CxuiPostcaptureView::playVideo()
   208 {
   211 {
   209 
   212     
   210     launchNotSupportedNotification();
   213     launchNotSupportedNotification();
   211     //! @todo needs an implementation
   214     //! @todo needs an implementation
   212     CX_DEBUG_IN_FUNCTION();
   215     CX_DEBUG_IN_FUNCTION();
   213 
   216 
   214 }
   217 }
   283 {
   286 {
   284     CX_DEBUG_ENTER_FUNCTION();
   287     CX_DEBUG_ENTER_FUNCTION();
   285 
   288 
   286     stopTimers();
   289     stopTimers();
   287     releaseCamera();
   290     releaseCamera();
   288 
   291     hideControls();
   289     QString filename = getCurrentFilename();
   292     QString filename = getCurrentFilename();
   290 
       
   291     QStringList filelist;
   293     QStringList filelist;
   292     filelist.append(filename);
   294     filelist.append(filename);
   293 
   295 
   294     ShareUi dialog;
   296     mShareUi->send(filelist, true);
   295     dialog.send(filelist, true);
       
   296 
       
   297     showControls();
       
   298 
   297 
   299     CX_DEBUG_EXIT_FUNCTION();
   298     CX_DEBUG_EXIT_FUNCTION();
   300 }
   299 }
   301 
   300 
   302 // ---------------------------------------------------------------------------
   301 // ---------------------------------------------------------------------------
   393 */
   392 */
   394 void CxuiPostcaptureView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
   393 void CxuiPostcaptureView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
   395 {
   394 {
   396         OstTrace0(camerax_performance, CXUIPOSTCAPTUREVIEW_SNAPSHOT_DRAW, "msg: e_CX_SHOT_TO_SNAPSHOT 0");
   395         OstTrace0(camerax_performance, CXUIPOSTCAPTUREVIEW_SNAPSHOT_DRAW, "msg: e_CX_SHOT_TO_SNAPSHOT 0");
   397         QGraphicsWidget::paint(painter, option, widget);
   396         QGraphicsWidget::paint(painter, option, widget);
   398 }
       
   399 
       
   400 // ---------------------------------------------------------------------------
       
   401 // CxuiPostcaptureView::mousePressEvent
       
   402 //
       
   403 // ---------------------------------------------------------------------------
       
   404 //
       
   405 void CxuiPostcaptureView::mousePressEvent(QGraphicsSceneMouseEvent *event)
       
   406 {
       
   407 
       
   408     if (event->type() == QEvent::GraphicsSceneMousePress) {
       
   409         mPostcaptureTimer.stop();
       
   410         toggleControls();
       
   411         event->accept();
       
   412     }
       
   413 
       
   414 }
   397 }
   415 
   398 
   416 // ---------------------------------------------------------------------------
   399 // ---------------------------------------------------------------------------
   417 // CxuiPostcaptureView::showEvent
   400 // CxuiPostcaptureView::showEvent
   418 //
   401 //