layout/generic/nsIPageSequenceFrame.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/generic/nsIPageSequenceFrame.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,62 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +#ifndef nsIPageSequenceFrame_h___
     1.9 +#define nsIPageSequenceFrame_h___
    1.10 +
    1.11 +#include "nsQueryFrame.h"
    1.12 +#include "nsCoord.h"
    1.13 +
    1.14 +class nsPresContext;
    1.15 +class nsIPrintSettings;
    1.16 +class nsITimerCallback;
    1.17 +
    1.18 +/**
    1.19 + * Interface for accessing special capabilities of the page sequence frame.
    1.20 + *
    1.21 + * Today all that exists are member functions for printing.
    1.22 + */
    1.23 +class nsIPageSequenceFrame : public nsQueryFrame
    1.24 +{
    1.25 +public:
    1.26 +  NS_DECL_QUERYFRAME_TARGET(nsIPageSequenceFrame)
    1.27 +
    1.28 +  /**
    1.29 +   * Print the set of pages.
    1.30 +   *
    1.31 +   * @param   aPrintOptions options for printing
    1.32 +   * @param   aStatusCallback interface that the client provides to receive
    1.33 +   *            progress notifications. Can be nullptr
    1.34 +   * @return  NS_OK if successful
    1.35 +   *          NS_ERROR_ABORT if the client cancels printing using the callback
    1.36 +   *            interface
    1.37 +   *          NS_ERROR_INVALID_ARG if printing a range of pages (not all pages)
    1.38 +   *            and the start page is greater than the total number of pages
    1.39 +   *          NS_ERROR_FAILURE if there is an error
    1.40 +   */
    1.41 +  NS_IMETHOD StartPrint(nsPresContext*    aPresContext,
    1.42 +                        nsIPrintSettings* aPrintOptions,
    1.43 +                        const nsAString&  aDocTitle,
    1.44 +                        const nsAString&  aDocURL) = 0;
    1.45 +
    1.46 +  NS_IMETHOD PrePrintNextPage(nsITimerCallback* aCallback, bool* aDone) = 0;
    1.47 +  NS_IMETHOD PrintNextPage() = 0;
    1.48 +  NS_IMETHOD ResetPrintCanvasList() = 0;
    1.49 +  NS_IMETHOD GetCurrentPageNum(int32_t* aPageNum) = 0;
    1.50 +  NS_IMETHOD GetNumPages(int32_t* aNumPages) = 0;
    1.51 +  NS_IMETHOD IsDoingPrintRange(bool* aDoing) = 0;
    1.52 +  NS_IMETHOD GetPrintRange(int32_t* aFromPage, int32_t* aToPage) = 0;
    1.53 +
    1.54 +  NS_IMETHOD DoPageEnd() = 0;
    1.55 +  NS_IMETHOD SetSelectionHeight(nscoord aYOffset, nscoord aHeight) = 0;
    1.56 +
    1.57 +  NS_IMETHOD SetTotalNumPages(int32_t aTotal) = 0;
    1.58 +
    1.59 +  // For Shrink To Fit
    1.60 +  NS_IMETHOD GetSTFPercent(float& aSTFPercent) = 0;
    1.61 +};
    1.62 +
    1.63 +#endif /* nsIPageSequenceFrame_h___ */
    1.64 +
    1.65 +

mercurial