layout/generic/nsIPageSequenceFrame.h

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:e6b0bc1831d1
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef nsIPageSequenceFrame_h___
6 #define nsIPageSequenceFrame_h___
7
8 #include "nsQueryFrame.h"
9 #include "nsCoord.h"
10
11 class nsPresContext;
12 class nsIPrintSettings;
13 class nsITimerCallback;
14
15 /**
16 * Interface for accessing special capabilities of the page sequence frame.
17 *
18 * Today all that exists are member functions for printing.
19 */
20 class nsIPageSequenceFrame : public nsQueryFrame
21 {
22 public:
23 NS_DECL_QUERYFRAME_TARGET(nsIPageSequenceFrame)
24
25 /**
26 * Print the set of pages.
27 *
28 * @param aPrintOptions options for printing
29 * @param aStatusCallback interface that the client provides to receive
30 * progress notifications. Can be nullptr
31 * @return NS_OK if successful
32 * NS_ERROR_ABORT if the client cancels printing using the callback
33 * interface
34 * NS_ERROR_INVALID_ARG if printing a range of pages (not all pages)
35 * and the start page is greater than the total number of pages
36 * NS_ERROR_FAILURE if there is an error
37 */
38 NS_IMETHOD StartPrint(nsPresContext* aPresContext,
39 nsIPrintSettings* aPrintOptions,
40 const nsAString& aDocTitle,
41 const nsAString& aDocURL) = 0;
42
43 NS_IMETHOD PrePrintNextPage(nsITimerCallback* aCallback, bool* aDone) = 0;
44 NS_IMETHOD PrintNextPage() = 0;
45 NS_IMETHOD ResetPrintCanvasList() = 0;
46 NS_IMETHOD GetCurrentPageNum(int32_t* aPageNum) = 0;
47 NS_IMETHOD GetNumPages(int32_t* aNumPages) = 0;
48 NS_IMETHOD IsDoingPrintRange(bool* aDoing) = 0;
49 NS_IMETHOD GetPrintRange(int32_t* aFromPage, int32_t* aToPage) = 0;
50
51 NS_IMETHOD DoPageEnd() = 0;
52 NS_IMETHOD SetSelectionHeight(nscoord aYOffset, nscoord aHeight) = 0;
53
54 NS_IMETHOD SetTotalNumPages(int32_t aTotal) = 0;
55
56 // For Shrink To Fit
57 NS_IMETHOD GetSTFPercent(float& aSTFPercent) = 0;
58 };
59
60 #endif /* nsIPageSequenceFrame_h___ */
61
62

mercurial