itom 2.2.1
K:/git-itom/sources/itom/itomWidgets/basePopupWidget_p.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2016, Institut fuer Technische Optik (ITO),
00005     Universitaet Stuttgart, Germany
00006 
00007     This file is part of itom and its software development toolkit (SDK).
00008 
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013    
00014     In addition, as a special exception, the Institut fuer Technische
00015     Optik (ITO) gives you certain additional rights.
00016     These rights are described in the ITO LGPL Exception version 1.0,
00017     which can be found in the file LGPL_EXCEPTION.txt in this package.
00018 
00019     itom is distributed in the hope that it will be useful, but
00020     WITHOUT ANY WARRANTY; without even the implied warranty of
00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00022     General Public Licence for more details.
00023 
00024     You should have received a copy of the GNU Library General Public License
00025     along with itom. If not, see <http://www.gnu.org/licenses/>.
00026 
00027     This file is a port and modified version of the 
00028     CTK Common Toolkit (http://www.commontk.org)
00029 *********************************************************************** */
00030 
00031 #ifndef BASEPOPUPWIDGET_P_H
00032 #define BASEPOPUPWIDGET_P_H
00033 
00034 // Qt includes
00035 #include <QPointer>
00036 class QLabel;
00037 class QPropertyAnimation;
00038 
00039 // CTK includes
00040 #include "basePopupWidget.h"
00041 
00042 // -------------------------------------------------------------------------
00044 class ITOMWIDGETS_EXPORT BasePopupWidgetPrivate
00045   : public QObject
00046 {
00047   Q_OBJECT
00048   Q_DECLARE_PUBLIC(BasePopupWidget);
00049 protected:
00050   BasePopupWidget* const q_ptr;
00051 public:
00052   BasePopupWidgetPrivate(BasePopupWidget& object);
00053   ~BasePopupWidgetPrivate();
00054   virtual void init();
00055 
00056   bool isOpening()const;
00057   bool isClosing()const;
00061   bool wasClosing()const;
00062 
00063   bool fitBaseWidgetSize()const;
00064   Qt::Alignment pixmapAlignment()const;
00065   void setupPopupPixmapWidget();
00066 
00067   QWidgetList focusWidgets(bool onlyVisible = false)const;
00068 
00069   // Return the widget if the mouse cursor is above any of the focus widgets or their
00070   // children.
00071   virtual QWidget* mouseOver();
00072 
00073   // Same as QWidget::isAncestorOf() but don't restrain to the same window
00074   // and apply it to all the focusWidgets
00075   bool isAncestorOf(const QWidget* ancestor, const QWidget* child)const;
00076 
00077 
00079   QRect closedGeometry()const;
00081   QRect closedGeometry(QRect openGeom)const;
00082   
00085   QRect desiredOpenGeometry()const;
00086   QRect desiredOpenGeometry(QRect baseGeometry)const;
00087   QRect baseGeometry()const;
00088   QPoint mapToGlobal(const QPoint& baseWidgetPoint)const;
00089   
00090   QPropertyAnimation* currentAnimation()const;
00091 
00092   //void temporarilyHiddenOn();
00093   //void temporarilyHiddenOff();
00094 
00095   void hideAll();
00096 
00097 protected:
00098   QPointer<QWidget> BaseWidget;
00099 
00100   double EffectAlpha;
00101 
00102   BasePopupWidget::AnimationEffect Effect;
00103   int                 EffectDuration;
00104   QPropertyAnimation* AlphaAnimation;
00105   bool                ForcedTranslucent;
00106   QPropertyAnimation* ScrollAnimation;
00107   QLabel*             PopupPixmapWidget;
00108   
00109   // Geometry attributes
00110   Qt::Alignment    Alignment;
00111   Qt::Orientations Orientations;
00112 
00113   BasePopupWidget::VerticalDirection VerticalDirection;
00114   Qt::LayoutDirection HorizontalDirection;
00115 };
00116 
00117 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Friends