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___
8 #include "nsQueryFrame.h"
12 class nsIPrintSettings
;
13 class nsITimerCallback
;
16 * Interface for accessing special capabilities of the page sequence frame.
18 * Today all that exists are member functions for printing.
20 class nsIPageSequenceFrame
: public nsQueryFrame
23 NS_DECL_QUERYFRAME_TARGET(nsIPageSequenceFrame
)
26 * Print the set of pages.
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
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
38 NS_IMETHOD
StartPrint(nsPresContext
* aPresContext
,
39 nsIPrintSettings
* aPrintOptions
,
40 const nsAString
& aDocTitle
,
41 const nsAString
& aDocURL
) = 0;
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;
51 NS_IMETHOD
DoPageEnd() = 0;
52 NS_IMETHOD
SetSelectionHeight(nscoord aYOffset
, nscoord aHeight
) = 0;
54 NS_IMETHOD
SetTotalNumPages(int32_t aTotal
) = 0;
57 NS_IMETHOD
GetSTFPercent(float& aSTFPercent
) = 0;
60 #endif /* nsIPageSequenceFrame_h___ */