1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
31 #include <QAbstractAnimation>
35 class QTX_EXPORT QtxNotify : public QObject
47 Q_ENUM(PlacementPolicy)
50 QtxNotify(QObject* = 0);
51 QtxNotify(QWidget*, QObject* = 0);
54 int showNotification(const QString&, const QString&, int timeout = -1);
55 void hideNotification(const QString& = QString());
56 void hideNotification(const int);
58 QWidget* window() const;
59 void setWindow(QWidget* window);
61 double notificationSize() const;
62 void setNotificationSize(const double);
64 int animationTime() const;
65 void setAnimationTime(const int);
67 PlacementPolicy placementPolicy() const;
68 void setPlacementPolicy(const PlacementPolicy&);
70 int alignment() const;
71 void setAlignment(const int);
73 virtual bool eventFilter(QObject*, QEvent*);
76 void onArrangeTimeout();
77 void onAnimationDestroyed(QObject*);
80 void triggerArrange();
81 void updateArrangement();
82 void arrangeNotifications(bool = true);
84 NotifyWidget* notification(const int);
85 NotifyWidget* notification(const QString&);
86 void removeNotification(NotifyWidget*);
88 int generateId() const;
90 bool isAnimated() const;
92 bool hasAcitveAnimation() const;
93 void startAnimation(QAbstractAnimation*);
94 void stopAnimation(QAbstractAnimation*);
96 QPoint referencePoint() const;
97 int notificationWidth() const;
100 typedef QList<QtxNotify::NotifyWidget*> NotifyList;
101 typedef QList<QAbstractAnimation*> AnimationList;
106 PlacementPolicy myPlacement;
108 QTimer* myArrangeTimer;
112 AnimationList myAnimations;
114 NotifyList myNotifications;
116 friend class QtxNotify::NotifyWidget;
119 #endif // QTXNOTIFY_H