Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions
nsPrintData Class Reference

#include <nsPrintData.h>

Collaboration diagram for nsPrintData:
Collaboration graph
[legend]

List of all members.

Public Types

enum  ePrintDataType { eIsPrinting, eIsPrintPreview }
enum  eDocTitleDefault { eDocTitleDefNone, eDocTitleDefBlank, eDocTitleDefURLDoc }

Public Member Functions

 nsPrintData (ePrintDataType aType)
 ~nsPrintData ()
void OnEndPrinting ()
void OnStartPrinting ()

Static Public Member Functions

static void DoOnProgressChange (nsVoidArray &aListeners, PRInt32 aProgess, PRInt32 aMaxProgress, PRBool aDoStartStop=PR_FALSE, PRInt32 aFlag=0)

Public Attributes

ePrintDataType mType
nsCOMPtr< nsIDeviceContextmPrintDC
nsIViewmPrintView
FILEmDebugFilePtr
nsPrintObjectmPrintObject
nsPrintObjectmSelectedPO
nsVoidArray mPrintProgressListeners
nsCOMPtr< nsIWebProgressListenermPrintProgressListener
nsCOMPtr< nsIPrintProgressmPrintProgress
nsCOMPtr< nsIPrintProgressParamsmPrintProgressParams
PRBool mShowProgressDialog
PRPackedBool mProgressDialogIsShown
nsCOMPtr< nsIDOMWindowmCurrentFocusWin
nsVoidArraymPrintDocList
nsCOMPtr< nsIDeviceContextmPrintDocDC
nsCOMPtr< nsIDOMWindowmPrintDocDW
PRPackedBool mIsIFrameSelected
PRPackedBool mIsParentAFrameSet
PRPackedBool mPrintingAsIsSubDoc
PRPackedBool mOnStartSent
PRPackedBool mIsAborted
PRPackedBool mPreparingForPrint
PRPackedBool mDocWasToBeDestroyed
PRBool mShrinkToFit
PRInt16 mPrintFrameType
PRInt32 mNumPrintableDocs
PRInt32 mNumDocsPrinted
PRInt32 mNumPrintablePages
PRInt32 mNumPagesPrinted
float mShrinkRatio
float mOrigDCScale
float mOrigZoom
nsCOMPtr< nsIPrintSessionmPrintSession
nsCOMPtr< nsIPrintSettingsmPrintSettings
nsCOMPtr< nsIPrintOptionsmPrintOptions
nsPrintPreviewListenermPPEventListeners
PRUnicharmBrandName
nsPagePrintTimermPagePrintTimer
nsIPageSequenceFramemPageSeqFrame

Private Member Functions

 nsPrintData ()
nsPrintDataoperator= (const nsPrintData &aOther)

Detailed Description

Definition at line 101 of file nsPrintData.h.


Member Enumeration Documentation

Enumerator:
eDocTitleDefNone 
eDocTitleDefBlank 
eDocTitleDefURLDoc 

Definition at line 108 of file nsPrintData.h.

Enumerator:
eIsPrinting 
eIsPrintPreview 

Definition at line 104 of file nsPrintData.h.


Constructor & Destructor Documentation

Definition at line 104 of file nsPrintData.cpp.

{

  // Set the cached Zoom value back into the DC
  if (mPrintDC) {
    mPrintDC->SetZoom(mOrigZoom);
  }

  // remove the event listeners
  if (mPPEventListeners) {
    mPPEventListeners->RemoveListeners();
    NS_RELEASE(mPPEventListeners);
  }

  // Only Send an OnEndPrinting if we have started printing
  if (mOnStartSent && mType != eIsPrintPreview) {
    OnEndPrinting();
  }

  if (mPrintDC && !mDebugFilePtr) {
    PR_PL(("****************** End Document ************************\n"));
    PR_PL(("\n"));
    PRBool isCancelled = PR_FALSE;
    mPrintSettings->GetIsCancelled(&isCancelled);

    nsresult rv = NS_OK;
    if (mType == eIsPrinting) {
      if (!isCancelled && !mIsAborted) {
        rv = mPrintDC->EndDocument();
      } else {
        rv = mPrintDC->AbortDocument();  
      }
      if (NS_FAILED(rv)) {
        // XXX nsPrintData::ShowPrintErrorDialog(rv);
      }
    }
  }

  delete mPrintObject;

  if (mPrintDocList != nsnull) {
    mPrintDocList->Clear();
    delete mPrintDocList;
  }

  if (mBrandName) {
    NS_Free(mBrandName);
  }

  for (PRInt32 i=0;i<mPrintProgressListeners.Count();i++) {
    nsIWebProgressListener* wpl = NS_STATIC_CAST(nsIWebProgressListener*, mPrintProgressListeners.ElementAt(i));
    NS_ASSERTION(wpl, "nsIWebProgressListener is NULL!");
    NS_RELEASE(wpl);
  }

}

Here is the call graph for this function:

nsPrintData::nsPrintData ( ) [inline, private]

Definition at line 176 of file nsPrintData.h.

{}

Member Function Documentation

void nsPrintData::DoOnProgressChange ( nsVoidArray aListeners,
PRInt32  aProgess,
PRInt32  aMaxProgress,
PRBool  aDoStartStop = PR_FALSE,
PRInt32  aFlag = 0 
) [static]

Definition at line 178 of file nsPrintData.cpp.

{
  if (aProgess == 0) return;

  for (PRInt32 i=0;i<aListeners.Count();i++) {
    nsIWebProgressListener* wpl = NS_STATIC_CAST(nsIWebProgressListener*, aListeners.ElementAt(i));
    NS_ASSERTION(wpl, "nsIWebProgressListener is NULL!");
    wpl->OnProgressChange(nsnull, nsnull, aProgess, aMaxProgress, aProgess, aMaxProgress);
    if (aDoStartStop) {
      wpl->OnStateChange(nsnull, nsnull, aFlag, 0);
    }
  }
}

Here is the caller graph for this function:

Definition at line 169 of file nsPrintData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 161 of file nsPrintData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsPrintData& nsPrintData::operator= ( const nsPrintData aOther) [private]

Member Data Documentation

Definition at line 170 of file nsPrintData.h.

Definition at line 143 of file nsPrintData.h.

Definition at line 131 of file nsPrintData.h.

Definition at line 154 of file nsPrintData.h.

Definition at line 152 of file nsPrintData.h.

Definition at line 148 of file nsPrintData.h.

Definition at line 149 of file nsPrintData.h.

Definition at line 158 of file nsPrintData.h.

Definition at line 160 of file nsPrintData.h.

Definition at line 157 of file nsPrintData.h.

Definition at line 159 of file nsPrintData.h.

Definition at line 151 of file nsPrintData.h.

Definition at line 162 of file nsPrintData.h.

Definition at line 163 of file nsPrintData.h.

Definition at line 172 of file nsPrintData.h.

Definition at line 173 of file nsPrintData.h.

Definition at line 168 of file nsPrintData.h.

Definition at line 153 of file nsPrintData.h.

Definition at line 129 of file nsPrintData.h.

Definition at line 146 of file nsPrintData.h.

Definition at line 147 of file nsPrintData.h.

Definition at line 145 of file nsPrintData.h.

Definition at line 156 of file nsPrintData.h.

Definition at line 150 of file nsPrintData.h.

Definition at line 133 of file nsPrintData.h.

Definition at line 167 of file nsPrintData.h.

Definition at line 138 of file nsPrintData.h.

Definition at line 137 of file nsPrintData.h.

Definition at line 136 of file nsPrintData.h.

Definition at line 139 of file nsPrintData.h.

Definition at line 165 of file nsPrintData.h.

Definition at line 166 of file nsPrintData.h.

Definition at line 130 of file nsPrintData.h.

Definition at line 141 of file nsPrintData.h.

Definition at line 134 of file nsPrintData.h.

Definition at line 140 of file nsPrintData.h.

Definition at line 161 of file nsPrintData.h.

Definition at line 155 of file nsPrintData.h.

Definition at line 128 of file nsPrintData.h.


The documentation for this class was generated from the following files: