camerauis/cameraxui/cxengine/inc/api/cxezoomcontrol.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 CXEZOOMCONTROL_H
       
    18 #define CXEZOOMCONTROL_H
       
    19 
       
    20 #include <QObject>
       
    21 #include <QMetaType>
       
    22 #include "cxeerror.h"
       
    23 
       
    24 class CxeZoomControl : public QObject
       
    25     {
       
    26     Q_OBJECT
       
    27 public:
       
    28 
       
    29     // State Machine
       
    30     enum State {
       
    31         Idle       = 0x01,
       
    32         Ready      = 0x02,
       
    33         ZoomingIn  = 0x04,
       
    34         ZoomingOut = 0x08
       
    35         };
       
    36 
       
    37     /**
       
    38      * Returns the state of the control.
       
    39      */
       
    40     virtual State state() const = 0;
       
    41 
       
    42     /**
       
    43      * Returns the minimum zoom level/step.
       
    44      */
       
    45     virtual int min() const = 0;
       
    46 
       
    47     /**
       
    48      * Returns the maximum zoom levels/steps.
       
    49      */
       
    50     virtual int max() const = 0;
       
    51 
       
    52     /**
       
    53      * Zoom to a certain specified zoom level/step.
       
    54      */
       
    55     virtual void zoomTo( int value ) = 0;
       
    56 
       
    57 signals:
       
    58     /**
       
    59      * Signal to notify the observers that zoom level/step has changed.
       
    60      */
       
    61     void zoomLevelChanged( int zoomPosition );
       
    62 
       
    63     /**
       
    64      * Signal to notify the observers that state of zoom control has changed.
       
    65      */
       
    66     void stateChanged( CxeZoomControl::State newState, CxeError::Id error );
       
    67 
       
    68 protected:
       
    69     /**
       
    70      * Protected empty contructor so that derived class construction works.
       
    71      */
       
    72     CxeZoomControl() {}
       
    73 
       
    74 private:
       
    75     Q_DISABLE_COPY( CxeZoomControl )
       
    76     };
       
    77 
       
    78 Q_DECLARE_METATYPE(CxeZoomControl::State)
       
    79 
       
    80 #endif // CXEZOOMCONTROL_H