/* ***** BEGIN LICENSE BLOCK *****
 * Version: GPL 3.0
 *
 * The contents of this file are subject to the General Public License
 * 3.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.gnu.org/licenses/gpl.html
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * Author: Michel Verbraak (info@1st-setup.nl)
 * Website: http://www.1st-setup.nl/
 * email: info@1st-setup.nl
 *
 * This interface can be used to for updates
 *
 * ***** BEGIN LICENSE BLOCK *****/

#include "mivExchangeBaseItem.idl"

interface mivIxml2jxon;

[scriptable, uuid(95dac4fd-58c7-44f9-80ad-1448558fc460)]
interface mivExchangeTodo : mivExchangeBaseItem
{
// calITodo start.

	const long CAL_TODO_STATUS_NEEDSACTION = 4;
	const long CAL_TODO_STATUS_COMPLETED = 5;
	const long CAL_TODO_STATUS_INPROCESS = 6;

	// as per the rather broken RFC2445,

	// entryDate maps to DTSTART, which is the day
	// this todo shows up on, if set. (optional).
	//
	// dueDate maps to DUE, which is the day
	// this todo is due, if set. (optional).
	//
	// If neither DUE nor DTSTART are set, then
	// the todo appears "today" until it is completed.
	//
	// The completeDate is the date the todo was completed,
	// or null if it hasn't been completed yet.

	attribute calIDateTime entryDate;
	attribute calIDateTime dueDate;
	attribute calIDateTime completedDate;
	attribute short percentComplete;

	// A todo isCompleted if any of the following is true:
	// - percentComplete is 100, or
	// - completedDate is non-null, or
	// - status is COMPLETED.
	// Setting isCompleted to true will
	// - set percentComplete to 100, and
	// - set completedDate to the current time, if it is not already set, and
	// - set status to COMPLETED.
	// Setting isCompleted to false will remove percentComplete, completedDate,
	// and status properties.  (This returns the todo to its state at creation,
	// in terms of completion-relevant properties.)
	//
	// If you would like to take advantage of the full, confusing disaster that
	// is the RFC2445 VTODO status state space, you can feel free to set the
	// fields individually, instead of setting isCompleted directly.  (And then
	// hope that whatever else you're talking to has the same set of rules for
	// determining if something is completed or not.)
	//
	// Setting percentComplete, completedDate, or status individually does not
	// affect any of the others at present.  (E.g., setting the percentComplete
	// from 100 to 50 doesn't clear completedDate, or change status to
	// IN-PROCESS.)  It's not clear that we want any more magic than a simple
	// property to control "all complete" vs "not complete in any way".
	attribute boolean isCompleted;

	/**
	* The duration of the todo, which is either set or defined as
	* dueDate - entryDate.
	* Please note that null is returned if there is no duration set and entry
	* Date or dueDate don't exist.
	*/
	attribute calIDuration duration;

// calITodo end.

	readonly attribute AUTF8String owner;

	// totalWork is in minutes
	attribute long totalWork;
	// actualwork is in minutes
	attribute long actualWork;
	attribute AUTF8String mileage;
	attribute AUTF8String billingInformation;
	attribute AUTF8String companies;
	void getCompanies(out uint32_t count, [array, size_is(count), retval] out wstring aCompanies);
	void addCompany(in AUTF8String aCompany);
	void clearCompanies();

};
