Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes
nsPresContext Class Reference

#include <nsPresContext.h>

Inheritance diagram for nsPresContext:
Inheritance graph
[legend]
Collaboration diagram for nsPresContext:
Collaboration graph
[legend]

List of all members.

Classes

struct  ScrollbarStyles

Public Types

enum  nsPresContextType { eContext_Galley, eContext_PrintPreview, eContext_Print }

Public Member Functions

 nsPresContext (nsPresContextType aType) NS_HIDDEN
 NS_HIDDEN_ (nsresult) Init(nsIDeviceContext *aDeviceContext)
 Initialize the presentation context from a particular device.
 NS_HIDDEN_ (void) SetShell(nsIPresShell *aShell)
 Set the presentation shell that this context is bound to.
 NS_HIDDEN_ (nsPresContextType) Type() const
nsIPresShellPresShell () const
 Get the PresentationShell that this context is bound to.
nsIPresShellGetPresShell () const
nsIDocumentGetDocument ()
nsIViewManagerGetViewManager ()
nsCompatibility CompatibilityMode () const
 Access compatibility mode for this context.
 NS_HIDDEN_ (void) SetCompatibilityMode(nsCompatibility aMode)
PRUint16 ImageAnimationMode () const
 Access the image animation mode for this context.
virtual NS_HIDDEN_ (void) SetImageAnimationModeExternal(PRUint16 aMode)
 NS_HIDDEN_ (void) SetImageAnimationModeInternal(PRUint16 aMode)
void SetImageAnimationMode (PRUint16 aMode)
nsILookAndFeelLookAndFeel ()
 Get cached look and feel service.
nsIAtomMedium ()
 Get medium of presentation.
 NS_HIDDEN_ (void) ClearStyleDataAndReflow()
 Clear style data from the root frame downwards, and reflow.
voidAllocateFromShell (size_t aSize)
void FreeToShell (size_t aSize, void *aFreeChunk)
virtual NS_HIDDEN_ (already_AddRefed< nsIFontMetrics >) GetMetricsForExternal(const nsFont &aFont)
 Get the font metrics for a given font.
 GetMetricsForInternal (const nsFont &aFont)
already_AddRefed< nsIFontMetricsGetMetricsFor (const nsFont &aFont)
virtual NS_HIDDEN_ (const nsFont *) GetDefaultFontExternal(PRUint8 aFontID) const
 Get the default font correponding to the given ID.
 NS_HIDDEN_ (const nsFont *) GetDefaultFontInternal(PRUint8 aFontID) const
const nsFontGetDefaultFont (PRUint8 aFontID) const
PRBool GetCachedBoolPref (PRUint32 aPrefType) const
 Get a cached boolean pref, by its type.
PRInt32 GetCachedIntPref (PRUint32 aPrefType) const
 Get a cached integer pref, by its type.
PRInt32 FontScaler () const
 Access Nav's magic font scaler value.
const nscolor DefaultColor () const
 Get the default colors.
const nscolor DefaultBackgroundColor () const
const nscolor DefaultLinkColor () const
const nscolor DefaultActiveLinkColor () const
const nscolor DefaultVisitedLinkColor () const
const nscolor FocusBackgroundColor () const
const nscolor FocusTextColor () const
PRBool GetUseFocusColors () const
PRUint8 FocusRingWidth () const
PRBool GetFocusRingOnAnything () const
 NS_HIDDEN_ (imgIRequest *) LoadImage(imgIRequest *aImage
 Load an image for the target frame.
 NS_HIDDEN_ (void) StopImagesFor(nsIFrame *aTargetFrame)
 This method is called when a frame is being destroyed to ensure that the image load gets disassociated from the prescontext.
 NS_HIDDEN_ (void) SetContainer(nsISupports *aContainer)
virtual NS_HIDDEN_ (already_AddRefed< nsISupports >) GetContainerExternal()
 NS_HIDDEN_ (already_AddRefed< nsISupports >) GetContainerInternal()
already_AddRefed< nsISupports > GetContainer ()
void SetLinkHandler (nsILinkHandler *aHandler)
nsILinkHandlerGetLinkHandler ()
nsRect GetVisibleArea ()
 Get the visible area associated with this presentation context.
void SetVisibleArea (const nsRect &r)
 Set the currently visible area.
PRBool IsPaginated () const
 Return true if this presentation context is a paginated context.
 NS_HIDDEN_ (void) SetPaginatedScrolling(PRBool aResult)
 Sets whether the presentation context can scroll for a paginated context.
PRBool HasPaginatedScrolling () const
 Return true if this presentation context can scroll for paginated context.
 NS_HIDDEN_ (void) GetPageDim(nsRect *aActualRect
 Gets the rect for the page dimensions, this includes X,Y Offsets which are used to determine the inclusion of margins Also, indicates whether the size has been overridden.
 NS_HIDDEN_ (void) SetPageDim(const nsRect &aRect)
 Sets the "adjusted" rect for the page Dimimensions, this includes X,Y Offsets which are used to determine the inclusion of margins.
float PixelsToTwips () const
float TwipsToPixels () const
 NS_HIDDEN_ (float) TwipsToPixelsForFonts() const
 NS_HIDDEN_ (float) ScaledPixelsToTwips() const
 Do pixels to twips conversion taking into account differing size of a "pixel" from device to device.
nscoord IntScaledPixelsToTwips (nscoord aPixels) const
void SetScalingOfTwips (PRBool aOn)
nsIDeviceContextDeviceContext ()
nsIEventStateManagerEventStateManager ()
nsIAtomGetLangGroup ()
float TextZoom ()
void SetTextZoomInternal (float aZoom)
virtual NS_HIDDEN_ (void) SetTextZoomExternal(float aZoom)
void SetTextZoom (float aZoom)
nsLanguageSpecificTransformType LanguageSpecificTransformType () const
 Get the language-specific transform type for the current document.
void SetViewportOverflowOverride (PRUint8 aX, PRUint8 aY)
ScrollbarStyles GetViewportOverflowOverride ()
PRBool GetBackgroundImageDraw () const
 Set and get methods for controling the background drawing.
void SetBackgroundImageDraw (PRBool aCanDraw)
PRBool GetBackgroundColorDraw () const
void SetBackgroundColorDraw (PRBool aCanDraw)
void SetIsRenderingOnlySelection (PRBool aResult)
 Render only Selection.
PRBool IsRenderingOnlySelection () const
 NS_HIDDEN_ (nsITheme *) GetTheme()
 NS_HIDDEN_ (void) ThemeChanged()
 NS_HIDDEN_ (void) SysColorChanged()
 NS_HIDDEN_ (void) SetPrintSettings(nsIPrintSettings *aPrintSettings)
 Printing methods below should only be used for Medium() == print.
nsIPrintSettingsGetPrintSettings ()
nsPropertyTablePropertyTable ()
 NS_HIDDEN_ (PRBool) EnsureVisible(PRBool aUnsuppressFocus)
const nscoordGetBorderWidthTable ()
 This table maps border-width enums 'thin', 'medium', 'thick' to actual nscoord values.
PRBool IsChrome ()
void observe (in nsISupports aSubject, in string aTopic, in wstring aData)
 Observe will be called when there is a notification for the topic |aTopic|.

Public Attributes

nsIFrameaTargetFrame
nsRectaAdjRect

Protected Types

enum  {
  eDefaultFont_Variable, eDefaultFont_Fixed, eDefaultFont_Serif, eDefaultFont_SansSerif,
  eDefaultFont_Monospace, eDefaultFont_Cursive, eDefaultFont_Fantasy, eDefaultFont_COUNT
}

Protected Member Functions

 NS_HIDDEN_ (void) SetImgAnimations(nsIContent *aParent
 NS_HIDDEN_ (void) GetDocumentColorPreferences()
 NS_HIDDEN_ (void) PreferenceChanged(const char *aPrefName)
static voidNS_HIDDEN_ (void) UpdateAfterPreferencesChanged()
 NS_HIDDEN_ (void) GetUserPreferences()
 NS_HIDDEN_ (void) GetFontPreferences()
 NS_HIDDEN_ (void) UpdateCharSet(const nsAFlatCString &aCharSet)
 ~nsPresContext () NS_HIDDEN

Static Protected Member Functions

static NS_HIDDEN_ (int) PR_CALLBACK PrefChangedCallback(const char *
static NS_HIDDEN_ (void) PR_CALLBACK PrefChangedUpdateTimerCallback(nsITimer *aTimer

Protected Attributes

PRUint16 aMode
static voidaClosure
nsPresContextType mType
nsIPresShellmShell
nsIDeviceContextmDeviceContext
nsIEventStateManagermEventManager
nsILookAndFeelmLookAndFeel
nsIAtommMedium
nsILinkHandlermLinkHandler
nsIAtommLangGroup
nsSupportsHashtable mImageLoaders
nsWeakPtr mContainer
float mTextZoom
nsCOMPtr< nsIThememTheme
nsCOMPtr< nsILanguageAtomServicemLangService
nsCOMPtr< nsIPrintSettingsmPrintSettings
nsCOMPtr< nsITimermPrefChangedTimer
nsPropertyTable mPropertyTable
nsLanguageSpecificTransformType mLanguageSpecificTransformType
PRInt32 mFontScaler
nscoord mMinimumFontSize
nsRect mVisibleArea
nsRect mPageDim
nscolor mDefaultColor
nscolor mBackgroundColor
nscolor mLinkColor
nscolor mActiveLinkColor
nscolor mVisitedLinkColor
nscolor mFocusBackgroundColor
nscolor mFocusTextColor
ScrollbarStyles mViewportStyleOverflow
PRUint8 mFocusRingWidth
nsCompatibility mCompatibilityMode
PRUint16 mImageAnimationMode
PRUint16 mImageAnimationModePref
nsFont mDefaultVariableFont
nsFont mDefaultFixedFont
nsFont mDefaultSerifFont
nsFont mDefaultSansSerifFont
nsFont mDefaultMonospaceFont
nsFont mDefaultCursiveFont
nsFont mDefaultFantasyFont
nscoord mBorderWidthTable [3]
unsigned mUseDocumentFonts: 1
unsigned mUseDocumentColors: 1
unsigned mUnderlineLinks: 1
unsigned mUseFocusColors: 1
unsigned mFocusRingOnAnything: 1
unsigned mDrawImageBackground: 1
unsigned mDrawColorBackground: 1
unsigned mNeverAnimate: 1
unsigned mIsRenderingOnlySelection: 1
unsigned mNoTheme: 1
unsigned mPaginated: 1
unsigned mCanPaginatedScroll: 1
unsigned mDoScaledTwips: 1
unsigned mEnableJapaneseTransform: 1

Detailed Description

Definition at line 128 of file nsPresContext.h.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
eDefaultFont_Variable 
eDefaultFont_Fixed 
eDefaultFont_Serif 
eDefaultFont_SansSerif 
eDefaultFont_Monospace 
eDefaultFont_Cursive 
eDefaultFont_Fantasy 
eDefaultFont_COUNT 

Definition at line 746 of file nsPresContext.h.

Enumerator:
eContext_Galley 
eContext_PrintPreview 
eContext_Print 

Definition at line 134 of file nsPresContext.h.

                         {
    eContext_Galley,       // unpaginated screen presentation
    eContext_PrintPreview, // paginated screen presentation
    eContext_Print         // paginated printer presentation
  };

Constructor & Destructor Documentation

Definition at line 156 of file nsPresContext.cpp.

  : mType(aType),
    mTextZoom(1.0),
    mViewportStyleOverflow(NS_STYLE_OVERFLOW_AUTO, NS_STYLE_OVERFLOW_AUTO),
    mCompatibilityMode(eCompatibility_FullStandards),
    mImageAnimationModePref(imgIContainer::kNormalAnimMode),
    mDefaultVariableFont("serif", NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,
                         NS_FONT_WEIGHT_NORMAL, 0, NSIntPointsToTwips(12)),
    mDefaultFixedFont("monospace", NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,
                      NS_FONT_WEIGHT_NORMAL, 0, NSIntPointsToTwips(10)),
    mDefaultSerifFont("serif", NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,
                      NS_FONT_WEIGHT_NORMAL, 0, NSIntPointsToTwips(12)),
    mDefaultSansSerifFont("sans-serif", NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,
                          NS_FONT_WEIGHT_NORMAL, 0, NSIntPointsToTwips(12)),
    mDefaultMonospaceFont("monospace", NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,
                          NS_FONT_WEIGHT_NORMAL, 0, NSIntPointsToTwips(10)),
    mDefaultCursiveFont("cursive", NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,
                        NS_FONT_WEIGHT_NORMAL, 0, NSIntPointsToTwips(12)),
    mDefaultFantasyFont("fantasy", NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,
                        NS_FONT_WEIGHT_NORMAL, 0, NSIntPointsToTwips(12))
{
  // NOTE! nsPresContext::operator new() zeroes out all members, so don't
  // bother initializing members to 0.

  mDoScaledTwips = PR_TRUE;

  SetBackgroundImageDraw(PR_TRUE);        // always draw the background
  SetBackgroundColorDraw(PR_TRUE);

  mBackgroundColor = NS_RGB(0xFF, 0xFF, 0xFF);
  
  mUseDocumentColors = PR_TRUE;
  mUseDocumentFonts = PR_TRUE;

  // the minimum font-size is unconstrained by default

  mLinkColor = NS_RGB(0x00, 0x00, 0xEE);
  mActiveLinkColor = NS_RGB(0xEE, 0x00, 0x00);
  mVisitedLinkColor = NS_RGB(0x55, 0x1A, 0x8B);
  mUnderlineLinks = PR_TRUE;

  mFocusTextColor = mDefaultColor;
  mFocusBackgroundColor = mBackgroundColor;
  mFocusRingWidth = 1;

  mLanguageSpecificTransformType = eLanguageSpecificTransformType_Unknown;
  if (aType == eContext_Galley) {
    mMedium = nsLayoutAtoms::screen;
    mImageAnimationMode = imgIContainer::kNormalAnimMode;
  } else {
    SetBackgroundImageDraw(PR_FALSE);
    SetBackgroundColorDraw(PR_FALSE);
    mImageAnimationMode = imgIContainer::kDontAnimMode;
    mNeverAnimate = PR_TRUE;
    mMedium = nsLayoutAtoms::print;
    mPaginated = PR_TRUE;
    if (aType == eContext_PrintPreview) {
      mCanPaginatedScroll = PR_TRUE;
      mPageDim.SetRect(-1, -1, -1, -1);
    } else {
      mPageDim.SetRect(0, 0, 0, 0);
    }
  }
}

Here is the call graph for this function:

Definition at line 221 of file nsPresContext.cpp.

{
  mImageLoaders.Enumerate(destroy_loads);

  NS_PRECONDITION(!mShell, "Presshell forgot to clear our mShell pointer");
  SetShell(nsnull);

  if (mEventManager) {
    mEventManager->SetPresContext(nsnull);   // unclear if this is needed, but can't hurt
    NS_RELEASE(mEventManager);
  }

  if (mPrefChangedTimer)
  {
    mPrefChangedTimer->Cancel();
    mPrefChangedTimer = nsnull;
  }

  // Unregister preference callbacks
  nsContentUtils::UnregisterPrefCallback("font.",
                                         nsPresContext::PrefChangedCallback,
                                         this);
  nsContentUtils::UnregisterPrefCallback("browser.display.",
                                         nsPresContext::PrefChangedCallback,
                                         this);
  nsContentUtils::UnregisterPrefCallback("browser.underline_anchors",
                                         nsPresContext::PrefChangedCallback,
                                         this);
  nsContentUtils::UnregisterPrefCallback("browser.anchor_color",
                                         nsPresContext::PrefChangedCallback,
                                         this);
  nsContentUtils::UnregisterPrefCallback("browser.active_color",
                                         nsPresContext::PrefChangedCallback,
                                         this);
  nsContentUtils::UnregisterPrefCallback("browser.visited_color",
                                         nsPresContext::PrefChangedCallback,
                                         this);
  nsContentUtils::UnregisterPrefCallback("image.animation_mode",
                                         nsPresContext::PrefChangedCallback,
                                         this);
#ifdef IBMBIDI
  nsContentUtils::UnregisterPrefCallback("bidi.", PrefChangedCallback, this);

  delete mBidiUtils;
#endif // IBMBIDI

  NS_IF_RELEASE(mDeviceContext);
  NS_IF_RELEASE(mLookAndFeel);
  NS_IF_RELEASE(mLangGroup);
}

Here is the call graph for this function:


Member Function Documentation

void* nsPresContext::AllocateFromShell ( size_t  aSize) [inline]

Definition at line 215 of file nsPresContext.h.

  {
    if (mShell)
      return mShell->AllocateFrame(aSize);
    return nsnull;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Access compatibility mode for this context.

All users must explicitly set the compatibility mode rather than relying on a default.

Definition at line 182 of file nsPresContext.h.

{ return mCompatibilityMode; }

Here is the caller graph for this function:

Definition at line 304 of file nsPresContext.h.

{ return mActiveLinkColor; }

Here is the caller graph for this function:

Definition at line 302 of file nsPresContext.h.

{ return mBackgroundColor; }

Here is the caller graph for this function:

Get the default colors.

Definition at line 301 of file nsPresContext.h.

{ return mDefaultColor; }

Here is the caller graph for this function:

Definition at line 303 of file nsPresContext.h.

{ return mLinkColor; }

Here is the caller graph for this function:

Definition at line 305 of file nsPresContext.h.

{ return mVisitedLinkColor; }

Here is the caller graph for this function:

Definition at line 418 of file nsPresContext.h.

{ return mDeviceContext; }

Here is the caller graph for this function:

Definition at line 419 of file nsPresContext.h.

{ return mEventManager; }

Definition at line 306 of file nsPresContext.h.

Here is the caller graph for this function:

Definition at line 310 of file nsPresContext.h.

{ return mFocusRingWidth; }

Here is the caller graph for this function:

Definition at line 307 of file nsPresContext.h.

{ return mFocusTextColor; }

Here is the caller graph for this function:

PRInt32 nsPresContext::FontScaler ( ) const [inline]

Access Nav's magic font scaler value.

Definition at line 296 of file nsPresContext.h.

{ return mFontScaler; }
void nsPresContext::FreeToShell ( size_t  aSize,
void aFreeChunk 
) [inline]

Definition at line 222 of file nsPresContext.h.

  {
    if (mShell)
      mShell->FreeFrame(aSize, aFreeChunk);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 476 of file nsPresContext.h.

Here is the caller graph for this function:

Set and get methods for controling the background drawing.

Definition at line 469 of file nsPresContext.h.

Here is the caller graph for this function:

This table maps border-width enums 'thin', 'medium', 'thick' to actual nscoord values.

Definition at line 627 of file nsPresContext.h.

{ return mBorderWidthTable; }

Here is the caller graph for this function:

PRBool nsPresContext::GetCachedBoolPref ( PRUint32  aPrefType) const [inline]

Get a cached boolean pref, by its type.

Definition at line 259 of file nsPresContext.h.

  {
    // If called with a constant parameter, the compiler should optimize
    // this switch statement away.
    switch (aPrefType) {
    case kPresContext_UseDocumentFonts:
      return mUseDocumentFonts;
    case kPresContext_UseDocumentColors:
      return mUseDocumentColors;
    case kPresContext_UnderlineLinks:
      return mUnderlineLinks;
    default:
      NS_ERROR("Invalid arg passed to GetCachedBoolPref");
    }

    return PR_FALSE;
  }

Here is the caller graph for this function:

PRInt32 nsPresContext::GetCachedIntPref ( PRUint32  aPrefType) const [inline]

Get a cached integer pref, by its type.

Definition at line 279 of file nsPresContext.h.

  {
    // If called with a constant parameter, the compiler should optimize
    // this switch statement away.
    switch (aPrefType) {
    case kPresContext_MinimumFontSize:
      return mMinimumFontSize;
    default:
      NS_ERROR("invalid arg passed to GetCachedIntPref");
    }

    return PR_FALSE;
  }

Here is the caller graph for this function:

already_AddRefed<nsISupports> nsPresContext::GetContainer ( ) [inline]

Definition at line 338 of file nsPresContext.h.

  { return GetContainerExternal(); }

Here is the caller graph for this function:

const nsFont* nsPresContext::GetDefaultFont ( PRUint8  aFontID) const [inline]

Definition at line 253 of file nsPresContext.h.

  { return GetDefaultFontExternal(aFontID); }

Here is the caller graph for this function:

Definition at line 167 of file nsPresContext.h.

{ return GetPresShell()->GetDocument(); } 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 311 of file nsPresContext.h.

Here is the caller graph for this function:

Definition at line 420 of file nsPresContext.h.

{ return mLangGroup; }

Here is the caller graph for this function:

Definition at line 344 of file nsPresContext.h.

{ return mLinkHandler; }

Here is the caller graph for this function:

Definition at line 239 of file nsPresContext.h.

  { return GetMetricsForExternal(aFont); }

Here is the caller graph for this function:

Definition at line 165 of file nsPresContext.h.

{ return mShell; }

Definition at line 600 of file nsPresContext.h.

{ return mPrintSettings; }

Here is the caller graph for this function:

Definition at line 309 of file nsPresContext.h.

{ return mUseFocusColors; }

Here is the caller graph for this function:

Definition at line 168 of file nsPresContext.h.

{ return GetPresShell()->GetViewManager(); } 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 461 of file nsPresContext.h.

Here is the caller graph for this function:

Get the visible area associated with this presentation context.

This is the size of the visiable area that is used for presenting the document. The returned value is in the standard nscoord units (as scaled by the device context).

Definition at line 352 of file nsPresContext.h.

{ return mVisibleArea; }

Here is the caller graph for this function:

Return true if this presentation context can scroll for paginated context.

Definition at line 376 of file nsPresContext.h.

{ return mCanPaginatedScroll; }

Here is the caller graph for this function:

Access the image animation mode for this context.

Definition at line 188 of file nsPresContext.h.

{ return mImageAnimationMode; }

Here is the caller graph for this function:

Definition at line 412 of file nsPresContext.h.

  { return NSIntPixelsToTwips(aPixels, ScaledPixelsToTwips()); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 8750 of file nsPresShell.cpp.

{
  PRBool isChrome = PR_FALSE;
  nsCOMPtr<nsISupports> container = GetContainer();
  if (container) {
    nsresult result;
    nsCOMPtr<nsIDocShellTreeItem> docShell(do_QueryInterface(container, &result));
    if (NS_SUCCEEDED(result) && docShell) {
      PRInt32 docShellType;
      result = docShell->GetItemType(&docShellType);
      if (NS_SUCCEEDED(result)) {
        isChrome = nsIDocShellTreeItem::typeChrome == docShellType;
      }
    }
  }
  return isChrome;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsPresContext::IsPaginated ( ) const [inline]

Return true if this presentation context is a paginated context.

Definition at line 364 of file nsPresContext.h.

{ return mPaginated; }

Here is the caller graph for this function:

Definition at line 577 of file nsPresContext.h.

Here is the caller graph for this function:

Get the language-specific transform type for the current document.

This tells us whether we need to perform special language-dependent transformations such as Unicode U+005C (backslash) to Japanese Yen Sign (Unicode U+00A5, JIS 0x5C).

Parameters:
aTypereturns type, must be non-NULL

Definition at line 444 of file nsPresContext.h.

Get cached look and feel service.

This is faster than obtaining it through the service manager.

Definition at line 203 of file nsPresContext.h.

{ return mLookAndFeel; }

Here is the caller graph for this function:

Get medium of presentation.

Definition at line 208 of file nsPresContext.h.

{ return mMedium; }

Here is the caller graph for this function:

Initialize the presentation context from a particular device.

Set the presentation shell that this context is bound to.

A presentation context may only be bound to a single shell.

Definition at line 154 of file nsPresContext.h.

{ return mType; }
virtual nsPresContext::NS_HIDDEN_ ( void  ) [virtual]

Clear style data from the root frame downwards, and reflow.

virtual nsPresContext::NS_HIDDEN_ ( already_AddRefed< nsIFontMetrics ) const [virtual]

Get the font metrics for a given font.

virtual nsPresContext::NS_HIDDEN_ ( const nsFont ) const [virtual]

Get the default font correponding to the given ID.

This object is read-only, you must copy the font to modify it.

Load an image for the target frame.

This call can be made repeated with only a single image ever being loaded. When the image's data is ready for rendering the target frame's Paint() method will be invoked (via the ViewManager) so that the appropriate damage repair is done.

This method is called when a frame is being destroyed to ensure that the image load gets disassociated from the prescontext.

virtual nsPresContext::NS_HIDDEN_ ( already_AddRefed< nsISupports >  ) [virtual]

Sets whether the presentation context can scroll for a paginated context.

Gets the rect for the page dimensions, this includes X,Y Offsets which are used to determine the inclusion of margins Also, indicates whether the size has been overridden.

Parameters:
aActualRectreturns the size of the actual device/surface
aRectreturns the adjusted size

Sets the "adjusted" rect for the page Dimimensions, this includes X,Y Offsets which are used to determine the inclusion of margins.

Parameters:
aRectreturns the adjusted size
nsPresContext::NS_HIDDEN_ ( float  ) const
nsPresContext::NS_HIDDEN_ ( float  ) const

Do pixels to twips conversion taking into account differing size of a "pixel" from device to device.

virtual nsPresContext::NS_HIDDEN_ ( void  ) [virtual]

Printing methods below should only be used for Medium() == print.

nsPresContext::NS_HIDDEN_ ( void  ) [protected]
nsPresContext::NS_HIDDEN_ ( void  ) [protected]
nsPresContext::NS_HIDDEN_ ( void  ) const [protected]
static nsPresContext::NS_HIDDEN_ ( int  ) const [static, protected]
static void* nsPresContext::NS_HIDDEN_ ( void  ) [protected]
static nsPresContext::NS_HIDDEN_ ( void  ) [static, protected]
nsPresContext::NS_HIDDEN_ ( void  ) [protected]
nsPresContext::NS_HIDDEN_ ( void  ) [protected]
nsPresContext::NS_HIDDEN_ ( void  ) const [protected]
void nsIObserver::observe ( in nsISupports  aSubject,
in string  aTopic,
in wstring  aData 
) [inherited]

Observe will be called when there is a notification for the topic |aTopic|.

This assumes that the object implementing this interface has been registered with an observer service such as the nsIObserverService.

If you expect multiple topics/subjects, the impl is responsible for filtering.

You should not modify, add, remove, or enumerate notifications in the implemention of observe.

Parameters:
aSubject: Notification specific interface pointer.
aTopic: The notification topic or subject.
aData: Notification specific wide string. subject event.
float nsPresContext::PixelsToTwips ( ) const [inline]

Definition at line 398 of file nsPresContext.h.

Here is the call graph for this function:

Get the PresentationShell that this context is bound to.

Definition at line 159 of file nsPresContext.h.

  {
    NS_ASSERTION(mShell, "Null pres shell");
    return mShell;
  }

Definition at line 603 of file nsPresContext.h.

{ return &mPropertyTable; }

Here is the caller graph for this function:

Definition at line 477 of file nsPresContext.h.

  {
    NS_ASSERTION(!(aCanDraw & ~1), "Value must be true or false");
    mDrawColorBackground = aCanDraw;
  }

Here is the caller graph for this function:

Definition at line 470 of file nsPresContext.h.

  {
    NS_ASSERTION(!(aCanDraw & ~1), "Value must be true or false");
    mDrawImageBackground = aCanDraw;
  }

Here is the caller graph for this function:

Definition at line 195 of file nsPresContext.h.

  { SetImageAnimationModeExternal(aMode); }

Render only Selection.

Definition at line 571 of file nsPresContext.h.

  {
    NS_ASSERTION(!(aResult & ~1), "Value must be true or false");
    mIsRenderingOnlySelection = aResult;
  }

Here is the caller graph for this function:

Definition at line 343 of file nsPresContext.h.

{ mLinkHandler = aHandler; }

Here is the caller graph for this function:

Definition at line 416 of file nsPresContext.h.

{ mDoScaledTwips = aOn; }

Here is the caller graph for this function:

void nsPresContext::SetTextZoom ( float  aZoom) [inline]

Definition at line 431 of file nsPresContext.h.

{ SetTextZoomExternal(aZoom); }
void nsPresContext::SetTextZoomInternal ( float  aZoom) [inline]

Definition at line 423 of file nsPresContext.h.

                                        {
    mTextZoom = aZoom;
    ClearStyleDataAndReflow();
  }

Definition at line 456 of file nsPresContext.h.

Here is the caller graph for this function:

Set the currently visible area.

The units for r are standard nscoord units (as scaled by the device context).

Definition at line 358 of file nsPresContext.h.

{ mVisibleArea = r; }

Here is the caller graph for this function:

float nsPresContext::TextZoom ( ) [inline]

Definition at line 422 of file nsPresContext.h.

{ return mTextZoom; }

Here is the caller graph for this function:

float nsPresContext::TwipsToPixels ( ) const [inline]

Definition at line 400 of file nsPresContext.h.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 387 of file nsPresContext.h.

Definition at line 640 of file nsPresContext.h.

Definition at line 633 of file nsPresContext.h.

Definition at line 322 of file nsPresContext.h.

Definition at line 693 of file nsPresContext.h.

Definition at line 690 of file nsPresContext.h.

Definition at line 714 of file nsPresContext.h.

unsigned nsPresContext::mCanPaginatedScroll [protected]

Definition at line 727 of file nsPresContext.h.

Definition at line 702 of file nsPresContext.h.

Definition at line 667 of file nsPresContext.h.

Definition at line 689 of file nsPresContext.h.

Definition at line 711 of file nsPresContext.h.

Definition at line 712 of file nsPresContext.h.

Definition at line 707 of file nsPresContext.h.

Definition at line 710 of file nsPresContext.h.

Definition at line 709 of file nsPresContext.h.

Definition at line 708 of file nsPresContext.h.

Definition at line 706 of file nsPresContext.h.

Definition at line 653 of file nsPresContext.h.

unsigned nsPresContext::mDoScaledTwips [protected]

Definition at line 728 of file nsPresContext.h.

Definition at line 722 of file nsPresContext.h.

Definition at line 721 of file nsPresContext.h.

Definition at line 729 of file nsPresContext.h.

Definition at line 658 of file nsPresContext.h.

Definition at line 696 of file nsPresContext.h.

Definition at line 720 of file nsPresContext.h.

Definition at line 700 of file nsPresContext.h.

Definition at line 697 of file nsPresContext.h.

Definition at line 683 of file nsPresContext.h.

Definition at line 703 of file nsPresContext.h.

Definition at line 704 of file nsPresContext.h.

nsSupportsHashtable nsPresContext::mImageLoaders [protected]

Definition at line 666 of file nsPresContext.h.

Definition at line 724 of file nsPresContext.h.

Definition at line 664 of file nsPresContext.h.

Definition at line 676 of file nsPresContext.h.

Definition at line 682 of file nsPresContext.h.

Definition at line 692 of file nsPresContext.h.

Definition at line 663 of file nsPresContext.h.

Definition at line 659 of file nsPresContext.h.

Definition at line 660 of file nsPresContext.h.

Definition at line 684 of file nsPresContext.h.

unsigned nsPresContext::mNeverAnimate [protected]

Definition at line 723 of file nsPresContext.h.

unsigned nsPresContext::mNoTheme [protected]

Definition at line 725 of file nsPresContext.h.

Definition at line 687 of file nsPresContext.h.

unsigned nsPresContext::mPaginated [protected]

Definition at line 726 of file nsPresContext.h.

Definition at line 678 of file nsPresContext.h.

Definition at line 677 of file nsPresContext.h.

Definition at line 680 of file nsPresContext.h.

Definition at line 652 of file nsPresContext.h.

float nsPresContext::mTextZoom [protected]

Definition at line 669 of file nsPresContext.h.

Definition at line 675 of file nsPresContext.h.

Definition at line 651 of file nsPresContext.h.

unsigned nsPresContext::mUnderlineLinks [protected]

Definition at line 718 of file nsPresContext.h.

unsigned nsPresContext::mUseDocumentColors [protected]

Definition at line 717 of file nsPresContext.h.

unsigned nsPresContext::mUseDocumentFonts [protected]

Definition at line 716 of file nsPresContext.h.

unsigned nsPresContext::mUseFocusColors [protected]

Definition at line 719 of file nsPresContext.h.

Definition at line 699 of file nsPresContext.h.

Definition at line 686 of file nsPresContext.h.

Definition at line 694 of file nsPresContext.h.


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