ui/views/fullscreenview/inc/glxzoomcontrol.h
branchGCC_SURGE
changeset 51 525c140ec8db
parent 38 c9962d0368d9
parent 49 f291796e213d
equal deleted inserted replaced
38:c9962d0368d9 51:525c140ec8db
     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:   ?Description
       
    15 *
       
    16 */
       
    17 #ifndef GLXZOOMCONTROL_H
       
    18 #define GLXZOOMCONTROL_H
       
    19 #include <hbscrollarea.h>
       
    20 
       
    21 class GlxMediaModel;
       
    22 class QAbstractItemModel;
       
    23 class HbIconItem;
       
    24 class GlxImageDecoderWrapper;
       
    25 class GlxZoomControl : public HbScrollArea
       
    26 {
       
    27 Q_OBJECT
       
    28 
       
    29 public:
       
    30 	GlxZoomControl(QGraphicsItem *parent = NULL);
       
    31 	~GlxZoomControl();
       
    32 	void setModel (QAbstractItemModel *model);
       
    33     void indexChanged (int index);
       
    34 	void setWindowSize (QSize windowSize);
       
    35 signals:
       
    36 	void hideFullScreenUi();
       
    37 public slots:
       
    38 	void zoomImage(int zoomFactor);
       
    39 	void decodedImageAvailable();
       
    40 	void initialZoomFactor(int initZoomFactor);
       
    41 private:
       
    42 	void initializeZoomControl(int zoomFactor);
       
    43 	void resetZoomControl();
       
    44 	void updateItemPosition();
       
    45 	void calculatePanOffset();
       
    46 	void checkandAdjustImageBoundaries(QPointF &finalPos, QPointF undefferedPos);
       
    47 
       
    48 private:
       
    49 	QGraphicsPixmapItem *mZoomItem;
       
    50 	QGraphicsWidget *mZoomWidget;
       
    51 	GlxImageDecoderWrapper* mImageDecoder;
       
    52 	HbIconItem *mBlackBackgroundItem;
       
    53 	QSizeF mCurrentSize;
       
    54 	QSizeF mItemSize;
       
    55 	GlxMediaModel *mModel; //not owned
       
    56 	int mInitialZoomFactor;
       
    57 	int mCurrentZoomFactor;
       
    58 	bool mIsControlActivated;
       
    59 	bool mIsItemChanged;
       
    60 	QSize mWindowSize;
       
    61 	QPointF mPanOffset;
       
    62 };
       
    63 #endif //GLXZOOMCONTROL_h