using MaterialDesignThemes.Wpf; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Media; using Tango.Core.Commands; using Tango.SharedUI; namespace Tango.FSE.Common.Notifications { /// /// Represents the PPC user notification provider responsible for displaying information, alerts and dialogs to the user. /// public interface INotificationProvider : INotifyApplicationReady { /// /// Gets the collection of notification items. /// ObservableCollection NotificationItems { get; } /// /// Gets the collection of snack bar items. /// ObservableCollection SnackbarItems { get; } /// /// Gets or sets a value indicating whether this instance has snack bar items. /// bool HasSnackbarItems { get; } /// /// Gets or sets a value indicating whether to delay the snackbar items closing timeout. /// bool HoldSnackbarItemsTimeout { get; set; } /// /// Gets the notification items view. /// ICollectionView NotificationItemsView { get; } /// /// Gets the collection of task items. /// ObservableCollection TaskItems { get; } /// /// Gets a value indicating whether there are any task items pending. /// bool HasTaskItems { get; } /// /// Gets the current application bar item. /// AppBarItem CurrentAppBarItem { get; } /// /// Gets a value indicating whether this instance has application bar item. /// bool HasAppBarItem { get; } /// /// Gets a value indicating whether this instance has notification items. /// bool HasNotificationItems { get; } /// /// Gets the current message box. /// MessageBoxVM CurrentMessageBox { get; } /// /// Gets a value indicating whether this instance has message box. /// bool HasMessageBox { get; } /// /// Gets the current input box. /// InputBoxVM CurrentInputBox { get; } /// /// Gets a value indicating whether this instance has input box. /// bool HasInputBox { get; } /// /// Gets the current dialog. /// FrameworkElement CurrentDialog { get; } /// /// Gets the current app button. /// AppButton CurrentAppButton { get; } /// /// Gets a value indicating whether this instance has a dialog. /// bool HasDialog { get; } /// /// Shows an information message box. /// /// The message. Task ShowInfo(String message); /// /// Shows warning message box. /// /// The message. Task ShowWarning(String message); /// /// Shows an error message box. /// /// The message. Task ShowError(String message); /// /// Shows a success message box. /// /// The message. Task ShowSuccess(String message); /// /// Shows an input box. /// /// The title. /// The message. /// The icon. /// The default input. /// The input hint. /// The ok text. /// The cancel text. /// Task ShowInputBox(String title, String message, PackIconKind icon = PackIconKind.InfoOutline, String defaultInput = null, String inputHint = null, int? maxChars = null, String okText = null, String cancelText = null, Func validationFunc = null); /// /// Shows a question message box. /// /// The message. Task ShowQuestion(String message, String okText = null, String cancelText = null); /// /// Shows a warning question message box. /// /// The message. Task ShowWarningQuestion(String message, String okText = null, String cancelText = null); /// /// Inserts the notification item to the bottom of the notifications collection. /// /// The item. NotificationItem PushNotification(NotificationItem item); /// /// Pushes the notification. /// /// /// NotificationItem PushNotification() where T : NotificationItem; /// /// Displays the specified dialog in a modal design. /// /// /// The data context. /// The view. /// Task ShowDialog(VM datacontext, FrameworkElement view) where VM : DialogViewVM; /// /// Displays the specified dialog in a modal design. /// The notification provider will try to locate the view automatically using conventions. /// /// /// The data context. /// Task ShowDialog(VM datacontext) where VM : DialogViewVM; /// /// Displays the specified dialog in a modal design. /// The data context instance will be automatically created. /// The notification provider will try to locate the view automatically using conventions. /// /// /// Task ShowDialog() where VM : DialogViewVM; /// /// Removed the specified notification item. /// /// The item. void PopNotification(NotificationItem item); /// /// Gets a value indicating whether this instance is in global busy state. /// bool IsInGlobalBusyState { get; } /// /// Sets the global busy message. /// /// The message. void SetGlobalBusyMessage(String message); /// /// Releases the global busy message. /// void ReleaseGlobalBusyMessage(); /// /// Gets the current global busy message. /// String GlobalBusyMessage { get; } /// /// Pushes the application bar item. /// /// The application bar item. /// AppBarItem PushAppBarItem(AppBarItem appBarItem); /// /// Pushes the application bar item. /// /// /// AppBarItem PushAppBarItem() where T : AppBarItem; /// /// Pops the application bar item. /// /// The application bar item. void PopAppBarItem(AppBarItem appBarItem); /// /// Pushes the task item. /// /// The task bar item. /// TaskItem PushTaskItem(TaskItem taskBarItem); /// /// Pushes the task item. /// /// /// TaskItem PushTaskItem() where T : TaskItem; /// /// Pushes the task item with the specified message. /// /// The message. /// Indicates whether the cancel button will be enabled. /// Specify the action to execute when cancel button is pressed. /// TaskItem PushTaskItem(String message, bool canCancel = false, Action cancelAction = null); /// /// Pops the task item. /// /// The task bar item. void PopTaskItem(TaskItem taskBarItem); /// /// Pushes the snack bar item. /// /// The snack bar item. /// SnackbarItem PushSnackbarItem(SnackbarItem snackbarItem); /// /// Pushes the snack bar item. /// /// The type. /// The title. /// if set to true [can close]. /// The message. /// The timeout. /// The close action. /// The press action. /// SnackbarItem PushSnackbarItem(MessageType type, String title, bool canClose, String message = null, TimeSpan? timeout = null, Action closeAction = null, Action pressAction = null); /// /// Display a new error SnackBar. Pressing the snack bar will display the issue reporting dialog. /// /// The exception. /// The title. /// The message. /// The message type. /// SnackbarItem PushErrorReportingSnackbar(Exception exception, String title, String message, MessageType messageType = MessageType.BugReport); /// /// Displays a indeterminate progress Snackbar. Should use and . /// /// The title. /// The message. /// SnackbarItem PushProgressSnackbar(String title, String message); /// /// Pops the snack bar item. /// /// The snack bar item. void PopSnackbarItem(SnackbarItem snackbarItem); /// /// Gets or sets a value indicating whether to allow notifications visibility. /// bool NotificationsVisible { get; set; } /// /// Pushes the app button. /// /// The app button. void PushAppButton(AppButton appButton); /// /// Pops the app button. /// /// The app button. void PopAppButton(AppButton appButton); } }