From bf76bfd2a734ecd5b367ada939b4847cacb33725 Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Wed, 8 Aug 2007 11:26:23 +0000 Subject: [PATCH] some new methods defined --- .../notification/NotificationService.java | 76 ++++++++++++++++++- 1 file changed, 73 insertions(+), 3 deletions(-) diff --git a/src/net/java/sip/communicator/service/notification/NotificationService.java b/src/net/java/sip/communicator/service/notification/NotificationService.java index 7edf1f7f1..49f7ebbcb 100644 --- a/src/net/java/sip/communicator/service/notification/NotificationService.java +++ b/src/net/java/sip/communicator/service/notification/NotificationService.java @@ -18,13 +18,39 @@ * @todo write an example once we have completed the definition of the service. * * @author Emil Ivov + * @author Yana Stamcheva */ public interface NotificationService { /** - * Registers the the specified actionDescriptor as a notification - * that should be used every time an event with the specified - * eventType has occurred. + * The log message action type indicates that a message would be logged, + * when a notification is fired. + */ + public static final String ACTION_LOG_MESSAGE = "LogMessageAction"; + + /** + * The popup message action type indicates that a window (or a systray + * popup), containing the corresponding notification message would be poped + * up, when a notification is fired. + */ + public static final String ACTION_POPUP_MESSAGE = "PopupMessageAction"; + + /** + * The sound action type indicates that a sound would be played, when a + * notification is fired. + */ + public static final String ACTION_SOUND = "SoundAction"; + + /** + * The command action type indicates that a command would be executed, + * when a notification is fired. + */ + public static final String ACTION_COMMAND = "CommandAction"; + + /** + * Registers the specified actionDescriptor as a notification that + * should be used every time an event with the specified eventType + * has occurred. *

* The method allows registering more than one actionType for a specific * event. Setting twice the same actionType for the same @@ -45,6 +71,28 @@ public void registerEventNotification(String eventType, String actionType, String actionDescriptor, String defaultMessage); + + /** + * Removes the given eventType from the list of event notifications. + * This means that we delete here all registered notifications for the given + * eventType. + * + * @param eventType the name of the event (as defined by the plugin that's + * registering it) to be removed. + */ + public void removeEventNotification(String eventType); + + /** + * Removes the event notification corresponding to the specified + * actionType and eventType. + * + * @param eventType the name of the event (as defined by the plugin that's + * registering it) for which we'll remove the notification. + * @param actionType the type of the action that is to be executed when the + * specified event occurs (could be one of the ACTION_XXX fields). + */ + public void removeEventNotificationAction( String eventType, + String actionType); /** * Returns a Map containing all action types (as keys) and actionDescriptors @@ -113,4 +161,26 @@ public String getEventNotificationActionDescriptor(String eventType, * notification for. */ public void fireNotification(String eventType); + + /** + * Activates or desactivates all notification actions related to the + * specified eventType. + * + * @param eventType the name of the event, which actions should be activated + * /desactivated. + * @param isActive indicates whether to activate or desactivate the actions + * related to the specified eventType. + */ + public void setActive(String eventType, boolean isActive); + + /** + * Indicates whether or not actions for the specified eventType + * are activated. + * + * @param eventType the name of the event (as defined by the plugin that's + * registered it) that we are checking. + * @return true if actions for the specified eventType + * are activated, false - otherwise. + */ + public boolean isActive(String eventType); }