diff --git a/src/net/java/sip/communicator/service/systray/PopupMessageHandler.java b/src/net/java/sip/communicator/service/systray/PopupMessageHandler.java
index 0198a64bf..2aa7df446 100644
--- a/src/net/java/sip/communicator/service/systray/PopupMessageHandler.java
+++ b/src/net/java/sip/communicator/service/systray/PopupMessageHandler.java
@@ -43,6 +43,20 @@ public interface PopupMessageHandler
* @param popupMessage the message to show
*/
public void showPopupMessage(PopupMessage popupMessage);
+
+ /**
+ * Returns a preference index, which indicates how many features the handler
+ * implements. Implementer should calculate preference index by adding "1"
+ * for each of the the following features that the implementation supports:
+ *
+ * 1) showing images
+ * 2) detecting clicks
+ * 3) being able to match a click to a message
+ * 4) using a native popup mechanism
+ *
+ * @returns an integer representing preference index of this popup handler
+ */
+ public int getPreferenceIndex();
/**
* Returns a readable description of this popup handler. It is expected
diff --git a/src/net/java/sip/communicator/service/systray/SystrayService.java b/src/net/java/sip/communicator/service/systray/SystrayService.java
index 7123f2e84..0ebb3e6d0 100644
--- a/src/net/java/sip/communicator/service/systray/SystrayService.java
+++ b/src/net/java/sip/communicator/service/systray/SystrayService.java
@@ -103,4 +103,9 @@ public PopupMessageHandler setActivePopupMessageHandler(
* @param imageType the type of the image to set
*/
public void setSystrayIcon(int imageType);
+
+ /**
+ * Selects the best available popup message handler
+ */
+ public void selectBestPopupMessageHandler();
}
diff --git a/test/net/java/sip/communicator/slick/popupmessagehandler/TestPopupMessageHandler.java b/test/net/java/sip/communicator/slick/popupmessagehandler/TestPopupMessageHandler.java
index 8fb7d3ecf..113f96390 100644
--- a/test/net/java/sip/communicator/slick/popupmessagehandler/TestPopupMessageHandler.java
+++ b/test/net/java/sip/communicator/slick/popupmessagehandler/TestPopupMessageHandler.java
@@ -161,5 +161,13 @@ public void showPopupMessage(PopupMessage popupMsg)
// is it the expected handler which is handling it ?
assertEquals(handler2, this);
}
+
+ /**
+ * implements getPreferenceIndex from PopupMessageHandler
+ */
+ public int getPreferenceIndex()
+ {
+ return 0;
+ }
}
}