-/*****************************************************************************\r
- * Copyright (c) 2007 Intel Corporation, 2010, 2012 Ericsson.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * Intel Corporation - Initial API and implementation\r
- * Ruslan A. Scherbakov, Intel - Initial API and implementation\r
- * Alvaro Sanchez-Leon - Updated for TMF\r
- * Patrick Tasse - Refactoring\r
- *\r
- *****************************************************************************/\r
-\r
-package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets;\r
-\r
-public interface ITimeDataProvider {\r
-\r
- long getSelectedTime();\r
-\r
- long getBeginTime();\r
-\r
- long getEndTime();\r
-\r
- long getMinTime();\r
-\r
- long getMaxTime();\r
-\r
- long getTime0();\r
-\r
- long getTime1();\r
-\r
- long getMinTimeInterval();\r
-\r
- /**\r
- * Updates the time range and notify registered listeners\r
- * \r
- * @param time0\r
- * @param time1\r
- */\r
- void setStartFinishTimeNotify(long time0, long time1);\r
-\r
- /**\r
- * Update the time range but do not trigger event notification\r
- * \r
- * @param time0\r
- * @param time1\r
- */\r
- void setStartFinishTime(long time0, long time1);\r
-\r
- /**\r
- * Notify registered listeners without updating the time range\r
- */\r
- void notifyStartFinishTime();\r
-\r
- /**\r
- * Updates the selected time, adjusts the time range if necessary and notifies\r
- * any registered listeners about the new selected time and new range (if necessary)\r
- * \r
- * @param time - A Time to set\r
- * @param ensureVisible - Ensure visibility of new time (will adjust time range if necessary)\r
- */\r
- public void setSelectedTimeNotify(long time, boolean ensureVisible);\r
- \r
- /**\r
- * Updates the selected time and adjusts the time range if necessary \r
- * without notifying registered listeners.\r
- * \r
- * @param time - A Time to set\r
- * @param ensureVisible - Ensure visibility of new time (will adjust time range if necessary)\r
- */\r
- public void setSelectedTime(long time, boolean ensureVisible);\r
-\r
- void resetStartFinishTime();\r
-\r
- int getNameSpace();\r
-\r
- void setNameSpace(int width);\r
-\r
- int getTimeSpace();\r
-\r
- boolean isCalendarFormat();\r
-}\r
+/*****************************************************************************
+ * Copyright (c) 2007, 2014 Intel Corporation, Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Intel Corporation - Initial API and implementation
+ * Ruslan A. Scherbakov, Intel - Initial API and implementation
+ * Alvaro Sanchez-Leon - Updated for TMF
+ * Geneviève Bastien - Added methods to save a time range selection
+ * Patrick Tasse - Refactoring, support for range selection
+ *****************************************************************************/
+
+package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets;
+
+import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils.TimeFormat;
+
+/**
+ * Time data provider interface, for use in the timegraph widget.
+ *
+ * @version 1.0
+ * @author Alvaro Sanchez-Leon
+ * @author Patrick Tasse
+ * @author Xavier Raynaud
+ */
+public interface ITimeDataProvider {
+
+ /**
+ * Updates the selection begin and end time and notifies any registered
+ * listeners about the new time range (if necessary)
+ *
+ * @param beginTime the selection begin time
+ * @param endTime the selection end time
+ * @since 3.0
+ */
+ void setSelectionRangeNotify(long beginTime, long endTime);
+
+ /**
+ * Updates the selection begin and end time
+ *
+ * @param beginTime the selection begin time
+ * @param endTime the selection end time
+ * @since 3.0
+ */
+ void setSelectionRange(long beginTime, long endTime);
+
+ /**
+ * @return The begin time of the current selection
+ * @since 3.0
+ */
+ long getSelectionBegin();
+
+ /**
+ * @return The end time of the current selection
+ * @since 3.0
+ */
+ long getSelectionEnd();
+
+ /**
+ * @return The beginning time
+ */
+ long getBeginTime();
+
+ /**
+ * @return The end time
+ */
+ long getEndTime();
+
+ /**
+ * @return The minimum time
+ */
+ long getMinTime();
+
+ /**
+ * @return The maximum time
+ */
+ long getMaxTime();
+
+ /**
+ * @return The start time of the current selection window
+ */
+ long getTime0();
+
+ /**
+ * @return The end time of the current selection window
+ */
+ long getTime1();
+
+ /**
+ * @return The minimal time interval
+ */
+ long getMinTimeInterval();
+
+ /**
+ * Updates the time range and notify registered listeners
+ *
+ * @param time0
+ * @param time1
+ */
+ void setStartFinishTimeNotify(long time0, long time1);
+
+ /**
+ * Update the time range but do not trigger event notification
+ *
+ * @param time0
+ * @param time1
+ */
+ void setStartFinishTime(long time0, long time1);
+
+ /**
+ * Notify registered listeners without updating the time range
+ */
+ void notifyStartFinishTime();
+
+ /**
+ * Updates the selected time, adjusts the time range if necessary and
+ * notifies any registered listeners about the new selected time and new
+ * range (if necessary)
+ *
+ * @param time
+ * A Time to set
+ * @param ensureVisible
+ * Ensure visibility of new time (will adjust time range if
+ * necessary)
+ */
+ void setSelectedTimeNotify(long time, boolean ensureVisible);
+
+ /**
+ * Updates the selected time and adjusts the time range if necessary without
+ * notifying registered listeners.
+ *
+ * @param time
+ * A Time to set
+ * @param ensureVisible
+ * Ensure visibility of new time (will adjust time range if
+ * necessary)
+ */
+ void setSelectedTime(long time, boolean ensureVisible);
+
+ /**
+ * Reset the start and end times
+ */
+ void resetStartFinishTime();
+
+ /**
+ * @return The names' width
+ */
+ int getNameSpace();
+
+ /**
+ * Set the names' width
+ *
+ * @param width
+ */
+ void setNameSpace(int width);
+
+ /**
+ * @return The width for timestamps
+ */
+ int getTimeSpace();
+
+ /**
+ * @return the time format, one of:
+ * <ul>
+ * <li>{@link TimeFormat#CALENDAR} absolute time, displayed as year/month/day/hours/minutes/seconds/ms/us/ns
+ * <li>{@link TimeFormat#RELATIVE} relative time, displayed as seconds/ms/us/ns
+ * <li>{@link TimeFormat#NUMBER} number, displayed as long values.
+ * </ul>
+ * @since 2.0
+ */
+ TimeFormat getTimeFormat();
+}