michael@0: /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** michael@0: * The nsIMarkupDocumentViewer michael@0: * This interface describes the properties of a content viewer michael@0: * for a markup document - HTML or XML michael@0: */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIDOMNode; michael@0: michael@0: %{C++ michael@0: template class nsCOMPtr; michael@0: template class nsTArray; michael@0: %} michael@0: michael@0: interface nsIMarkupDocumentViewer; michael@0: michael@0: [ref] native nsIMarkupDocumentViewerTArray(nsTArray >); michael@0: michael@0: [scriptable, uuid(7aea9561-5346-401c-b40e-418688da2d0d)] michael@0: interface nsIMarkupDocumentViewer : nsISupports michael@0: { michael@0: michael@0: /* michael@0: Scrolls to a given DOM content node. michael@0: */ michael@0: void scrollToNode(in nsIDOMNode node); michael@0: michael@0: /** The amount by which to scale all text. Default is 1.0. */ michael@0: attribute float textZoom; michael@0: michael@0: /** The amount by which to scale all lengths. Default is 1.0. */ michael@0: attribute float fullZoom; michael@0: michael@0: /** Disable entire author style level (including HTML presentation hints) */ michael@0: attribute boolean authorStyleDisabled; michael@0: michael@0: /** michael@0: * XXX comm-central only: bug 829543. Not the Character Encoding menu in michael@0: * browser! michael@0: */ michael@0: attribute ACString forceCharacterSet; michael@0: michael@0: /** michael@0: * XXX comm-central only: bug 829543. michael@0: */ michael@0: attribute ACString hintCharacterSet; michael@0: michael@0: /** michael@0: * XXX comm-central only: bug 829543. michael@0: */ michael@0: attribute int32_t hintCharacterSetSource; michael@0: michael@0: //void GetCharacterSetHint(in wstring hintCharset, in int32_t charsetSource); michael@0: michael@0: /** michael@0: * Requests the size of the content to the container. michael@0: */ michael@0: void getContentSize(out long width, out long height); michael@0: michael@0: /** The minimum font size */ michael@0: attribute long minFontSize; michael@0: michael@0: /** michael@0: * Append |this| and all of its descendants to the given array, michael@0: * in depth-first pre-order traversal. michael@0: */ michael@0: [noscript] void appendSubtree(in nsIMarkupDocumentViewerTArray array); michael@0: michael@0: /** michael@0: * Set the maximum line width for the document. michael@0: * NOTE: This will generate a reflow! michael@0: * michael@0: * @param maxLineWidth The maximum width of any line boxes on the page, michael@0: * in CSS pixels. michael@0: */ michael@0: void changeMaxLineBoxWidth(in int32_t maxLineBoxWidth); michael@0: michael@0: /** michael@0: * Instruct the refresh driver to discontinue painting until further michael@0: * notice. michael@0: */ michael@0: void pausePainting(); michael@0: michael@0: /** michael@0: * Instruct the refresh driver to resume painting after a previous call to michael@0: * pausePainting(). michael@0: */ michael@0: void resumePainting(); michael@0: michael@0: /* michael@0: * Render the document as if being viewed on a device with the specified michael@0: * media type. This will cause a reflow. michael@0: * michael@0: * @param mediaType The media type to be emulated michael@0: */ michael@0: void emulateMedium(in AString aMediaType); michael@0: michael@0: /* michael@0: * Restore the viewer's natural media type michael@0: */ michael@0: void stopEmulatingMedium(); michael@0: };