camerauis/cameraxui/cxengine/inc/cxeviewfindercontrolsymbian.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 23 61bc0f252b2b
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
     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 __CXEVIEWFINDERCONTROLSYMBIAN_H__
       
    18 #define __CXEVIEWFINDERCONTROLSYMBIAN_H__
       
    19 
       
    20 //  Include Files
       
    21 #include <ecam.h>
       
    22 #include "cxeviewfindercontrol.h"
       
    23 #include "cxestatemachine.h"
       
    24 #include "cxesettings.h"
       
    25 
       
    26 //  Constants
       
    27 
       
    28 
       
    29 //  Class Definitions
       
    30 
       
    31 class CxeCameraDeviceControl;
       
    32 class CxeCameraDevice;
       
    33 class RWindowBase;
       
    34 class CxeVideoContainer;
       
    35 
       
    36 
       
    37 
       
    38 class CxeViewfinderControlSymbian : public CxeViewfinderControl,
       
    39                                     public CxeStateMachine
       
    40 {
       
    41     Q_OBJECT
       
    42 
       
    43 public:
       
    44 
       
    45     CxeViewfinderControlSymbian(CxeCameraDevice &cameraDevice,
       
    46             CxeCameraDeviceControl &mCameraDeviceControl);
       
    47     virtual ~CxeViewfinderControlSymbian();
       
    48 
       
    49 public: // from base class
       
    50 
       
    51     void setWindow(WId windowId);
       
    52 
       
    53     /*
       
    54     * stops the view finder.
       
    55     */
       
    56     void stop();
       
    57 
       
    58     /*
       
    59     * Get current state of view finder control
       
    60     * returns one of Vf states defined above.
       
    61     */
       
    62     State state() const;
       
    63 
       
    64     /*
       
    65     * Start view finder
       
    66     * @returns CxeError::Id error code
       
    67     */
       
    68     CxeError::Id start();
       
    69 
       
    70     /*!
       
    71     * Returns Device's Display resolution
       
    72     */
       
    73     QSize deviceDisplayResolution() const;
       
    74 
       
    75 protected: // from CxeStateMachine
       
    76     void handleStateChanged(int newStateId, CxeError::Id error);
       
    77 
       
    78 protected:
       
    79     void initializeStates();
       
    80 
       
    81 protected slots:
       
    82     // notifications when camera reference is changed
       
    83     void prepareForCameraDelete();
       
    84     void handleCameraAllocated(CxeError::Id error);
       
    85     void handleVfFrame(MCameraBuffer* buffer, int error);
       
    86     void prepareForRelease();
       
    87 
       
    88 private:
       
    89     /*
       
    90     * Intializes viewfinder based on VF mode
       
    91     * returns CxeEngine Std error code
       
    92     */
       
    93     int initViewfinder();
       
    94     void createViewfinderWindowL();
       
    95     void releaseCurrentViewfinder();
       
    96 
       
    97 private:
       
    98     // data members
       
    99     CxeCameraDevice &mCameraDevice;
       
   100     CxeCameraDeviceControl &mCameraDeviceControl;
       
   101 
       
   102     RWindowBase *mUiWindow;
       
   103     RWindowBase *mVideoWindow;
       
   104     CxeVideoContainer *mVideoContainer;
       
   105 
       
   106     TRect mWindowRect;
       
   107     CCamera::CCameraDirectViewFinder *mDirectViewfinder;
       
   108 
       
   109     bool mDirectViewfinderInUse;
       
   110 };
       
   111 
       
   112 
       
   113 
       
   114 #endif  // __CXEVIEWFINDERCONTROLSYMBIAN_H__
       
   115