LibreOffice Module vcl (master) 1
Classes | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
vcl::PrinterController Class Referenceabstract

#include <print.hxx>

Classes

struct  MultiPageSetup
 
struct  PageSize
 

Public Member Functions

virtual ~PrinterController ()
 
const VclPtr< Printer > & getPrinter () const
 
weld::WindowgetWindow () const
 
css::uno::Sequence< css::beans::PropertyValue > getJobProperties (const css::uno::Sequence< css::beans::PropertyValue > &i_rMergeList) const
 For implementations: get current job properties as changed by e.g. More...
 
css::beans::PropertyValue * getValue (const OUString &i_rPropertyName)
 Get the PropertyValue of a Property. More...
 
const css::beans::PropertyValue * getValue (const OUString &i_rPropertyName) const
 
bool getBoolProperty (const OUString &i_rPropertyName, bool i_bFallback) const
 Get a bool property. More...
 
sal_Int32 getIntProperty (const OUString &i_rPropertyName, sal_Int32 i_nFallback) const
 Get an int property. More...
 
void setValue (const OUString &i_rPropertyName, const css::uno::Any &i_rValue)
 Set a property value - can also be used to add another UI property. More...
 
void setValue (const css::beans::PropertyValue &i_rValue)
 
const css::uno::Sequence< css::beans::PropertyValue > & getUIOptions () const
 
void setUIOptions (const css::uno::Sequence< css::beans::PropertyValue > &)
 Set possible UI options. More...
 
bool isUIOptionEnabled (const OUString &rPropName) const
 Enable/disable an option; this can be used to implement dialog logic. More...
 
bool isUIChoiceEnabled (const OUString &rPropName, sal_Int32 nChoice) const
 
OUString makeEnabled (const OUString &rPropName)
 MakeEnabled will change the property rPropName depends on to the value. More...
 
virtual int getPageCount () const =0
 App must override this. More...
 
virtual css::uno::Sequence< css::beans::PropertyValue > getPageParameters (int i_nPage) const =0
 Get the page parameters. More...
 
virtual void printPage (int i_nPage) const =0
 App must override this. More...
 
virtual void jobStarted ()
 Will be called after a possible dialog has been shown and the real printjob starts. More...
 
virtual void jobFinished (css::view::PrintableState)
 
css::view::PrintableState getJobState () const
 
void abortJob ()
 
bool isShowDialogs () const
 
bool isDirectPrint () const
 
void dialogsParentClosing ()
 
int getFilteredPageCount () const
 
VCL_DLLPRIVATE PageSize getPageFile (int i_inUnfilteredPage, GDIMetaFile &rMtf, bool i_bMayUseCache=false)
 
PageSize getFilteredPageFile (int i_nFilteredPage, GDIMetaFile &o_rMtf, bool i_bMayUseCache=false)
 
void printFilteredPage (int i_nPage)
 
VCL_DLLPRIVATE void setPrinter (const VclPtr< Printer > &)
 
void createProgressDialog ()
 
bool isProgressCanceled () const
 
VCL_DLLPRIVATE void setMultipage (const MultiPageSetup &)
 
VCL_DLLPRIVATE const MultiPageSetupgetMultipage () const
 
void setLastPage (bool i_bLastPage)
 
VCL_DLLPRIVATE void setReversePrint (bool i_bReverse)
 
VCL_DLLPRIVATE void setPapersizeFromSetup (bool i_bPapersizeFromSetup)
 
VCL_DLLPRIVATE bool getPapersizeFromSetup () const
 
VCL_DLLPRIVATE void setPaperSizeFromUser (Size i_aUserSize)
 
VCL_DLLPRIVATE void setOrientationFromUser (Orientation eOrientation, bool set)
 
void setPrinterModified (bool i_bPapersizeFromSetup)
 
bool getPrinterModified () const
 
VCL_DLLPRIVATE void pushPropertiesToPrinter ()
 
VCL_DLLPRIVATE void resetPaperToLastConfigured ()
 
void setJobState (css::view::PrintableState)
 
VCL_DLLPRIVATE void setupPrinter (weld::Window *i_pDlgParent)
 
VCL_DLLPRIVATE int getPageCountProtected () const
 
VCL_DLLPRIVATE css::uno::Sequence< css::beans::PropertyValue > getPageParametersProtected (int i_nPage) const
 
VCL_DLLPRIVATE DrawModeFlags removeTransparencies (GDIMetaFile const &i_rIn, GDIMetaFile &o_rOut)
 
VCL_DLLPRIVATE void resetPrinterOptions (bool i_bFileOutput)
 

Protected Member Functions

 PrinterController (const VclPtr< Printer > &, weld::Window *pDialogParent)
 

Private Attributes

std::unique_ptr< ImplPrinterControllerDatampImplData
 

Detailed Description

Definition at line 316 of file print.hxx.

Constructor & Destructor Documentation

◆ PrinterController()

PrinterController::PrinterController ( const VclPtr< Printer > &  i_xPrinter,
weld::Window pDialogParent 
)
protected

Definition at line 248 of file print3.cxx.

References mpImplData.

◆ ~PrinterController()

PrinterController::~PrinterController ( )
virtual

Definition at line 789 of file print3.cxx.

Member Function Documentation

◆ abortJob()

void PrinterController::abortJob ( )

Definition at line 1407 of file print3.cxx.

References getPageFile(), mpImplData, RET_CANCEL, setJobState(), and setLastPage().

◆ createProgressDialog()

void PrinterController::createProgressDialog ( )

◆ dialogsParentClosing()

void PrinterController::dialogsParentClosing ( )

Definition at line 813 of file print3.cxx.

References mpImplData, and RET_OK.

◆ getBoolProperty()

bool PrinterController::getBoolProperty ( const OUString &  i_rPropertyName,
bool  i_bFallback 
) const

Get a bool property.

in case the property is unknown or not convertible to bool, i_bFallback is returned

Definition at line 1831 of file print3.cxx.

References getValue().

Referenced by isDirectPrint(), and isShowDialogs().

◆ getFilteredPageCount()

int PrinterController::getFilteredPageCount ( ) const

Definition at line 1275 of file print3.cxx.

References getPageCountProtected(), and mpImplData.

Referenced by getFilteredPageFile().

◆ getFilteredPageFile()

PrinterController::PageSize PrinterController::getFilteredPageFile ( int  i_nFilteredPage,
GDIMetaFile o_rMtf,
bool  i_bMayUseCache = false 
)

◆ getIntProperty()

sal_Int32 PrinterController::getIntProperty ( const OUString &  i_rPropertyName,
sal_Int32  i_nFallback 
) const

Get an int property.

in case the property is unknown or not convertible to bool, i_nFallback is returned

Definition at line 1840 of file print3.cxx.

References getValue().

◆ getJobProperties()

css::uno::Sequence< css::beans::PropertyValue > PrinterController::getJobProperties ( const css::uno::Sequence< css::beans::PropertyValue > &  i_rMergeList) const

For implementations: get current job properties as changed by e.g.

print dialog

this gets the current set of properties initially told to Printer::PrintJob

For convenience a second sequence will be merged in to get a combined sequence. In case of duplicate property names, the value of i_MergeList wins.

Definition at line 1475 of file print3.cxx.

References mpImplData.

◆ getJobState()

css::view::PrintableState PrinterController::getJobState ( ) const

Definition at line 793 of file print3.cxx.

References mpImplData.

◆ getMultipage()

const PrinterController::MultiPageSetup & PrinterController::getMultipage ( ) const

Definition at line 1775 of file print3.cxx.

References mpImplData.

◆ getPageCount()

virtual int vcl::PrinterController::getPageCount ( ) const
pure virtual

App must override this.

Referenced by getPageCountProtected().

◆ getPageCountProtected()

int PrinterController::getPageCountProtected ( ) const

Definition at line 1017 of file print3.cxx.

References getPageCount(), and mpImplData.

Referenced by createProgressDialog(), getFilteredPageCount(), and getFilteredPageFile().

◆ getPageFile()

PrinterController::PageSize PrinterController::getPageFile ( int  i_inUnfilteredPage,
GDIMetaFile rMtf,
bool  i_bMayUseCache = false 
)

◆ getPageParameters()

virtual css::uno::Sequence< css::beans::PropertyValue > vcl::PrinterController::getPageParameters ( int  i_nPage) const
pure virtual

Get the page parameters.

namely the jobsetup that should be active for the page (describing among others the physical page size) and the "page size". In writer case this would probably be the same as the JobSetup since writer sets the page size draw/impress for example print their page on the paper set on the printer, possibly adjusting the page size to fit. That means the page size can be different from the paper size.

App must override this

Returns
Page size in 1/100th mm

Referenced by getPageParametersProtected().

◆ getPageParametersProtected()

css::uno::Sequence< css::beans::PropertyValue > PrinterController::getPageParametersProtected ( int  i_nPage) const

Definition at line 1028 of file print3.cxx.

References getPageParameters(), and mpImplData.

Referenced by getPageFile().

◆ getPapersizeFromSetup()

bool PrinterController::getPapersizeFromSetup ( ) const

Definition at line 1445 of file print3.cxx.

References mpImplData.

Referenced by setupPrinter().

◆ getPrinter()

const VclPtr< Printer > & PrinterController::getPrinter ( ) const

Definition at line 803 of file print3.cxx.

References mpImplData.

◆ getPrinterModified()

bool PrinterController::getPrinterModified ( ) const

Definition at line 1470 of file print3.cxx.

References mpImplData.

Referenced by setupPrinter().

◆ getUIOptions()

const css::uno::Sequence< css::beans::PropertyValue > & PrinterController::getUIOptions ( ) const
Returns
The currently active UI options. These are the same that were passed to setUIOptions.

Definition at line 1519 of file print3.cxx.

References mpImplData.

◆ getValue() [1/2]

css::beans::PropertyValue * PrinterController::getValue ( const OUString &  i_rPropertyName)

Get the PropertyValue of a Property.

Definition at line 1524 of file print3.cxx.

References mpImplData.

Referenced by createProgressDialog(), getBoolProperty(), getIntProperty(), isUIOptionEnabled(), makeEnabled(), and pushPropertiesToPrinter().

◆ getValue() [2/2]

const css::beans::PropertyValue * PrinterController::getValue ( const OUString &  i_rPropertyName) const

Definition at line 1531 of file print3.cxx.

References mpImplData.

◆ getWindow()

weld::Window * PrinterController::getWindow ( ) const

Definition at line 808 of file print3.cxx.

References mpImplData.

Referenced by createProgressDialog().

◆ isDirectPrint()

bool PrinterController::isDirectPrint ( ) const

Definition at line 1825 of file print3.cxx.

References getBoolProperty().

◆ isProgressCanceled()

bool PrinterController::isProgressCanceled ( ) const

Definition at line 1765 of file print3.cxx.

References mpImplData.

◆ isShowDialogs()

bool PrinterController::isShowDialogs ( ) const

Definition at line 1819 of file print3.cxx.

References getBoolProperty(), and Application::IsHeadlessModeEnabled().

◆ isUIChoiceEnabled()

bool PrinterController::isUIChoiceEnabled ( const OUString &  rPropName,
sal_Int32  nChoice 
) const

Definition at line 1679 of file print3.cxx.

References mpImplData.

◆ isUIOptionEnabled()

bool PrinterController::isUIOptionEnabled ( const OUString &  rPropName) const

Enable/disable an option; this can be used to implement dialog logic.

Definition at line 1625 of file print3.cxx.

References getValue(), isUIOptionEnabled(), and mpImplData.

Referenced by isUIOptionEnabled(), and makeEnabled().

◆ jobFinished()

void PrinterController::jobFinished ( css::view::PrintableState  )
virtual

Definition at line 1403 of file print3.cxx.

◆ jobStarted()

void PrinterController::jobStarted ( )
virtual

Will be called after a possible dialog has been shown and the real printjob starts.

Definition at line 1399 of file print3.cxx.

◆ makeEnabled()

OUString PrinterController::makeEnabled ( const OUString &  rPropName)

MakeEnabled will change the property rPropName depends on to the value.

that makes rPropName enabled. If the dependency itself is also disabled, no action will be performed.

Returns
The property name rPropName depends on or an empty string if no change was made.

Definition at line 1693 of file print3.cxx.

References getValue(), isUIOptionEnabled(), mpImplData, and setValue().

◆ printFilteredPage()

void PrinterController::printFilteredPage ( int  i_nPage)

◆ printPage()

virtual void vcl::PrinterController::printPage ( int  i_nPage) const
pure virtual

App must override this.

Referenced by getPageFile().

◆ pushPropertiesToPrinter()

void PrinterController::pushPropertiesToPrinter ( )

Definition at line 1785 of file print3.cxx.

References getValue(), LongEdge, mpImplData, Off, and ShortEdge.

◆ removeTransparencies()

DrawModeFlags PrinterController::removeTransparencies ( GDIMetaFile const &  i_rIn,
GDIMetaFile o_rOut 
)

◆ resetPaperToLastConfigured()

void PrinterController::resetPaperToLastConfigured ( )

Definition at line 1780 of file print3.cxx.

References mpImplData.

Referenced by setupPrinter().

◆ resetPrinterOptions()

void PrinterController::resetPrinterOptions ( bool  i_bFileOutput)

Definition at line 860 of file print3.cxx.

References mpImplData.

◆ setJobState()

void PrinterController::setJobState ( css::view::PrintableState  i_eState)

Definition at line 798 of file print3.cxx.

References mpImplData.

Referenced by abortJob(), and printFilteredPage().

◆ setLastPage()

void PrinterController::setLastPage ( bool  i_bLastPage)

Definition at line 1424 of file print3.cxx.

References mpImplData.

Referenced by abortJob().

◆ setMultipage()

void PrinterController::setMultipage ( const MultiPageSetup i_rMPS)

Definition at line 1770 of file print3.cxx.

References mpImplData.

◆ setOrientationFromUser()

void PrinterController::setOrientationFromUser ( Orientation  eOrientation,
bool  set 
)

Definition at line 1459 of file print3.cxx.

References mpImplData, and set().

◆ setPapersizeFromSetup()

void PrinterController::setPapersizeFromSetup ( bool  i_bPapersizeFromSetup)

Definition at line 1434 of file print3.cxx.

References mpImplData.

Referenced by setupPrinter().

◆ setPaperSizeFromUser()

void PrinterController::setPaperSizeFromUser ( Size  i_aUserSize)

Definition at line 1450 of file print3.cxx.

References mpImplData.

◆ setPrinter()

void PrinterController::setPrinter ( const VclPtr< Printer > &  i_rPrinter)

◆ setPrinterModified()

void PrinterController::setPrinterModified ( bool  i_bPapersizeFromSetup)

Definition at line 1465 of file print3.cxx.

References mpImplData.

◆ setReversePrint()

void PrinterController::setReversePrint ( bool  i_bReverse)

Definition at line 1429 of file print3.cxx.

References mpImplData.

◆ setUIOptions()

void PrinterController::setUIOptions ( const css::uno::Sequence< css::beans::PropertyValue > &  i_rOptions)

Set possible UI options.

should only be done once before passing the PrinterListener to Printer::PrintJob

Definition at line 1562 of file print3.cxx.

References aPropName, bIsEnabled, DBG_ASSERT, vcl::ImplPrinterControllerData::ControlDependency::maDependsOnName, vcl::ImplPrinterControllerData::ControlDependency::mnDependsOnEntry, mpImplData, SAL_WARN_IF, and setValue().

◆ setupPrinter()

void PrinterController::setupPrinter ( weld::Window i_pDlgParent)

◆ setValue() [1/2]

void PrinterController::setValue ( const css::beans::PropertyValue &  i_rValue)

Definition at line 1547 of file print3.cxx.

References mpImplData.

◆ setValue() [2/2]

void PrinterController::setValue ( const OUString &  i_rPropertyName,
const css::uno::Any &  i_rValue 
)

Set a property value - can also be used to add another UI property.

Definition at line 1538 of file print3.cxx.

References setValue().

Referenced by makeEnabled(), setPrinter(), setUIOptions(), and setValue().

Member Data Documentation

◆ mpImplData

std::unique_ptr<ImplPrinterControllerData> vcl::PrinterController::mpImplData
private

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