layout/base/src/nsPrintPreviewContext.cpp,3.22 | . | Disk File |
Skipping to line 41 | . | |
#include "nsIView.h" |
. |
#include "nsIView.h" |
#include "nsIWidget.h" |
. |
#include "nsIWidget.h" |
#include "nsGfxCIID.h" |
. |
#include "nsGfxCIID.h" |
#include "nsLayoutAtoms.h" |
. |
#include "nsLayoutAtoms.h" |
#include "prlog.h" |
. |
#include "prlog.h" |
|
. |
#include "nsIPrintSettings.h" |
// Print Options |
. |
  |
#include "nsIPrintOptions.h" |
. |
  |
#include "nsGfxCIID.h" |
. |
  |
#include "nsIServiceManager.h" |
. |
  |
static NS_DEFINE_CID(kPrintOptionsCID, NS_PRINTOPTIONS_CID); |
. |
  |
|
. |
|
class PrintPreviewContext : public nsPresContext { |
. |
class PrintPreviewContext : public nsPresContext { |
public: |
. |
public: |
PrintPreviewContext(); |
. |
PrintPreviewContext(); |
~PrintPreviewContext(); |
. |
~PrintPreviewContext(); |
Skipping to line 59 | . | |
NS_IMETHOD IsPaginated(PRBool* aResult); |
. |
NS_IMETHOD IsPaginated(PRBool* aResult); |
NS_IMETHOD SetPaginatedScrolling(PRBool aResult) { mCanPaginatedScroll = aRe
sult; return NS_OK; } |
. |
NS_IMETHOD SetPaginatedScrolling(PRBool aResult) { mCanPaginatedScroll = aRe
sult; return NS_OK; } |
NS_IMETHOD GetPaginatedScrolling(PRBool* aResult); |
. |
NS_IMETHOD GetPaginatedScrolling(PRBool* aResult); |
NS_IMETHOD GetPageDim(nsRect* aActualRect, nsRect* aAdjRect); |
. |
NS_IMETHOD GetPageDim(nsRect* aActualRect, nsRect* aAdjRect); |
NS_IMETHOD SetPageDim(nsRect* aRect); |
. |
NS_IMETHOD SetPageDim(nsRect* aRect); |
  |
. |
NS_IMETHOD SetPrintSettings(nsIPrintSettings* aPS); |
  |
. |
NS_IMETHOD GetPrintSettings(nsIPrintSettings** aPS); |
|
. |
|
protected: |
. |
protected: |
nsRect mPageDim; |
. |
nsRect mPageDim; |
PRBool mCanPaginatedScroll; |
. |
PRBool mCanPaginatedScroll; |
  |
. |
nsCOMPtr<nsIPrintSettings> mPrintSettings; |
}; |
. |
}; |
|
. |
|
PrintPreviewContext::PrintPreviewContext() : |
. |
PrintPreviewContext::PrintPreviewContext() : |
mPageDim(-1,-1,-1,-1), |
. |
mPageDim(-1,-1,-1,-1), |
mCanPaginatedScroll(PR_TRUE) |
. |
mCanPaginatedScroll(PR_TRUE) |
Skipping to line 140 | . | |
NS_IMETHODIMP |
. |
NS_IMETHODIMP |
PrintPreviewContext::SetPageDim(nsRect* aPageDim) |
. |
PrintPreviewContext::SetPageDim(nsRect* aPageDim) |
{ |
. |
{ |
NS_ENSURE_ARG_POINTER(aPageDim); |
. |
NS_ENSURE_ARG_POINTER(aPageDim); |
mPageDim = *aPageDim; |
. |
mPageDim = *aPageDim; |
  |
. |
return NS_OK; |
  |
. |
} |
  |
. |
|
  |
. |
NS_IMETHODIMP |
  |
. |
PrintPreviewContext::SetPrintSettings(nsIPrintSettings * aPrintSettings) |
  |
. |
{ |
  |
. |
NS_ENSURE_ARG_POINTER(aPrintSettings); |
  |
. |
mPrintSettings = aPrintSettings; |
  |
. |
return NS_OK; |
  |
. |
} |
  |
. |
|
  |
. |
NS_IMETHODIMP |
  |
. |
PrintPreviewContext::GetPrintSettings(nsIPrintSettings * *aPrintSettings) |
  |
. |
{ |
  |
. |
NS_ENSURE_ARG_POINTER(aPrintSettings); |
  |
. |
|
  |
. |
*aPrintSettings = mPrintSettings; |
  |
. |
NS_IF_ADDREF(*aPrintSettings); |
  |
. |
|
return NS_OK; |
. |
return NS_OK; |
} |
. |
} |
|
. |
|
NS_EXPORT nsresult |
. |
NS_EXPORT nsresult |
NS_NewPrintPreviewContext(nsIPresContext** aInstancePtrResult) |
. |
NS_NewPrintPreviewContext(nsIPresContext** aInstancePtrResult) |