mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 11:26:09 +00:00
bug 231233 : nsPrintData.h cleanup r+sr=jst
This commit is contained in:
parent
7739558313
commit
3b99f154bd
@ -126,140 +126,6 @@ public:
|
||||
PRInt32 aFlag = 0);
|
||||
|
||||
|
||||
//
|
||||
// The following three methods are used for printing...
|
||||
//
|
||||
nsresult DocumentReadyForPrinting();
|
||||
nsresult GetSelectionDocument(nsIDeviceContextSpec * aDevSpec,
|
||||
nsIDocument ** aNewDoc);
|
||||
|
||||
nsresult SetupToPrintContent(nsIWebShell* aParent,
|
||||
nsIDeviceContext* aDContext,
|
||||
nsIDOMWindowInternal* aCurrentFocusedDOMWin);
|
||||
nsresult EnablePOsForPrinting();
|
||||
nsPrintObject* FindXMostPO();
|
||||
void FindXMostFrameSize(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext* aRC, nsIFrame* aFrame,
|
||||
nscoord aX, nscoord aY, PRInt32& aMaxWidth);
|
||||
void FindXMostFrameInList(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext* aRC, nsIAtom* aList,
|
||||
nsIFrame* aFrame, nscoord aX, nscoord aY,
|
||||
PRInt32& aMaxWidth);
|
||||
|
||||
PRBool PrintDocContent(nsPrintObject* aPO, nsresult& aStatus);
|
||||
nsresult DoPrint(nsPrintObject * aPO, PRBool aDoSyncPrinting,
|
||||
PRBool& aDonePrinting);
|
||||
void SetPrintAsIs(nsPrintObject* aPO, PRBool aAsIs = PR_TRUE);
|
||||
|
||||
enum ePrintFlags {eSetPrintFlag = 1U, eSetHiddenFlag = 2U };
|
||||
void SetPrintPO(nsPrintObject* aPO, PRBool aPrint, PRBool aIsHidden = PR_FALSE, PRUint32 aFlags = eSetPrintFlag);
|
||||
|
||||
|
||||
nsresult ShowDocList(nsPrintObject* aPO, PRBool aShow);
|
||||
void InstallNewPresentation();
|
||||
void ReturnToGalleyPresentation();
|
||||
void TurnScriptingOn(PRBool aDoTurnOn);
|
||||
PRBool CheckDocumentForPPCaching();
|
||||
void InstallPrintPreviewListener();
|
||||
|
||||
// nsIDocumentViewerPrint Printing Methods
|
||||
PRBool PrintPage(nsIPresContext* aPresContext,
|
||||
nsIPrintSettings* aPrintSettings,
|
||||
nsPrintObject* aPOect, PRBool& aInRange);
|
||||
PRBool DonePrintingPages(nsPrintObject* aPO);
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
void BuildDocTree(nsIDocShellTreeNode * aParentNode,
|
||||
nsVoidArray * aDocList,
|
||||
nsPrintObject * aPO);
|
||||
nsresult ReflowDocList(nsPrintObject * aPO, PRBool aSetPixelScale,
|
||||
PRBool aDoCalcShrink);
|
||||
void SetClipRect(nsPrintObject* aPO,
|
||||
const nsRect& aClipRect,
|
||||
nscoord aOffsetX,
|
||||
nscoord aOffsetY,
|
||||
PRBool aDoingSetClip);
|
||||
|
||||
nsresult ReflowPrintObject(nsPrintObject * aPO, PRBool aDoCalcShrink);
|
||||
nsresult CalcPageFrameLocation(nsIPresShell * aPresShell,
|
||||
nsPrintObject* aPO);
|
||||
nsPrintObject * FindPrintObjectByWS(nsPrintObject* aPO, nsIWebShell * aWebShell);
|
||||
void MapContentForPO(nsPrintObject* aRootObject,
|
||||
nsIPresShell* aPresShell,
|
||||
nsIContent* aContent);
|
||||
void MapContentToWebShells(nsPrintObject* aRootPO, nsPrintObject* aPO);
|
||||
nsresult MapSubDocFrameLocations(nsPrintObject* aPO);
|
||||
|
||||
void CalcNumPrintableDocsAndPages(PRInt32& aNumDocs, PRInt32& aNumPages);
|
||||
void DoProgressForAsIsFrames();
|
||||
void DoProgressForSeparateFrames();
|
||||
void ShowPrintProgress(PRBool aIsForPrinting, PRBool& aDoNotify);
|
||||
void CleanUpBeforeReflow(nsresult aResult);
|
||||
nsresult FinishPrintPreview();
|
||||
void CloseProgressDialog(nsIWebProgressListener* aWebProgressListener);
|
||||
|
||||
void SetDocAndURLIntoProgress(nsPrintObject* aPO,
|
||||
nsIPrintProgressParams* aParams);
|
||||
void ElipseLongString(PRUnichar *& aStr, const PRUint32 aLen, PRBool aDoFront);
|
||||
void CleanupDocTitleArray(PRUnichar**& aArray, PRInt32& aCount);
|
||||
void CheckForHiddenFrameSetFrames();
|
||||
|
||||
PRBool IsThereARangeSelection(nsIDOMWindowInternal * aDOMWin);
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
#ifdef NS_PRINT_PREVIEW
|
||||
PRBool mIsDoingPrintPreview; // per DocumentViewer
|
||||
nsIWidget* mParentWidget; // purposely won't be ref counted
|
||||
nsPrintData* mPrtPreview;
|
||||
nsPrintData* mOldPrtPreview;
|
||||
#endif
|
||||
|
||||
nsIPresContext* mPresContext; // XXX
|
||||
nsIDeviceContext* mDeviceContext; // XXX
|
||||
|
||||
// Timer Methods
|
||||
nsresult StartPagePrintTimer(nsIPresContext * aPresContext,
|
||||
nsIPrintSettings* aPrintSettings,
|
||||
nsPrintObject* aPO,
|
||||
PRUint32 aDelay);
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// Static Methods
|
||||
//---------------------------------------------------------------------
|
||||
static nsresult FindFrameSetWithIID(nsIContent * aParentContent, const nsIID& aIID);
|
||||
static PRBool IsWindowsInOurSubTree(nsIDOMWindowInternal * aDOMWindow, nsISupports* aContainer);
|
||||
static PRBool IsWebShellAFrameSet(nsIWebShell * aParent);
|
||||
|
||||
static void GetPresShellAndRootContent(nsIWebShell * aWebShell,
|
||||
nsIPresShell** aPresShell,
|
||||
nsIContent** aContent);
|
||||
|
||||
static nsPrintObject* FindPrintObjectByDOMWin(nsPrintObject* aParentObject,
|
||||
nsIDOMWindowInternal * aDOMWin);
|
||||
|
||||
// get the DOMWindow for a given WebShell
|
||||
static nsIDOMWindowInternal * GetDOMWinForWebShell(nsIWebShell* aWebShell);
|
||||
|
||||
static void GetWebShellTitleAndURL(nsIWebShell* aWebShell,
|
||||
PRUnichar** aTitle, PRUnichar** aURLStr);
|
||||
|
||||
static void GetDisplayTitleAndURL(nsPrintObject* aPO,
|
||||
nsIPrintSettings* aPrintSettings,
|
||||
const PRUnichar* aBrandName,
|
||||
PRUnichar** aTitle,
|
||||
PRUnichar** aURLStr,
|
||||
eDocTitleDefault aDefType = eDocTitleDefNone);
|
||||
static void ShowPrintErrorDialog(nsresult printerror,
|
||||
PRBool aIsPrinting = PR_TRUE);
|
||||
|
||||
|
||||
nsIDocumentViewerPrint* mDocViewerPrint; // [WEAK] it owns me!
|
||||
nsIDocumentViewer* mDocViewer; // [WEAK] it owns me!
|
||||
|
||||
nsISupports* mContainer; // [WEAK] it owns me!
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
|
||||
ePrintDataType mType; // the type of data this is (Printing or Print Preview)
|
||||
nsCOMPtr<nsIDeviceContext> mPrintDC;
|
||||
nsIView *mPrintView;
|
||||
|
@ -126,140 +126,6 @@ public:
|
||||
PRInt32 aFlag = 0);
|
||||
|
||||
|
||||
//
|
||||
// The following three methods are used for printing...
|
||||
//
|
||||
nsresult DocumentReadyForPrinting();
|
||||
nsresult GetSelectionDocument(nsIDeviceContextSpec * aDevSpec,
|
||||
nsIDocument ** aNewDoc);
|
||||
|
||||
nsresult SetupToPrintContent(nsIWebShell* aParent,
|
||||
nsIDeviceContext* aDContext,
|
||||
nsIDOMWindowInternal* aCurrentFocusedDOMWin);
|
||||
nsresult EnablePOsForPrinting();
|
||||
nsPrintObject* FindXMostPO();
|
||||
void FindXMostFrameSize(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext* aRC, nsIFrame* aFrame,
|
||||
nscoord aX, nscoord aY, PRInt32& aMaxWidth);
|
||||
void FindXMostFrameInList(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext* aRC, nsIAtom* aList,
|
||||
nsIFrame* aFrame, nscoord aX, nscoord aY,
|
||||
PRInt32& aMaxWidth);
|
||||
|
||||
PRBool PrintDocContent(nsPrintObject* aPO, nsresult& aStatus);
|
||||
nsresult DoPrint(nsPrintObject * aPO, PRBool aDoSyncPrinting,
|
||||
PRBool& aDonePrinting);
|
||||
void SetPrintAsIs(nsPrintObject* aPO, PRBool aAsIs = PR_TRUE);
|
||||
|
||||
enum ePrintFlags {eSetPrintFlag = 1U, eSetHiddenFlag = 2U };
|
||||
void SetPrintPO(nsPrintObject* aPO, PRBool aPrint, PRBool aIsHidden = PR_FALSE, PRUint32 aFlags = eSetPrintFlag);
|
||||
|
||||
|
||||
nsresult ShowDocList(nsPrintObject* aPO, PRBool aShow);
|
||||
void InstallNewPresentation();
|
||||
void ReturnToGalleyPresentation();
|
||||
void TurnScriptingOn(PRBool aDoTurnOn);
|
||||
PRBool CheckDocumentForPPCaching();
|
||||
void InstallPrintPreviewListener();
|
||||
|
||||
// nsIDocumentViewerPrint Printing Methods
|
||||
PRBool PrintPage(nsIPresContext* aPresContext,
|
||||
nsIPrintSettings* aPrintSettings,
|
||||
nsPrintObject* aPOect, PRBool& aInRange);
|
||||
PRBool DonePrintingPages(nsPrintObject* aPO);
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
void BuildDocTree(nsIDocShellTreeNode * aParentNode,
|
||||
nsVoidArray * aDocList,
|
||||
nsPrintObject * aPO);
|
||||
nsresult ReflowDocList(nsPrintObject * aPO, PRBool aSetPixelScale,
|
||||
PRBool aDoCalcShrink);
|
||||
void SetClipRect(nsPrintObject* aPO,
|
||||
const nsRect& aClipRect,
|
||||
nscoord aOffsetX,
|
||||
nscoord aOffsetY,
|
||||
PRBool aDoingSetClip);
|
||||
|
||||
nsresult ReflowPrintObject(nsPrintObject * aPO, PRBool aDoCalcShrink);
|
||||
nsresult CalcPageFrameLocation(nsIPresShell * aPresShell,
|
||||
nsPrintObject* aPO);
|
||||
nsPrintObject * FindPrintObjectByWS(nsPrintObject* aPO, nsIWebShell * aWebShell);
|
||||
void MapContentForPO(nsPrintObject* aRootObject,
|
||||
nsIPresShell* aPresShell,
|
||||
nsIContent* aContent);
|
||||
void MapContentToWebShells(nsPrintObject* aRootPO, nsPrintObject* aPO);
|
||||
nsresult MapSubDocFrameLocations(nsPrintObject* aPO);
|
||||
|
||||
void CalcNumPrintableDocsAndPages(PRInt32& aNumDocs, PRInt32& aNumPages);
|
||||
void DoProgressForAsIsFrames();
|
||||
void DoProgressForSeparateFrames();
|
||||
void ShowPrintProgress(PRBool aIsForPrinting, PRBool& aDoNotify);
|
||||
void CleanUpBeforeReflow(nsresult aResult);
|
||||
nsresult FinishPrintPreview();
|
||||
void CloseProgressDialog(nsIWebProgressListener* aWebProgressListener);
|
||||
|
||||
void SetDocAndURLIntoProgress(nsPrintObject* aPO,
|
||||
nsIPrintProgressParams* aParams);
|
||||
void ElipseLongString(PRUnichar *& aStr, const PRUint32 aLen, PRBool aDoFront);
|
||||
void CleanupDocTitleArray(PRUnichar**& aArray, PRInt32& aCount);
|
||||
void CheckForHiddenFrameSetFrames();
|
||||
|
||||
PRBool IsThereARangeSelection(nsIDOMWindowInternal * aDOMWin);
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
#ifdef NS_PRINT_PREVIEW
|
||||
PRBool mIsDoingPrintPreview; // per DocumentViewer
|
||||
nsIWidget* mParentWidget; // purposely won't be ref counted
|
||||
nsPrintData* mPrtPreview;
|
||||
nsPrintData* mOldPrtPreview;
|
||||
#endif
|
||||
|
||||
nsIPresContext* mPresContext; // XXX
|
||||
nsIDeviceContext* mDeviceContext; // XXX
|
||||
|
||||
// Timer Methods
|
||||
nsresult StartPagePrintTimer(nsIPresContext * aPresContext,
|
||||
nsIPrintSettings* aPrintSettings,
|
||||
nsPrintObject* aPO,
|
||||
PRUint32 aDelay);
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// Static Methods
|
||||
//---------------------------------------------------------------------
|
||||
static nsresult FindFrameSetWithIID(nsIContent * aParentContent, const nsIID& aIID);
|
||||
static PRBool IsWindowsInOurSubTree(nsIDOMWindowInternal * aDOMWindow, nsISupports* aContainer);
|
||||
static PRBool IsWebShellAFrameSet(nsIWebShell * aParent);
|
||||
|
||||
static void GetPresShellAndRootContent(nsIWebShell * aWebShell,
|
||||
nsIPresShell** aPresShell,
|
||||
nsIContent** aContent);
|
||||
|
||||
static nsPrintObject* FindPrintObjectByDOMWin(nsPrintObject* aParentObject,
|
||||
nsIDOMWindowInternal * aDOMWin);
|
||||
|
||||
// get the DOMWindow for a given WebShell
|
||||
static nsIDOMWindowInternal * GetDOMWinForWebShell(nsIWebShell* aWebShell);
|
||||
|
||||
static void GetWebShellTitleAndURL(nsIWebShell* aWebShell,
|
||||
PRUnichar** aTitle, PRUnichar** aURLStr);
|
||||
|
||||
static void GetDisplayTitleAndURL(nsPrintObject* aPO,
|
||||
nsIPrintSettings* aPrintSettings,
|
||||
const PRUnichar* aBrandName,
|
||||
PRUnichar** aTitle,
|
||||
PRUnichar** aURLStr,
|
||||
eDocTitleDefault aDefType = eDocTitleDefNone);
|
||||
static void ShowPrintErrorDialog(nsresult printerror,
|
||||
PRBool aIsPrinting = PR_TRUE);
|
||||
|
||||
|
||||
nsIDocumentViewerPrint* mDocViewerPrint; // [WEAK] it owns me!
|
||||
nsIDocumentViewer* mDocViewer; // [WEAK] it owns me!
|
||||
|
||||
nsISupports* mContainer; // [WEAK] it owns me!
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
|
||||
ePrintDataType mType; // the type of data this is (Printing or Print Preview)
|
||||
nsCOMPtr<nsIDeviceContext> mPrintDC;
|
||||
nsIView *mPrintView;
|
||||
|
Loading…
Reference in New Issue
Block a user