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 SWITCHER_H 00020 #define SWITCHER_H 00021 00022 #include <QTimer> 00023 #include <MWidgetController> 00024 #include "switchermodel.h" 00025 #include "xeventlistener.h" 00026 #include "windowinfo.h" 00027 #include <X11/Xlib.h> 00028 00029 00033 class Switcher : public MWidgetController, public XEventListener 00034 { 00035 Q_OBJECT 00036 M_CONTROLLER(Switcher) 00037 00038 public: 00044 Switcher(MWidget *parent = NULL, SwitcherModel *model = new SwitcherModel); 00045 00049 ~Switcher(); 00050 00057 bool handleXEvent(const XEvent &event); 00058 00059 signals: 00063 void windowListUpdated(const QList<WindowInfo> &windowList); 00064 00069 void animationStateChanged(bool animating); 00070 00071 public slots: 00080 void handleWindowInfoList(QList<WindowInfo> newWindowList); 00081 00089 bool restoreButtonBeingRemoved(Window window, bool forceUpdateButtons = true); 00090 00091 protected: 00093 00097 virtual bool sceneEvent(QEvent *event); 00099 00103 virtual QSharedPointer<SwitcherButton> createSwitcherButton(); 00104 00106 00107 private slots: 00111 void updateButtons(); 00112 00116 void windowToFront(Window window); 00117 00121 void closeWindowAndUpdateButtons(Window window); 00122 00126 void closeAllWindowsAndUpdateButtons(); 00127 00133 void updateAnimationStatus(bool animating); 00134 00135 private: 00139 void closeWindow(Window window); 00140 00144 void closeAllWindows(); 00145 00152 bool addWindows(const QSet<WindowInfo> &windowInfos); 00153 00160 bool addWindowInfo(const WindowInfo &window); 00161 00168 bool removeWindows(const QSet<WindowInfo> &windowInfos); 00169 00176 bool removeWindow(Window window); 00177 00183 void markWindowBeingClosed(Window window); 00184 00191 void markWindowTransientFor(Window window, Window transientFor); 00192 00199 void unmarkWindowTransientFor(Window window, Window transientFor); 00200 00208 bool isRelevantWindow(Window window); 00209 00219 bool isApplicationWindow(const WindowInfo &windowInfo); 00220 00228 Window topmostTransientWindowFor(Window window); 00229 00233 void scheduleUpdateButtons(); 00234 00239 void updateWindowTitle(Window window); 00240 00245 void updateWindowProperties(Window window); 00246 00254 static const WindowInfo *windowInfoFromSet(const QSet<WindowInfo> &windowInfos, Window window); 00255 00257 Atom closeWindowAtom; 00258 00260 Atom activeWindowAtom; 00261 00263 Atom clientListAtom; 00264 Atom netWindowNameAtom; 00265 Atom windowNameAtom; 00266 00268 QHash<Window, QSharedPointer<SwitcherButton> > switcherButtonMap; 00269 00271 QSet<Window> windowsBeingClosed; 00272 00274 QSet<WindowInfo> windowInfoSet; 00275 00277 QList<WindowInfo> applicationWindows; 00278 00280 QSet<Atom> excludeAtoms; 00281 00283 QHash<Window, QList<Window> > transientMap; 00284 00286 QTimer updateButtonsTimer; 00287 00289 Window topmostWindow; 00290 00299 bool isRelevantTopmostWindow(const WindowInfo &windowInfo); 00300 00301 #ifdef UNIT_TEST 00302 friend class Ut_Switcher; 00303 #endif 00304 }; 00305 00306 #endif // SWITCHER_H
Copyright © 2011 Nokia Corporation | Generated on Thu Jul 7 2011 22:14:50 Doxygen 1.7.1 |
MeeGo Touch |