itom  4.1.0
basePopupWidget_p.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom and its software development toolkit (SDK).
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  In addition, as a special exception, the Institut fuer Technische
15  Optik (ITO) gives you certain additional rights.
16  These rights are described in the ITO LGPL Exception version 1.0,
17  which can be found in the file LGPL_EXCEPTION.txt in this package.
18 
19  itom is distributed in the hope that it will be useful, but
20  WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22  General Public Licence for more details.
23 
24  You should have received a copy of the GNU Library General Public License
25  along with itom. If not, see <http://www.gnu.org/licenses/>.
26 
27  This file is a port and modified version of the
28  CTK Common Toolkit (http://www.commontk.org)
29 *********************************************************************** */
30 
31 #ifndef BASEPOPUPWIDGET_P_H
32 #define BASEPOPUPWIDGET_P_H
33 
34 // Qt includes
35 #include <QPointer>
36 class QLabel;
37 class QPropertyAnimation;
38 
39 // CTK includes
40 #include "basePopupWidget.h"
41 
42 // -------------------------------------------------------------------------
44 class ITOMWIDGETS_EXPORT BasePopupWidgetPrivate
45  : public QObject
46 {
47  Q_OBJECT
48  Q_DECLARE_PUBLIC(BasePopupWidget);
49 protected:
50  BasePopupWidget* const q_ptr;
51 public:
54  virtual void init();
55 
56  bool isOpening()const;
57  bool isClosing()const;
61  bool wasClosing()const;
62 
63  bool fitBaseWidgetSize()const;
64  Qt::Alignment pixmapAlignment()const;
65  void setupPopupPixmapWidget();
66 
67  QWidgetList focusWidgets(bool onlyVisible = false)const;
68 
69  // Return the widget if the mouse cursor is above any of the focus widgets or their
70  // children.
71  virtual QWidget* mouseOver();
72 
73  // Same as QWidget::isAncestorOf() but don't restrain to the same window
74  // and apply it to all the focusWidgets
75  bool isAncestorOf(const QWidget* ancestor, const QWidget* child)const;
76 
77 
79  QRect closedGeometry()const;
81  QRect closedGeometry(QRect openGeom)const;
82 
85  QRect desiredOpenGeometry()const;
86  QRect desiredOpenGeometry(QRect baseGeometry)const;
87  QRect baseGeometry()const;
88  QPoint mapToGlobal(const QPoint& baseWidgetPoint)const;
89 
90  QPropertyAnimation* currentAnimation()const;
91 
92  //void temporarilyHiddenOn();
93  //void temporarilyHiddenOff();
94 
95  void hideAll();
96 
97 protected:
98  QPointer<QWidget> BaseWidget;
99 
100  double EffectAlpha;
101 
102  BasePopupWidget::AnimationEffect Effect;
103  int EffectDuration;
104  QPropertyAnimation* AlphaAnimation;
105  bool ForcedTranslucent;
106  QPropertyAnimation* ScrollAnimation;
107  QLabel* PopupPixmapWidget;
108 
109  // Geometry attributes
110  Qt::Alignment Alignment;
111  Qt::Orientations Orientations;
112 
113  BasePopupWidget::VerticalDirection VerticalDirection;
114  Qt::LayoutDirection HorizontalDirection;
115 };
116 
117 #endif
Definition: basePopupWidget.h:45
Definition: basePopupWidget_p.h:44