/* * nsVanadielTimer.idl * * Copyright (c) 2005, 2006 by Daniel Potter. All rights reserved. * * This file is part of the Vana'diel Clock. * * The Vana'diel Clock is free software; you can redistribute * it and/or modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * The Vana'diel Clock is distributed in the hope that it will * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with the Vana'diel Clock; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA * * Describes the XPCOM interface for the Vana'diel clock service. */ #include "nsISupports.idl" [scriptable, uuid(e8513bde-bad9-4172-a67f-8de617a55a55)] interface nsIVanadielTimerListener : nsISupports { /** * Indicates that a new tick of the Vana'diel clock has occured. * @param year * @param month * @param day * @param weekday * @param hour * @param minute * @param resync true if this event was caused by a resync, meaning * all data should be refereshed */ void vanadielTicked( in PRUint32 year, in PRUint32 month, in PRUint32 day, in PRUint32 weekday, in PRUint32 hour, in PRUint32 minute, in boolean resync ); }; [scriptable, uuid(e8513bde-bad9-4172-a67f-8de617a55a54)] interface nsIVanadielTimer : nsISupports { /** * Starts the Vana'diel clock. */ void start( ); /** * Stops the Vana'diel clock, allowing it to be used in test mode. */ void stop( ); /** * Resets the offset from the start of the era to the current time. * This may be necessary after timezone changes. */ void reset( ); /** * Sets the clock to the given time, assuming the clock currently * is inactive. The various attributes will be set to the correct time. */ void test( in PRUint64 time ); /** * Gets the Vana'diel date (year, month, day of month, day of week) */ void getVanadielDate( out PRUint32 year, out PRUint32 month, out PRUint32 day, out PRUint32 dayWeek ); /** * Gets the Vana'diel time (hour, minute) */ void getVanadielTime( out PRUint32 hour, out PRUint32 minute ); /** * Adds a callback to be notified when the Vana'diel time changes. */ void addVanadielClockListener( in nsIVanadielTimerListener listener ); /** * Removes an existing listener. */ void removeVanadielClockListener( in nsIVanadielTimerListener listener ); /** * Sets the offset in milliseconds from the computer time to "real" time. */ void setRealTimeOffset( in PRInt32 offset ); readonly attribute boolean active; readonly attribute PRUint64 vanadielOffset; readonly attribute PRUint32 year; readonly attribute PRUint32 month; readonly attribute PRUint32 day; readonly attribute PRUint32 weekday; readonly attribute PRUint32 hour; readonly attribute PRUint32 minute; /** * Current offset in Vana'diel seconds from the start of the epoch. */ readonly attribute PRUint64 time; /** * Exact moon phase, 0-83. */ readonly attribute PRUint32 moonPhase; /** * Same thing as moonPhase, except as a percent from 0-100. */ readonly attribute PRUint32 moonPercent; /** * Basic moon phase, basically moonPhase / 7. */ readonly attribute PRUint32 basicMoonPhase; /** * True if the moon is currently waxing. */ readonly attribute boolean moonPhaseWaxing; /** * The number of days elapsed since the start of the epoch. */ readonly attribute PRUint32 epochDays; /** * The current real time offset being used. Use * setRealTimeOffset to change this offset. Such a change will * immediately take place. */ readonly attribute PRInt32 realTimeOffset; };