-/*****************************************************************************\r
- * Copyright (c) 2007, 2010 Intel Corporation.\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 Sanchex-Leon - Updated for TMF\r
- *\r
- * $Id: ITimeDataProvider.java,v 1.2 2007/02/27 18:37:36 ewchan Exp $ \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
- void setSelectedTimeInt(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, 2013 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
+ * Patrick Tasse - Refactoring
+ *****************************************************************************/
+
+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 {
+
+ /**
+ * @return The selected time
+ */
+ long getSelectedTime();
+
+ /**
+ * @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)
+ */
+ public 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)
+ */
+ public 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();
+}