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 00020 #ifndef SWITCHERVIEW_H 00021 #define SWITCHERVIEW_H 00022 00023 #include <MWidgetView> 00024 #include "switcherviewbase.h" 00025 #include "switchermodel.h" 00026 #include "switcherstyle.h" 00027 00028 class Switcher; 00029 class MLinearLayoutPolicy; 00030 class MGridLayoutPolicy; 00031 class PagedViewport; 00032 00036 class SwitcherView : public SwitcherViewBase 00037 { 00038 Q_OBJECT 00039 M_VIEW(SwitcherModel, SwitcherStyle) 00040 00041 public: 00047 SwitcherView(Switcher *controller); 00048 00052 virtual ~SwitcherView(); 00053 00054 protected: 00056 virtual void applySwitcherMode(); 00058 00059 protected slots: 00061 virtual void updateData(const QList<const char *>& modifications); 00062 virtual void applyPinchGestureTargetMode(); 00064 00065 private slots: 00067 void updateFocusedButton(int currentPage); 00068 00070 void panningStopped(); 00071 00073 void updateButtons(); 00074 00075 private: 00077 void repositionSwitcher(); 00078 00080 void addButtonInOverviewPolicy(QSharedPointer<SwitcherButton> button); 00081 00083 void updateContentsMarginsAndSpacings(); 00084 00086 void updateDetailViewContentsMarginsAndSpacings(); 00087 00089 void updateOverviewContentsMarginsAndSpacings(); 00090 00092 void updateButtonModesAndPageCount(); 00093 00095 int buttonsPerPage() const; 00096 00098 MGridLayoutPolicy *overviewPolicy; 00099 MLinearLayoutPolicy *detailPolicy; 00100 00102 int focusedSwitcherButton; 00103 00105 PagedViewport *pagedViewport; 00106 00108 const SwitcherStyle *overviewStyle; 00109 00110 #ifdef UNIT_TEST 00111 // to test snapIndexChanged effects 00112 friend class Ut_SwitcherView; 00113 #endif 00114 }; 00115 00116 #endif // SWITCHERVIEW_H
Copyright © 2011 Nokia Corporation | Generated on Thu Jul 7 2011 22:14:50 Doxygen 1.7.1 |
MeeGo Touch |