Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions
CPageSetupPropSheet Class Reference

#include <CPageSetupPropSheet.h>

Collaboration diagram for CPageSetupPropSheet:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CPageSetupPropSheet (UINT nIDCaption, CWnd *pParentWnd=NULL, UINT iSelectPage=0)
 CPageSetupPropSheet (LPCTSTR pszCaption, CWnd *pParentWnd=NULL, UINT iSelectPage=0)
void SetPrintSettingsValues (nsIPrintSettings *aPrintSettings)
void GetPrintSettingsValues (nsIPrintSettings *aPrintSettings)
virtual ~CPageSetupPropSheet ()

Public Attributes

CFormatOptionTab m_FormatOptionTab
CMarginHeaderFooter m_MarginHeaderFooterTab

Protected Member Functions

void AddControlPages (void)

Detailed Description

Definition at line 46 of file CPageSetupPropSheet.h.


Constructor & Destructor Documentation

CPageSetupPropSheet::CPageSetupPropSheet ( UINT  nIDCaption,
CWnd *  pParentWnd = NULL,
UINT  iSelectPage = 0 
)

Definition at line 51 of file CPageSetupPropSheet.cpp.

       :CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
         AddControlPages();
}
CPageSetupPropSheet::CPageSetupPropSheet ( LPCTSTR  pszCaption,
CWnd *  pParentWnd = NULL,
UINT  iSelectPage = 0 
)

Definition at line 57 of file CPageSetupPropSheet.cpp.

       :CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
         AddControlPages();
}

Here is the call graph for this function:

Definition at line 63 of file CPageSetupPropSheet.cpp.

{
}

Member Function Documentation

Definition at line 78 of file CPageSetupPropSheet.cpp.

{
         m_psh.dwFlags &= ~PSH_HASHELP;  // Lose the Help button
         AddPage(&m_FormatOptionTab);
         AddPage(&m_MarginHeaderFooterTab);
}

Here is the caller graph for this function:

Definition at line 177 of file CPageSetupPropSheet.cpp.

{ 

    if (!aPrintSettings) return;

    aPrintSettings->SetScaling(double(m_FormatOptionTab.m_Scaling) / 100.0);
    aPrintSettings->SetPrintBGColors(m_FormatOptionTab.m_BGColors);
    aPrintSettings->SetPrintBGImages(m_FormatOptionTab.m_BGImages);

    PRInt32 orientation  = m_FormatOptionTab.m_IsLandScape?
                           nsIPrintSettings::kLandscapeOrientation:nsIPrintSettings::kPortraitOrientation;
    aPrintSettings->SetOrientation(orientation);

    short  type;
    double width;
    double height;
    m_FormatOptionTab.GetPaperSizeInfo(type, width, height);
    aPrintSettings->SetPaperSizeType(nsIPrintSettings::kPaperSizeDefined);
    aPrintSettings->SetPaperSizeUnit(type);
    aPrintSettings->SetPaperWidth(width);
    aPrintSettings->SetPaperHeight(height);

    aPrintSettings->SetMarginTop(GetFloatFromStr(m_MarginHeaderFooterTab.m_TopMarginText));
    aPrintSettings->SetMarginLeft(GetFloatFromStr(m_MarginHeaderFooterTab.m_LeftMarginText));
    aPrintSettings->SetMarginRight(GetFloatFromStr(m_MarginHeaderFooterTab.m_RightMarginText));
    aPrintSettings->SetMarginBottom(GetFloatFromStr(m_MarginHeaderFooterTab.m_BottomMarginText));

    PRUnichar* uStr;
    uStr = GetUnicodeFromCString(m_MarginHeaderFooterTab.m_HeaderLeftText);
    aPrintSettings->SetHeaderStrLeft(uStr);
    if (uStr != nsnull) nsMemory::Free(uStr);

    uStr = GetUnicodeFromCString(m_MarginHeaderFooterTab.m_HeaderCenterText);
    aPrintSettings->SetHeaderStrCenter(uStr);
    if (uStr != nsnull) nsMemory::Free(uStr);

    uStr = GetUnicodeFromCString(m_MarginHeaderFooterTab.m_HeaderRightText);
    aPrintSettings->SetHeaderStrRight(uStr);
    if (uStr != nsnull) nsMemory::Free(uStr);

    uStr = GetUnicodeFromCString(m_MarginHeaderFooterTab.m_FooterLeftText);
    aPrintSettings->SetFooterStrLeft(uStr);
    if (uStr != nsnull) nsMemory::Free(uStr);

    uStr = GetUnicodeFromCString(m_MarginHeaderFooterTab.m_FooterCenterText);
    aPrintSettings->SetFooterStrCenter(uStr);
    if (uStr != nsnull) nsMemory::Free(uStr);

    uStr = GetUnicodeFromCString(m_MarginHeaderFooterTab.m_FooterRightText);
    aPrintSettings->SetFooterStrRight(uStr);
    if (uStr != nsnull) nsMemory::Free(uStr);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 113 of file CPageSetupPropSheet.cpp.

{ 
  m_FormatOptionTab.m_PrintSettings = aPrintSettings;

  if (aPrintSettings != NULL) 
  {
    double top, left, right, bottom;
    aPrintSettings->GetMarginTop(&top);
    aPrintSettings->GetMarginLeft(&left);
    aPrintSettings->GetMarginRight(&right);
    aPrintSettings->GetMarginBottom(&bottom);

    char buf[16];
    sprintf(buf, "%5.2f", top);
    m_MarginHeaderFooterTab.m_TopMarginText = buf;
    sprintf(buf, "%5.2f", left);
    m_MarginHeaderFooterTab.m_LeftMarginText = buf;
    sprintf(buf, "%5.2f", right);
    m_MarginHeaderFooterTab.m_RightMarginText = buf;
    sprintf(buf, "%5.2f", bottom);
    m_MarginHeaderFooterTab.m_BottomMarginText = buf;

    PRInt32 orientation;
    aPrintSettings->GetOrientation(&orientation);
    m_FormatOptionTab.m_IsLandScape = orientation != nsIPrintSettings::kPortraitOrientation;

    double scaling;
    aPrintSettings->GetScaling(&scaling);
         m_FormatOptionTab.m_Scaling = int(scaling * 100.0);

    PRBool boolVal;
    aPrintSettings->GetPrintBGColors(&boolVal);
    m_FormatOptionTab.m_BGColors = boolVal == PR_TRUE;
    aPrintSettings->GetPrintBGImages(&boolVal);
    m_FormatOptionTab.m_BGImages = boolVal == PR_TRUE;

    PRUnichar* uStr;
    aPrintSettings->GetHeaderStrLeft(&uStr);
              m_MarginHeaderFooterTab.m_HeaderLeftText = uStr;
    if (uStr != nsnull) nsMemory::Free(uStr);

    aPrintSettings->GetHeaderStrCenter(&uStr);
              m_MarginHeaderFooterTab.m_HeaderCenterText = uStr;
    if (uStr != nsnull) nsMemory::Free(uStr);

    aPrintSettings->GetHeaderStrRight(&uStr);
              m_MarginHeaderFooterTab.m_HeaderRightText = uStr;
    if (uStr != nsnull) nsMemory::Free(uStr);

    aPrintSettings->GetFooterStrLeft(&uStr);
              m_MarginHeaderFooterTab.m_FooterLeftText = uStr;
    if (uStr != nsnull) nsMemory::Free(uStr);

    aPrintSettings->GetFooterStrCenter(&uStr);
              m_MarginHeaderFooterTab.m_FooterCenterText = uStr;
    if (uStr != nsnull) nsMemory::Free(uStr);

    aPrintSettings->GetFooterStrRight(&uStr);
              m_MarginHeaderFooterTab.m_FooterRightText = uStr;
    if (uStr != nsnull) nsMemory::Free(uStr);
  }
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 63 of file CPageSetupPropSheet.h.

Definition at line 64 of file CPageSetupPropSheet.h.


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