/* -*- Mode: IDL; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#include "nsISupports.idl"

interface calIItemBase;
interface calIDateTime;
interface nsIOutputStream;

[scriptable, uuid(014dea21-90cd-4563-b1bd-13b842a465e0)]
interface calIPrintFormatter : nsISupports
{
  /**
   * The name of this layout. Implementers should make sure this string
   * is localizable, ie uses nsIStringBundle
   */
  readonly attribute AString name;
  
  /**
   * Format the items into the stream, as html code.
   * May assume that all the items are inside the given daterange.
   * The user requested to show all the days in the daterange, so unless
   * there is a special reason, all the days should be shown.
   * aStart and aEnd may be null, in which case the implementation can
   * show the minimal days needed to show all the events. It can skip
   * months without events, for example.
   *
   * @param aStream  the stream to put the html data into
   * @param aStart   the first date that should be printed
   * @param aEnd     the last date that should be printed
   * @param aCount   the number of items being printed
   * @param aItems   the items to print
   * @param aTitle   a title for the HTML page
   */
  void formatToHtml(in nsIOutputStream aStream,
                    in calIDateTime aStart,
                    in calIDateTime aEnd,
                    in unsigned long aCount,
                    [array, size_is(aCount)] in calIItemBase aItems,
                    in AString aTitle);
};
