Home · All Namespaces · All Classes |
00001 /*************************************************************************** 00002 ** 00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 00004 ** All rights reserved. 00005 ** Contact: Nokia Corporation (directui@nokia.com) 00006 ** 00007 ** This file is part of mhome. 00008 ** 00009 ** If you have questions regarding the use of this file, please contact 00010 ** Nokia at directui@nokia.com. 00011 ** 00012 ** This library is free software; you can redistribute it and/or 00013 ** modify it under the terms of the GNU Lesser General Public 00014 ** License version 2.1 as published by the Free Software Foundation 00015 ** and appearing in the file LICENSE.LGPL included in the packaging 00016 ** of this file. 00017 ** 00018 ****************************************************************************/ 00019 #ifndef PAGEDVIEWPORT_H 00020 #define PAGEDVIEWPORT_H 00021 00022 #include <MPannableViewport> 00023 #include "layoutvisualizationwrapper.h" 00024 00025 class PagedPanning; 00026 00043 class PagedViewport : public MPannableViewport 00044 { 00045 Q_OBJECT 00046 00047 public: 00053 PagedViewport(QGraphicsItem *parent = 0); 00054 00058 virtual ~PagedViewport(); 00059 00065 void setPanDirection(const Qt::Orientations &panDirection); 00067 00073 void updatePageCount(int pages); 00074 00078 int currentPage() const; 00079 00084 int targetPage() const; 00085 00089 float pageWidth() const; 00090 00097 void setPageWrapMode(bool enable); 00098 00099 Q_SIGNALS: 00100 00107 void pageChanged(int newPage); 00108 00114 void pageCountChanged(int newPageCount); 00115 00120 void pageIsPanning(bool panning); 00121 00122 public Q_SLOTS: 00123 00130 void panToPage(uint page); 00131 00137 void setPage(uint page); 00138 00142 void focusFirstPage(); 00143 00145 void stopPanning(); 00146 00147 private Q_SLOTS: 00152 void newPageSet(int newPage); 00153 00157 void updateVisualizationWrapper(); 00158 00159 protected: 00161 void panGestureEvent(QGestureEvent *event, QPanGesture* panGesture); 00163 00164 private: 00166 PagedPanning* pagedPanning; 00167 00171 int previousPage; 00172 00174 QSharedPointer<LayoutVisualizationWrapper> layoutVisualizationWrapper; 00175 00177 bool explicitlyStopped; 00178 00179 #ifdef UNIT_TEST 00180 friend class Ut_PagedViewport; 00181 #endif 00182 }; 00183 00184 #endif
Copyright © 2011 Nokia Corporation | Generated on Thu Jul 7 2011 22:14:50 Doxygen 1.7.1 |
MeeGo Touch |