calendar/import-export/CalListFormatter.jsm
author Mozilla Releng Treescript <release+treescript@mozilla.org>
Fri, 04 Dec 2020 08:37:30 +0000
changeset 40463 d423ef1cc0b4fc4538dd61954666e9834e475433
parent 39075 18f27bc33168c576676908b2a9cdb34707fb89e2
permissions -rw-r--r--
no bug - Bumping Thunderbird l10n changesets r=release a=l10n-bump DONTBUILD dsb -> 942a2c0fe0699ce193ce923a9c77f11398ccfa96 el -> 15d6b6a9903f7cbd1288a138f7b4ab8c18780fff es-AR -> 73f5fac35fc77d8e9f9b9fca6bd521c4c6595574 fi -> 61c7545e04537476978c4ed76029528311fd9d2d hy-AM -> 690bd531df639506e326c43c6e497cf585326960 id -> 404a32cfdf999fbf54ea2d70ddb35e75c231ca23 it -> e08a2baf4d783f9d8ee55c13206bc7c4e7f890fd kab -> b9bb16be7525ee249bf92b7234aea83a5bd73bd6 nn-NO -> 2129662887fba32664ae72cba482909f935cad13 pa-IN -> b3f55b23d083f1a86d16316c65a18bada839f40f ro -> af6a1e3768ca9d002c05191bbacaeead8ff713a5 tr -> 32f4f52161f47ef9952fe740f912526e9adc389d

/* 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/. */

var EXPORTED_SYMBOLS = ["CalListFormatter"];

var { cal } = ChromeUtils.import("resource:///modules/calendar/calUtils.jsm");

/**
 * A thin wrapper around the html list exporter for the list print format.
 */
function CalListFormatter() {
  this.wrappedJSObject = this;
}

CalListFormatter.prototype = {
  QueryInterface: ChromeUtils.generateQI(["calIPrintFormatter"]),
  classID: Components.ID("{9ae04413-fee3-45b9-8bbb-1eb39a4cbd1b}"),

  get name() {
    return cal.l10n.getCalString("formatListName");
  },

  formatToHtml(aStream, aStart, aEnd, aItems, aTitle) {
    let htmlexporter = Cc["@mozilla.org/calendar/export;1?type=htmllist"].createInstance(
      Ci.calIExporter
    );
    htmlexporter.exportToStream(aStream, aItems, aTitle);
  },
};