Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsPrintEngine.cpp File Reference
#include "nsPrintEngine.h"
#include "nsIStringBundle.h"
#include "nsReadableUtils.h"
#include "nsCRT.h"
#include "nsISelection.h"
#include "nsIScriptGlobalObject.h"
#include "nsIDOMWindowInternal.h"
#include "nsIDocShell.h"
#include "nsIURI.h"
#include "nsINodeInfo.h"
#include "nsContentErrors.h"
#include "nsIPrintSettings.h"
#include "nsIPrintSettingsService.h"
#include "nsIPrintOptions.h"
#include "nsGfxCIID.h"
#include "nsIServiceManager.h"
#include "nsHTMLAtoms.h"
#include "nsISimpleEnumerator.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsIEventQueue.h"
#include "nsIEventQueueService.h"
#include "nsEventQueueUtils.h"
#include "nsPrintPreviewListener.h"
#include "nsIWebBrowserPrint.h"
#include "nsIDOMHTMLFrameElement.h"
#include "nsIDOMHTMLFrameSetElement.h"
#include "nsIDOMHTMLIFrameElement.h"
#include "nsIDOMHTMLObjectElement.h"
#include "nsIDOMHTMLEmbedElement.h"
#include "imgIContainer.h"
#include "nsIScrollableView.h"
#include "nsIScrollable.h"
#include "nsIPrintProgress.h"
#include "nsIPrintProgressParams.h"
#include "nsIObserver.h"
#include "nsIPrompt.h"
#include "nsIWindowWatcher.h"
#include "nsIPrintingPromptService.h"
#include "nsPagePrintTimer.h"
#include "nsIDocument.h"
#include "nsIDOMEventReceiver.h"
#include "nsIDOMFocusListener.h"
#include "nsISelectionController.h"
#include "nsISupportsUtils.h"
#include "nsIFrame.h"
#include "nsIScriptContext.h"
#include "nsILinkHandler.h"
#include "nsIDOMDocument.h"
#include "nsISelectionListener.h"
#include "nsISelectionPrivate.h"
#include "nsIDOMHTMLDocument.h"
#include "nsIDOMNSHTMLDocument.h"
#include "nsIDOMHTMLCollection.h"
#include "nsIDOMHTMLElement.h"
#include "nsIDOMRange.h"
#include "nsContentCID.h"
#include "nsLayoutCID.h"
#include "nsContentUtils.h"
#include "nsIPresShell.h"
#include "nsLayoutUtils.h"
#include "nsViewsCID.h"
#include "nsWidgetsCID.h"
#include "nsIDeviceContext.h"
#include "nsIDeviceContextSpec.h"
#include "nsIDeviceContextSpecFactory.h"
#include "nsIViewManager.h"
#include "nsIView.h"
#include "nsIPageSequenceFrame.h"
#include "nsIURL.h"
#include "nsIContentViewerEdit.h"
#include "nsIContentViewerFile.h"
#include "nsIMarkupDocumentViewer.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeNode.h"
#include "nsIDocShellTreeOwner.h"
#include "nsIBaseWindow.h"
#include "nsIFrameDebug.h"
#include "nsILayoutHistoryState.h"
#include "nsLayoutAtoms.h"
#include "nsFrameManager.h"
#include "nsIParser.h"
#include "nsGUIEvent.h"
#include "nsHTMLReflowState.h"
#include "nsIDOMHTMLAnchorElement.h"
#include "nsIDOMHTMLAreaElement.h"
#include "nsIDOMHTMLLinkElement.h"
#include "nsIDOMHTMLImageElement.h"
#include "nsIContentViewerContainer.h"
#include "nsIContentViewer.h"
#include "nsPIDOMWindow.h"
#include "nsIFocusController.h"
#include "nsCDefaultURIFixup.h"
#include "nsIURIFixup.h"
#include "prlog.h"

Go to the source code of this file.

Defines

#define PRT_YESNO(_p)
#define PR_PL(_p1)
#define DUMP_DOC_LIST(_title)
#define DUMP_DOC_TREE
#define DUMP_DOC_TREELAYOUT
#define NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG(nserr)   case nserr: stringName.AssignLiteral(#nserr); break;
#define DUMP_DOC_LIST(_title)
#define DUMP_DOC_TREE
#define DUMP_DOC_TREELAYOUT

Functions

static NS_DEFINE_CID (kViewManagerCID, NS_VIEW_MANAGER_CID)
static NS_DEFINE_CID (kWidgetCID, NS_CHILD_CID)
static NS_DEFINE_IID (kDeviceContextSpecFactoryCID, NS_DEVICE_CONTEXT_SPEC_FACTORY_CID)
 NS_IMPL_ISUPPORTS2 (nsPrintEngine, nsIWebBrowserPrint, nsIObserver) nsPrintEngine
static void GetParentWebBrowserPrint (nsISupports *aContainer, nsIWebBrowserPrint **aParent)
static void GetIFramePosition (nsPrintObject *aPO, nscoord &aX, nscoord &aY)
void PR_CALLBACK HandlePLEvent (PLEvent *aEvent)
void PR_CALLBACK DestroyPLEvent (PLEvent *aEvent)

Variables

static const char sPrintSettingsServiceContractID [] = "@mozilla.org/gfx/printsettings-service;1"
static const char sPrintOptionsContractID [] = "@mozilla.org/gfx/printsettings-service;1"
static const char kPrintingPromptService [] = "@mozilla.org/embedcomp/printingprompt-service;1"

Define Documentation

#define DUMP_DOC_LIST (   _title)

Definition at line 4979 of file nsPrintEngine.cpp.

#define DUMP_DOC_LIST (   _title)

Definition at line 4979 of file nsPrintEngine.cpp.

Definition at line 4980 of file nsPrintEngine.cpp.

Definition at line 4980 of file nsPrintEngine.cpp.

Definition at line 4981 of file nsPrintEngine.cpp.

Definition at line 4981 of file nsPrintEngine.cpp.

#define NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG (   nserr)    case nserr: stringName.AssignLiteral(#nserr); break;
#define PR_PL (   _p1)

Definition at line 210 of file nsPrintEngine.cpp.

#define PRT_YESNO (   _p)

Definition at line 209 of file nsPrintEngine.cpp.


Function Documentation

Definition at line 4557 of file nsPrintEngine.cpp.

{
  nsIDocumentViewerPrint *docViewerPrint = (nsIDocumentViewerPrint*)PL_GetEventOwner(aEvent);
  NS_IF_RELEASE(docViewerPrint);

  delete aEvent;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void GetIFramePosition ( nsPrintObject aPO,
nscoord aX,
nscoord aY 
) [static]

Definition at line 2996 of file nsPrintEngine.cpp.

{
  if (aPO->mParent != nsnull) {
    // we would not have gotten here if any of these ptrs were null
    nsFrameManager *frameMan = aPO->mParent->mPresShell->FrameManager();

    // This gets our HTMLIFrame
    nsIFrame* frame = frameMan->GetPrimaryFrameFor(aPO->mContent);
    NS_ASSERTION(frame, "no primary frame for IFRAME");
    if (!frame)
      return;

    // find the offset to the content rect
    nsMargin borderPadding(0, 0, 0, 0);
    frame->CalcBorderPadding(borderPadding);
    aX += borderPadding.left;
    aY += borderPadding.top;

    // traverse out to the pageContentFrame
    do {
      nsPoint pt = frame->GetPosition();
      aX += pt.x;
      aY += pt.y;
      if (nsLayoutAtoms::pageContentFrame == frame->GetType()) {
        break;
      }
      frame = frame->GetParent();
    } while (frame);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void GetParentWebBrowserPrint ( nsISupports *  aContainer,
nsIWebBrowserPrint **  aParent 
) [static]

Definition at line 1396 of file nsPrintEngine.cpp.

{
  *aParent = nsnull;

  nsCOMPtr<nsIDocShellTreeItem> item(do_QueryInterface(aContainer));

  if (item) {
    nsCOMPtr<nsIDocShellTreeItem> parent;
    item->GetParent(getter_AddRefs(parent));

    nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(parent));

    if (docShell) {
      nsCOMPtr<nsIContentViewer> viewer;
      docShell->GetContentViewer(getter_AddRefs(viewer));

      if (viewer) {
        CallQueryInterface(viewer, aParent);
      }
    }
  }
}

Here is the call graph for this function:

Definition at line 4546 of file nsPrintEngine.cpp.

{
  nsIDocumentViewerPrint *docViewerPrint = (nsIDocumentViewerPrint*)PL_GetEventOwner(aEvent);

  NS_ASSERTION(docViewerPrint, "The event owner is null.");
  if (docViewerPrint) {
    docViewerPrint->OnDonePrinting();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static NS_DEFINE_CID ( kViewManagerCID  ,
NS_VIEW_MANAGER_CID   
) [static]
static NS_DEFINE_CID ( kWidgetCID  ,
NS_CHILD_CID   
) [static]
static NS_DEFINE_IID ( kDeviceContextSpecFactoryCID  ,
NS_DEVICE_CONTEXT_SPEC_FACTORY_CID   
) [static]

Definition at line 235 of file nsPrintEngine.cpp.

                             :
  mIsCreatingPrintPreview(PR_FALSE),
  mIsDoingPrinting(PR_FALSE),
  mDocViewerPrint(nsnull),
  mDocViewer(nsnull),
  mContainer(nsnull),
  mDeviceContext(nsnull),
  mPresContext(nsnull),
  mPrt(nsnull),
  mPagePrintTimer(nsnull),
  mPageSeqFrame(nsnull),
  mIsDoingPrintPreview(PR_FALSE),
  mParentWidget(nsnull),
  mPrtPreview(nsnull),
  mOldPrtPreview(nsnull),
  mIsCachingPresentation(PR_FALSE),
  mCachedPresObj(nsnull),
  mDebugFile(nsnull)

{
}

Variable Documentation

const char kPrintingPromptService[] = "@mozilla.org/embedcomp/printingprompt-service;1" [static]

Definition at line 100 of file nsPrintEngine.cpp.

const char sPrintOptionsContractID[] = "@mozilla.org/gfx/printsettings-service;1" [static]

Definition at line 66 of file nsPrintEngine.cpp.

const char sPrintSettingsServiceContractID[] = "@mozilla.org/gfx/printsettings-service;1" [static]

Definition at line 65 of file nsPrintEngine.cpp.