/* * Copyright 2010 by Marco MArtin * Copyright 2008 by Alessandro Diaferia * Copyright 2007 by Alexis Ménard * Copyright 2007 Sebastian Kuegler * Copyright 2006 Aaron Seigo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #ifndef LIBS_PLASMA_DIALOG_P_H #define LIBS_PLASMA_DIALOG_P_H #include "plasma/dialog.h" namespace Plasma { class Applet; class FrameSvg; class DialogPrivate { public: DialogPrivate(Dialog *dialog) : q(dialog), background(0), view(0), resizeCorners(Dialog::NoCorner), resizeStartCorner(Dialog::NoCorner), leftResizeMin(-1), topResizeMin(-1), rightResizeMin(-1), bottomResizeMin(-1), moveTimer(0), aspectRatioMode(Plasma::IgnoreAspectRatio), resizeChecksWithBorderCheck(false) { } ~DialogPrivate() { } void scheduleBorderCheck(bool triggeredByResize = false); void themeChanged(); void updateMask(); void checkBorders(); void checkBorders(bool updateMaskIfNeeded); void updateResizeCorners(); int calculateWidthForHeightAndRatio(int height, qreal ratio); void delayedAdjustSize(); Plasma::Dialog *q; /** * Holds the background SVG, to be re-rendered when the cache is invalidated, * for example by resizing the dialogue. */ Plasma::FrameSvg *background; QGraphicsView *view; QWeakPointer graphicsWidgetPtr; QWeakPointer appletPtr; Dialog::ResizeCorners resizeCorners; QMap resizeAreas; int resizeStartCorner; int leftResizeMin; int topResizeMin; int rightResizeMin; int bottomResizeMin; QTimer *moveTimer; QTimer *adjustViewTimer; QTimer *adjustSizeTimer; QSize oldGraphicsWidgetMinimumSize; QSize oldGraphicsWidgetMaximumSize; Plasma::AspectRatioMode aspectRatioMode; bool resizeChecksWithBorderCheck; }; } #endif