1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsPrintData_h___
8 #define nsPrintData_h___
10 #include "mozilla/Attributes.h"
11 #include "mozilla/UniquePtr.h"
14 #include "nsDeviceContext.h"
15 #include "nsIPrintSettings.h"
16 #include "nsISupportsImpl.h"
17 #include "nsCOMArray.h"
20 class nsIWebProgressListener
;
24 typedef enum { eIsPrinting
, eIsPrintPreview
} ePrintDataType
;
26 explicit nsPrintData(ePrintDataType aType
);
28 NS_INLINE_DECL_REFCOUNTING(nsPrintData
)
30 // Listener Helper Methods
32 void OnStartPrinting();
33 void DoOnProgressChange(int32_t aProgress
, int32_t aMaxProgress
,
34 bool aDoStartStop
, int32_t aFlag
);
36 void DoOnStatusChange(nsresult aStatus
);
38 ePrintDataType mType
; // the type of data this is (Printing or Print Preview)
39 RefPtr
<nsDeviceContext
> mPrintDC
;
41 nsCOMArray
<nsIWebProgressListener
> mPrintProgressListeners
;
44 bool mIsAborted
; // tells us the document is being aborted
47 nsPrintData() = delete;
48 nsPrintData
& operator=(const nsPrintData
& aOther
) = delete;
50 ~nsPrintData(); // non-virtual
53 #endif /* nsPrintData_h___ */