#include <QtxNotify.h>
Classes | |
class | NotifyWidget |
QtxNotify::NotifyWidget Class represented notification widget. More... | |
Public Types | |
enum | PlacementPolicy { TopToBottom , BottomToTop } |
Public Member Functions | |
Q_ENUM(PlacementPolicy) public | QtxNotify (QWidget *, QObject *=0) |
QtxNotify Class that manages all notification instances. Performs show, hide, placing, etc. More... | |
virtual | ~QtxNotify () |
Destructor. More... | |
int | showNotification (const QString &, const QString &, int timeout=-1) |
Shows the notifications with spectified text, title and automatic close timeout. Notification will be automatically closed after specified timeout in msec. If timeout is zero then automatic closing doesn't performed. More... | |
void | hideNotification (const QString &=QString()) |
Closes the notifications with spectified text. More... | |
void | hideNotification (const int) |
Closes the notifications with spectified identifier. More... | |
QWidget * | window () const |
Gets the reference widget for all notifications. More... | |
void | setWindow (QWidget *window) |
Sets the reference widget for all notifications. More... | |
double | notificationSize () const |
Gets the notification width size of each notification. If size value more than 1 then it will be interpreted as absolute width in pixels. If size value in range between 0 and 1 then notification width will be calculated as relative part of reference window width. More... | |
void | setNotificationSize (const double) |
Sets the notification width size of each notification. More... | |
int | animationTime () const |
Gets the animation time in msec for notification modifications. More... | |
void | setAnimationTime (const int) |
Sets the animation time in msec for notification modifications. If animation time is zero then animation is disabled. More... | |
PlacementPolicy | placementPolicy () const |
Gets the notification placement policy. More... | |
void | setPlacementPolicy (const PlacementPolicy &) |
Sets the notification placement policy. More... | |
int | alignment () const |
Gets the notification placement base point alignment. More... | |
void | setAlignment (const int) |
Sets the notification placement base point alignment. More... | |
virtual bool | eventFilter (QObject *, QEvent *) |
Reimplemented for tracking reference widget size changing and update notification geometries. More... | |
Private Types | |
typedef QList< QtxNotify::NotifyWidget * > | NotifyList |
typedef QList< QAbstractAnimation * > | AnimationList |
Private Slots | |
void | onArrangeTimeout () |
Performs the scheduled delayed notification arrangment. More... | |
void | onAnimationDestroyed (QObject *) |
Invoked when animation is destroyed. Removes the destroyed animation reference from list. More... | |
Private Member Functions | |
void | triggerArrange () |
Schedule delayed notification arrangement. More... | |
void | updateArrangement () |
Performs the notification arrangment with disabled animation. More... | |
void | arrangeNotifications (bool=true) |
Performs the update of all notification geometries. If parameter anim is true then arrangment will be animated otherwise not. More... | |
NotifyWidget * | notification (const int) |
Gets the notification with specified identifier. More... | |
NotifyWidget * | notification (const QString &) |
Gets the notification with specified text. More... | |
void | removeNotification (NotifyWidget *) |
Removes the specified notification. More... | |
int | generateId () const |
Generates the new free notification identifier. More... | |
bool | isAnimated () const |
Gets the animation using state. If it's true then animation will be used during notification modifcations. More... | |
bool | hasAcitveAnimation () const |
Gets the active animation state. If there is exist active animation then return true otherwise false. More... | |
void | startAnimation (QAbstractAnimation *) |
Starts the given animation. More... | |
void | stopAnimation (QAbstractAnimation *) |
Stops the given animation. More... | |
QPoint | referencePoint () const |
int | notificationWidth () const |
Gets the notification window with. More... | |
Private Attributes | |
double | mySize |
QWidget * | myWindow |
PlacementPolicy | myPlacement |
int | myAlignment |
QTimer * | myArrangeTimer |
int | myAnimTime |
bool | myAnimBlock |
AnimationList | myAnimations |
NotifyList | myNotifications |
Friends | |
class | QtxNotify::NotifyWidget |
|
private |
|
private |
QtxNotify Class that manages all notification instances. Performs show, hide, placing, etc.
Constructor.
References myArrangeTimer, onArrangeTimeout(), setWindow(), window(), and Window.
|
virtual |
Destructor.
int QtxNotify::alignment | ( | ) | const |
Gets the notification placement base point alignment.
References myAlignment.
int QtxNotify::animationTime | ( | ) | const |
Gets the animation time in msec for notification modifications.
References myAnimTime.
|
private |
Performs the update of all notification geometries. If parameter anim is true then arrangment will be animated otherwise not.
anim | - use animation |
References alignment(), animationTime(), BottomToTop, isAnimated(), myNotifications, placementPolicy(), referencePoint(), QtxNotify::NotifyWidget::sizeHint(), startAnimation(), and window().
Reimplemented for tracking reference widget size changing and update notification geometries.
o | - handled object |
e | - handled event |
References updateArrangement(), and window().
|
private |
Generates the new free notification identifier.
References myNotifications.
|
private |
Gets the active animation state. If there is exist active animation then return true otherwise false.
References myAnimations.
void QtxNotify::hideNotification | ( | const int | id | ) |
Closes the notifications with spectified identifier.
text | - Notification identifier |
References notification(), and removeNotification().
void QtxNotify::hideNotification | ( | const QString & | text = QString() | ) |
Closes the notifications with spectified text.
text | - Notification text |
References notification(), and removeNotification().
|
private |
Gets the animation using state. If it's true then animation will be used during notification modifcations.
References myAnimTime.
|
private |
Gets the notification with specified identifier.
id | - notification identifier |
References myNotifications.
|
private |
Gets the notification with specified text.
text | - notification text |
References myNotifications.
double QtxNotify::notificationSize | ( | ) | const |
Gets the notification width size of each notification. If size value more than 1 then it will be interpreted as absolute width in pixels. If size value in range between 0 and 1 then notification width will be calculated as relative part of reference window width.
References mySize.
|
private |
Gets the notification window with.
References notificationSize(), and window().
|
privateslot |
Invoked when animation is destroyed. Removes the destroyed animation reference from list.
obj | - destroyed animation reference |
References myAnimations.
|
privateslot |
Performs the scheduled delayed notification arrangment.
References arrangeNotifications(), hasAcitveAnimation(), myAnimBlock, and triggerArrange().
QtxNotify::PlacementPolicy QtxNotify::placementPolicy | ( | ) | const |
Gets the notification placement policy.
References myPlacement.
|
private |
References alignment(), notificationWidth(), and window().
|
private |
Removes the specified notification.
notify | - notification instance |
References animationTime(), arrangeNotifications(), isAnimated(), myNotifications, onArrangeTimeout(), QtxNotify::NotifyWidget::setTimeout(), and startAnimation().
void QtxNotify::setAlignment | ( | const int | flags | ) |
Sets the notification placement base point alignment.
falgs | - alignment flags |
References myAlignment, and updateArrangement().
void QtxNotify::setAnimationTime | ( | const int | time | ) |
Sets the animation time in msec for notification modifications. If animation time is zero then animation is disabled.
time | - animation time |
References myAnimTime.
void QtxNotify::setNotificationSize | ( | const double | size | ) |
Sets the notification width size of each notification.
size | - notification size |
References mySize, and updateArrangement().
void QtxNotify::setPlacementPolicy | ( | const PlacementPolicy & | placement | ) |
Sets the notification placement policy.
placement | - notification placement policy |
References myPlacement, and updateArrangement().
void QtxNotify::setWindow | ( | QWidget * | window | ) |
Sets the reference widget for all notifications.
win | - reference widget |
References myWindow, updateArrangement(), and window().
int QtxNotify::showNotification | ( | const QString & | text, |
const QString & | title, | ||
int | timeout = -1 |
||
) |
Shows the notifications with spectified text, title and automatic close timeout. Notification will be automatically closed after specified timeout in msec. If timeout is zero then automatic closing doesn't performed.
text | - Notification text |
title | - Notification title |
timeout | - Notification close timeout in msec |
References generateId(), QtxNotify::NotifyWidget::id(), myNotifications, notification(), QtxNotify::NotifyWidget::setId(), QtxNotify::NotifyWidget::setTimeout(), QtxNotify::NotifyWidget::setTitle(), triggerArrange(), and window().
|
private |
Starts the given animation.
animation | - animation instance |
References myAnimations, and onAnimationDestroyed().
|
private |
Stops the given animation.
animation | - animation instance |
|
private |
Schedule delayed notification arrangement.
References myArrangeTimer.
|
private |
Performs the notification arrangment with disabled animation.
References myAnimBlock, and triggerArrange().
QWidget * QtxNotify::window | ( | ) | const |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |