2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-12-16 23:42:07 +04:00
|
|
|
|
2002-08-21 16:01:05 +04:00
|
|
|
#ifndef nsPrintData_h___
|
|
|
|
#define nsPrintData_h___
|
|
|
|
|
2011-12-16 23:42:07 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2017-03-06 11:28:20 +03:00
|
|
|
#include "mozilla/UniquePtr.h"
|
2011-12-16 23:42:07 +04:00
|
|
|
|
2002-08-21 16:01:05 +04:00
|
|
|
// Interfaces
|
2011-04-17 05:22:44 +04:00
|
|
|
#include "nsDeviceContext.h"
|
2016-10-28 02:31:14 +03:00
|
|
|
#include "nsIPrintSettings.h"
|
2017-05-09 11:08:20 +03:00
|
|
|
#include "nsISupportsImpl.h"
|
2009-02-03 17:42:18 +03:00
|
|
|
#include "nsTArray.h"
|
2006-12-10 11:05:05 +03:00
|
|
|
#include "nsCOMArray.h"
|
2002-08-21 16:01:05 +04:00
|
|
|
|
2006-12-10 11:05:05 +03:00
|
|
|
class nsPrintObject;
|
Bug 1600545 - Remove useless inclusions of header files generated from IDL files in accessible/, browser/, caps/, chrome/, devtools/, docshell/, editor/, extensions/, gfx/, hal/, image/, intl/, ipc/, js/, layout/, and media/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.
find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
if [ -n "$interfaces" ]; then
if [[ "$interfaces" == *$'\n'* ]]; then
regexp="\("
for i in $interfaces; do regexp="$regexp$i\|"; done
regexp="${regexp%%\\\|}\)"
else
regexp="$interfaces"
fi
interface=$(basename "$path")
rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
if [ $hits -eq 0 ]; then
echo "Removing ${interface} from ${path2}"
grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
mv -f "$path2".tmp "$path2"
fi
done
fi
done
Differential Revision: https://phabricator.services.mozilla.com/D55443
--HG--
extra : moz-landing-system : lando
2019-12-06 12:16:44 +03:00
|
|
|
class nsIPrintProgressParams;
|
2006-12-10 11:05:05 +03:00
|
|
|
class nsIWebProgressListener;
|
2002-08-21 16:01:05 +04:00
|
|
|
|
2019-05-17 01:16:11 +03:00
|
|
|
namespace mozilla {
|
|
|
|
class PrintPreviewUserEventSuppressor;
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2002-08-21 16:01:05 +04:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// nsPrintData Class
|
|
|
|
//
|
2017-03-06 10:35:39 +03:00
|
|
|
// mPreparingForPrint - indicates that we have started Printing but
|
|
|
|
// have not gone to the timer to start printing the pages. It gets turned
|
2002-08-21 16:01:05 +04:00
|
|
|
// off right before we go to the timer.
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
class nsPrintData {
|
2019-05-17 01:16:11 +03:00
|
|
|
typedef mozilla::PrintPreviewUserEventSuppressor
|
|
|
|
PrintPreviewUserEventSuppressor;
|
|
|
|
|
2002-08-21 16:01:05 +04:00
|
|
|
public:
|
|
|
|
typedef enum { eIsPrinting, eIsPrintPreview } ePrintDataType;
|
|
|
|
|
2014-08-08 03:48:38 +04:00
|
|
|
explicit nsPrintData(ePrintDataType aType);
|
2017-05-09 11:08:20 +03:00
|
|
|
|
|
|
|
NS_INLINE_DECL_REFCOUNTING(nsPrintData)
|
2002-08-21 16:01:05 +04:00
|
|
|
|
|
|
|
// Listener Helper Methods
|
|
|
|
void OnEndPrinting();
|
|
|
|
void OnStartPrinting();
|
2012-08-22 19:56:38 +04:00
|
|
|
void DoOnProgressChange(int32_t aProgress, int32_t aMaxProgress,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aDoStartStop, int32_t aFlag);
|
2002-08-21 16:01:05 +04:00
|
|
|
|
2016-05-16 12:40:54 +03:00
|
|
|
void DoOnStatusChange(nsresult aStatus);
|
|
|
|
|
2002-08-21 16:01:05 +04:00
|
|
|
ePrintDataType mType; // the type of data this is (Printing or Print Preview)
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsDeviceContext> mPrintDC;
|
2002-08-21 16:01:05 +04:00
|
|
|
|
2017-03-06 11:28:20 +03:00
|
|
|
mozilla::UniquePtr<nsPrintObject> mPrintObject;
|
2002-08-21 16:01:05 +04:00
|
|
|
|
2006-12-10 11:05:05 +03:00
|
|
|
nsCOMArray<nsIWebProgressListener> mPrintProgressListeners;
|
2002-08-21 16:01:05 +04:00
|
|
|
nsCOMPtr<nsIPrintProgressParams> mPrintProgressParams;
|
|
|
|
|
2018-12-05 21:44:03 +03:00
|
|
|
nsCOMPtr<nsPIDOMWindowOuter> mCurrentFocusWin; // cache a pointer to the
|
|
|
|
// currently focused window
|
2002-08-21 16:01:05 +04:00
|
|
|
|
2017-03-06 11:28:20 +03:00
|
|
|
// Array of non-owning pointers to all the nsPrintObjects owned by this
|
|
|
|
// nsPrintData. This includes this->mPrintObject, as well as all of its
|
|
|
|
// mKids (and their mKids, etc.)
|
2009-02-03 17:42:18 +03:00
|
|
|
nsTArray<nsPrintObject*> mPrintDocList;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mIsIFrameSelected;
|
|
|
|
bool mIsParentAFrameSet;
|
|
|
|
bool mOnStartSent;
|
2019-05-29 12:42:14 +03:00
|
|
|
bool mIsAborted; // tells us the document is being aborted
|
|
|
|
bool mPreparingForPrint; // see comments above
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mShrinkToFit;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mNumPrintablePages;
|
|
|
|
int32_t mNumPagesPrinted;
|
2002-08-21 16:01:05 +04:00
|
|
|
float mShrinkRatio;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2002-08-21 16:01:05 +04:00
|
|
|
nsCOMPtr<nsIPrintSettings> mPrintSettings;
|
2019-05-17 01:16:11 +03:00
|
|
|
RefPtr<PrintPreviewUserEventSuppressor> mPPEventSuppressor;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2002-08-21 16:01:05 +04:00
|
|
|
private:
|
2015-01-07 02:35:02 +03:00
|
|
|
nsPrintData() = delete;
|
|
|
|
nsPrintData& operator=(const nsPrintData& aOther) = delete;
|
2002-08-21 16:01:05 +04:00
|
|
|
|
2017-05-09 11:08:20 +03:00
|
|
|
~nsPrintData(); // non-virtual
|
2002-08-21 16:01:05 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsPrintData_h___ */
|