"Fossies" - the Fresh Open Source Software Archive

Member "UXP-2019.10.31/docshell/base/nsIContentViewer.idl" (30 Oct 2019, 8965 Bytes) of package /linux/www/UXP-2019.10.31.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) IDL source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 /* This Source Code Form is subject to the terms of the Mozilla Public
    2  * License, v. 2.0. If a copy of the MPL was not distributed with this
    3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    4 
    5 #include "nsISupports.idl"
    6 
    7 interface nsIDocShell;
    8 interface nsIDocument;
    9 interface nsIDOMDocument;
   10 interface nsIDOMNode;
   11 interface nsISHEntry;
   12 interface nsIPrintSettings;
   13 
   14 
   15 %{ C++
   16 #include "nsTArray.h"
   17 #include "nsRect.h"
   18 
   19 class nsIWidget;
   20 class nsIPresShell;
   21 class nsPresContext;
   22 class nsView;
   23 class nsDOMNavigationTiming;
   24 %}
   25 
   26 [ptr] native nsIWidgetPtr(nsIWidget);
   27 [ref] native nsIntRectRef(nsIntRect);
   28 [ptr] native nsIPresShellPtr(nsIPresShell);
   29 [ptr] native nsPresContextPtr(nsPresContext);
   30 [ptr] native nsViewPtr(nsView);
   31 [ptr] native nsDOMNavigationTimingPtr(nsDOMNavigationTiming);
   32 [ref] native nsIContentViewerTArray(nsTArray<nsCOMPtr<nsIContentViewer> >);
   33 
   34 [scriptable, builtinclass, uuid(2da17016-7851-4a45-a7a8-00b360e01595)]
   35 interface nsIContentViewer : nsISupports
   36 {
   37   [noscript] void init(in nsIWidgetPtr aParentWidget,
   38                        [const] in nsIntRectRef aBounds);
   39 
   40   attribute nsIDocShell container;
   41 
   42   [noscript,notxpcom,nostdcall] void loadStart(in nsIDocument aDoc);
   43   void loadComplete(in nsresult aStatus);
   44   [noscript] readonly attribute boolean loadCompleted;
   45 
   46   /**
   47    * Checks if the document wants to prevent unloading by firing beforeunload on
   48    * the document, and if it does, prompts the user. The result is returned.
   49    */
   50   boolean permitUnload();
   51 
   52   /**
   53    * Exposes whether we're blocked in a call to permitUnload.
   54    */
   55   readonly attribute boolean inPermitUnload;
   56 
   57   /**
   58    * As above, but this passes around the aShouldPrompt argument to keep
   59    * track of whether the user has responded to a prompt.
   60    * Used internally by the scriptable version to ensure we only prompt once.
   61    */
   62   [noscript,nostdcall] boolean permitUnloadInternal(inout boolean aShouldPrompt);
   63 
   64   /**
   65    * Exposes whether we're in the process of firing the beforeunload event.
   66    * In this case, the corresponding docshell will not allow navigation.
   67    */
   68   readonly attribute boolean beforeUnloadFiring;
   69 
   70   void pageHide(in boolean isUnload);
   71 
   72   /**
   73    * All users of a content viewer are responsible for calling both
   74    * close() and destroy(), in that order. 
   75    *
   76    * close() should be called when the load of a new page for the next
   77    * content viewer begins, and destroy() should be called when the next
   78    * content viewer replaces this one.
   79    *
   80    * |historyEntry| sets the session history entry for the content viewer.  If
   81    * this is null, then Destroy() will be called on the document by close().
   82    * If it is non-null, the document will not be destroyed, and the following
   83    * actions will happen when destroy() is called (*):
   84    *  - Sanitize() will be called on the viewer's document
   85    *  - The content viewer will set the contentViewer property on the
   86    *    history entry, and release its reference (ownership reversal).
   87    *  - hide() will be called, and no further destruction will happen.
   88    *
   89    *  (*) unless the document is currently being printed, in which case
   90    *      it will never be saved in session history.
   91    *
   92    */
   93   void close(in nsISHEntry historyEntry);
   94   void destroy();
   95 
   96   void stop();
   97 
   98   attribute nsIDOMDocument DOMDocument;
   99 
  100   /**
  101    * Returns DOMDocument as nsIDocument and without addrefing.
  102    */
  103   [noscript,notxpcom] nsIDocument getDocument();
  104 
  105   [noscript] void getBounds(in nsIntRectRef aBounds);
  106   [noscript] void setBounds([const] in nsIntRectRef aBounds);
  107   /**
  108    * The 'aFlags' argument to setBoundsWithFlags is a set of these bits.
  109    */
  110   const unsigned long eDelayResize = 1;
  111   [noscript] void setBoundsWithFlags([const] in nsIntRectRef aBounds,
  112                                      in unsigned long aFlags);
  113 
  114   /**
  115    * The previous content viewer, which has been |close|d but not
  116    * |destroy|ed.
  117    */
  118   [noscript] attribute nsIContentViewer previousViewer;
  119 
  120   void move(in long aX, in long aY);
  121 
  122   void show();
  123   void hide();
  124 
  125   attribute boolean sticky;
  126 
  127   /*
  128    * This is called when the DOM window wants to be closed.  Returns true
  129    * if the window can close immediately.  Otherwise, returns false and will
  130    * close the DOM window as soon as practical.
  131    */
  132 
  133   boolean requestWindowClose();
  134 
  135   /**
  136    * Attach the content viewer to its DOM window and docshell.
  137    * @param aState A state object that might be useful in attaching the DOM
  138    *               window.
  139    * @param aSHEntry The history entry that the content viewer was stored in.
  140    *                 The entry must have the docshells for all of the child
  141    *                 documents stored in its child shell list.
  142    */
  143   void open(in nsISupports aState, in nsISHEntry aSHEntry);
  144 
  145   /**
  146    * Clears the current history entry.  This is used if we need to clear out
  147    * the saved presentation state.
  148    */
  149   void clearHistoryEntry();
  150 
  151   /**
  152    * Change the layout to view the document with page layout (like print preview), but
  153    * dynamic and editable (like Galley layout).
  154    */
  155   void setPageMode(in boolean aPageMode, in nsIPrintSettings aPrintSettings);
  156 
  157   /**
  158    * Get the history entry that this viewer will save itself into when
  159    * destroyed.  Can return null
  160    */
  161   readonly attribute nsISHEntry historyEntry;
  162 
  163   /**
  164    * Indicates when we're in a state where content shouldn't be allowed to
  165    * trigger a tab-modal prompt (as opposed to a window-modal prompt) because
  166    * we're part way through some operation (eg beforeunload) that shouldn't be
  167    * rentrant if the user closes the tab while the prompt is showing.
  168    * See bug 613800.
  169    */
  170   readonly attribute boolean isTabModalPromptAllowed;
  171 
  172   /**
  173    * Returns whether this content viewer is in a hidden state.
  174    *
  175    * @note Only Gecko internal code should set the attribute!
  176    */
  177   attribute boolean isHidden;
  178 
  179   [noscript] readonly attribute nsIPresShellPtr presShell;
  180   [noscript] readonly attribute nsPresContextPtr presContext;
  181   // aDocument must not be null.
  182   [noscript] void setDocumentInternal(in nsIDocument aDocument,
  183                                       in boolean aForceReuseInnerWindow);
  184   /**
  185    * Find the view to use as the container view for MakeWindow. Returns
  186    * null if this will be the root of a view manager hierarchy. In that
  187    * case, if mParentWidget is null then this document should not even
  188    * be displayed.
  189    */
  190   [noscript,notxpcom,nostdcall] nsViewPtr findContainerView();
  191   /**
  192    * Set collector for navigation timing data (load, unload events).
  193    */
  194   [noscript,notxpcom,nostdcall] void setNavigationTiming(in nsDOMNavigationTimingPtr aTiming);
  195   /*
  196   Scrolls to a given DOM content node. 
  197   */
  198   void scrollToNode(in nsIDOMNode node);
  199 
  200   /** The amount by which to scale all text. Default is 1.0. */
  201   attribute float textZoom;
  202 
  203   /** The amount by which to scale all lengths. Default is 1.0. */
  204   attribute float fullZoom;
  205 
  206   /**
  207    * The value used to override devicePixelRatio and media queries dppx.
  208    * Default is 0.0, that means no overriding is done (only a positive value
  209    * is applied).
  210    */
  211   attribute float overrideDPPX;
  212 
  213   /** Disable entire author style level (including HTML presentation hints) */
  214   attribute boolean authorStyleDisabled;
  215 
  216   /**
  217    * XXX comm-central only: bug 829543. Not the Character Encoding menu in
  218    * browser!
  219    */
  220   attribute ACString forceCharacterSet;
  221 
  222   /**
  223    * XXX comm-central only: bug 829543.
  224    */
  225   attribute ACString hintCharacterSet;
  226 
  227   /**
  228    * XXX comm-central only: bug 829543.
  229    */
  230   attribute int32_t hintCharacterSetSource;
  231 
  232   /**
  233    * Requests the size of the content to the container.
  234    */
  235   void getContentSize(out long width, out long height);
  236 
  237   /**
  238    * Returns the preferred width and height of the content, constrained to the
  239    * given maximum values. If either maxWidth or maxHeight is less than zero,
  240    * that dimension is not constrained.
  241    *
  242    * All input and output values are in device pixels, rather than CSS pixels.
  243    */
  244   void getContentSizeConstrained(in long maxWidth, in long maxHeight,
  245                                  out long width, out long height);
  246 
  247   /** The minimum font size  */
  248   attribute long minFontSize;
  249 
  250   /**
  251    * Append |this| and all of its descendants to the given array,
  252    * in depth-first pre-order traversal.
  253    */
  254   [noscript] void appendSubtree(in nsIContentViewerTArray array);
  255 
  256   /**
  257    * Instruct the refresh driver to discontinue painting until further
  258    * notice.
  259    */
  260   void pausePainting();
  261 
  262   /**
  263    * Instruct the refresh driver to resume painting after a previous call to
  264    * pausePainting().
  265    */
  266   void resumePainting();
  267 
  268   /*
  269    * Render the document as if being viewed on a device with the specified
  270    * media type. This will cause a reflow.
  271    *
  272    * @param mediaType The media type to be emulated
  273    */
  274   void emulateMedium(in AString aMediaType);
  275 
  276   /*
  277    * Restore the viewer's natural media type
  278    */
  279   void stopEmulatingMedium();
  280 };