NotificationManager - Менеджер уведомлений
================================================

.. currentmodule:: axioma.core

.. class:: NotificationManager

	Менеджер уведомлений

	Унаследован от: :class:`~PyQt5.QtCore.QObject`

	Использовать класс можно, получив глобальный экземпляр из базового \
	сервисного класса :meth:`Core.notificationManager`, либо \
	пользуясь статическим методом :meth:`~axioma.core.NotificationManager.staticPush`

		.. code-block:: python

			from axioma.core import *

			notification_manager = axioma.app.core.notificationManager()
			notification = Notification('Заголовок', 'Текст сообщения')
			notification_manager.push(notification)

		или

		.. code-block:: python

			notification = Notification('Заголовок', 'Текст сообщения')
			NotificationManager.staticPush(notification)

		или

		.. code-block:: python

			NotificationManager.staticPush('Заголовок', 'Текст сообщения')

		.. method:: push(notification)

			Добавить уведомление

			:param notification: уведомление
			:type notification: :class:`~axioma.core.Notification`

		.. staticmethod:: staticPush(notification)

			Добавить уведомление

			:param notification: уведомление
			:type notification: :class:`~axioma.core.Notification`

		.. staticmethod:: staticPush(title, text, role=Notification.NR_Information, duration=2000)

			Добавить уведомление

			:param title: Заголовок
			:type title: :class:`str`
			:param text: Текст уведомления
			:type text: :class:`str`
			:param role: тип
			:type role: :class:`~axioma.core.Notification.Role`
			:param duration: продолжительность в миллисекундах
			:type duration: :class:`int`

		.. method:: notify(notification)

			[signal] Новое уведомление

			.. code-block:: python
				:caption: Пример подписки на сигнал

				from axioma.core import *

				# Классическое для PyQt5 использование сигналов
				# Текст полученого уведомления печатается в консоль
				nm = axioma.app.core.notificationManager()
				nm.notify.connect(lambda n: print('Уведомление: ' + n.text))

			:param notification: поступившее уведомление
			:type notification: :class:`~axioma.core.Notification`
