1 // Copyright (C) 2007-2018 CEA/DEN, EDF R&D, 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
29 #include <QAbstractAnimation>
33 class QtxNotify : public QObject
45 Q_ENUM(PlacementPolicy)
48 QtxNotify(QObject* = 0);
49 QtxNotify(QWidget*, QObject* = 0);
52 int showNotification(const QString&, const QString&, int timeout = -1);
53 void hideNotification(const QString& = QString());
54 void hideNotification(const int);
56 QWidget* window() const;
57 void setWindow(QWidget* window);
59 double notificationSize() const;
60 void setNotificationSize(const double);
62 int animationTime() const;
63 void setAnimationTime(const int);
65 PlacementPolicy placementPolicy() const;
66 void setPlacementPolicy(const PlacementPolicy&);
68 int alignment() const;
69 void setAlignment(const int);
71 virtual bool eventFilter(QObject*, QEvent*);
74 void onArrangeTimeout();
75 void onAnimationDestroyed(QObject*);
78 void triggerArrange();
79 void updateArrangement();
80 void arrangeNotifications(bool = true);
82 NotifyWidget* notification(const int);
83 NotifyWidget* notification(const QString&);
84 void removeNotification(NotifyWidget*);
86 int generateId() const;
88 bool isAnimated() const;
90 bool hasAcitveAnimation() const;
91 void startAnimation(QAbstractAnimation*);
92 void stopAnimation(QAbstractAnimation*);
94 QPoint referencePoint() const;
95 int notificationWidth() const;
98 typedef QList<QtxNotify::NotifyWidget*> NotifyList;
99 typedef QList<QAbstractAnimation*> AnimationList;
104 PlacementPolicy myPlacement;
106 QTimer* myArrangeTimer;
110 AnimationList myAnimations;
112 NotifyList myNotifications;
114 friend class QtxNotify::NotifyWidget;
117 #endif // QTXNOTIFY_H