File indexing completed on 2024-05-19 04:48:56
0001 /*************************************************************************** 0002 * Copyright (c) 2008 Jeff Mitchell <mitchell@kde.org> * 0003 * * 0004 * This program is free software; you can redistribute it and/or modify * 0005 * it under the terms of the GNU General Public License as published by * 0006 * the Free Software Foundation; either version 2 of the License, or * 0007 * (at your option) any later version. * 0008 * * 0009 * This program is distributed in the hope that it will be useful, * 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0012 * GNU General Public License for more details. * 0013 * * 0014 * You should have received a copy of the GNU General Public License * 0015 * along with this program; if not, write to the * 0016 * Free Software Foundation, Inc., * 0017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 0018 ***************************************************************************/ 0019 0020 #ifndef POPUPDROPPER_P_H 0021 #define POPUPDROPPER_P_H 0022 0023 #include <QList> 0024 #include <QMap> 0025 #include <QObject> 0026 #include <QRectF> 0027 #include <QTimeLine> 0028 #include <QTimer> 0029 0030 #include "PopupDropper.h" 0031 #include "PopupDropperView.h" 0032 0033 class QSvgRenderer; 0034 class QWidget; 0035 0036 class PopupDropperPrivate : public QObject 0037 { 0038 Q_OBJECT 0039 0040 public: 0041 PopupDropperPrivate( PopupDropper* parent, bool sa, QWidget* widget ); 0042 ~PopupDropperPrivate() override; 0043 0044 void newSceneView( PopupDropper* pud ); 0045 void setParent( QObject* parent ); 0046 0047 bool standalone; 0048 QWidget* widget; 0049 QGraphicsScene* scene; 0050 PopupDropperView* view; 0051 PopupDropper::Fading fade; 0052 QTimeLine fadeHideTimer; 0053 QTimeLine fadeShowTimer; 0054 int fadeInTime; 0055 int fadeOutTime; 0056 QTimer deleteTimer; 0057 int deleteTimeout; 0058 int frameMax; 0059 QColor windowColor; 0060 QBrush windowBackgroundBrush; 0061 QColor baseTextColor; 0062 QColor hoveredTextColor; 0063 QPen hoveredBorderPen; 0064 QBrush hoveredFillBrush; 0065 QString file; 0066 QSvgRenderer* sharedRenderer; 0067 int horizontalOffset; 0068 QList<PopupDropperItem*> pdiItems; 0069 int overlayLevel; 0070 bool entered; 0071 QMap<QAction*, PopupDropperPrivate*> submenuMap; 0072 bool submenu; 0073 QList<QGraphicsItem*> allItems; 0074 bool quitOnDragLeave; 0075 bool onTop; 0076 QRectF widgetRect; 0077 0078 //queuedHide: To prevent multiple hide() from being sent if it's already being hidden 0079 bool queuedHide; 0080 0081 void dragLeft(); 0082 void dragEntered(); 0083 void startDeleteTimer(); 0084 0085 void reposItems(); 0086 bool amIOnTop( PopupDropperView* pdv ); 0087 0088 public Q_SLOTS: 0089 void fadeHideTimerFrameChanged( int frame ); 0090 void fadeShowTimerFrameChanged( int frame ); 0091 void fadeShowTimerFinished(); 0092 void fadeHideTimerFinished(); 0093 void deleteTimerFinished(); 0094 0095 private: 0096 PopupDropper* q; 0097 }; 0098 0099 #endif //POPUPDROPPER_P_H