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 315 of file print.hxx.

Constructor & Destructor Documentation

◆ PrinterController()

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

Definition at line 247 of file print3.cxx.

References mpImplData.

◆ ~PrinterController()

PrinterController::~PrinterController ( )
virtual

Definition at line 779 of file print3.cxx.

Member Function Documentation

◆ abortJob()

void PrinterController::abortJob ( )

Definition at line 1397 of file print3.cxx.

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

◆ createProgressDialog()

void PrinterController::createProgressDialog ( )

◆ dialogsParentClosing()

void PrinterController::dialogsParentClosing ( )

Definition at line 803 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 1821 of file print3.cxx.

References getValue().

Referenced by isDirectPrint(), and isShowDialogs().

◆ getFilteredPageCount()

int PrinterController::getFilteredPageCount ( ) const

Definition at line 1265 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 1830 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 1465 of file print3.cxx.

References mpImplData.

◆ getJobState()

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

Definition at line 783 of file print3.cxx.

References mpImplData.

◆ getMultipage()

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

Definition at line 1765 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 1007 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 1018 of file print3.cxx.

References getPageParameters(), and mpImplData.

Referenced by getPageFile().

◆ getPapersizeFromSetup()

bool PrinterController::getPapersizeFromSetup ( ) const

Definition at line 1435 of file print3.cxx.

References mpImplData.

Referenced by setupPrinter().

◆ getPrinter()

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

Definition at line 793 of file print3.cxx.

References mpImplData.

◆ getPrinterModified()

bool PrinterController::getPrinterModified ( ) const

Definition at line 1460 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 1509 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 1514 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 1521 of file print3.cxx.

References mpImplData.

◆ getWindow()

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

Definition at line 798 of file print3.cxx.

References mpImplData.

Referenced by createProgressDialog().

◆ isDirectPrint()

bool PrinterController::isDirectPrint ( ) const

Definition at line 1815 of file print3.cxx.

References getBoolProperty().

◆ isProgressCanceled()

bool PrinterController::isProgressCanceled ( ) const

Definition at line 1755 of file print3.cxx.

References mpImplData.

◆ isShowDialogs()

bool PrinterController::isShowDialogs ( ) const

Definition at line 1809 of file print3.cxx.

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

◆ isUIChoiceEnabled()

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

Definition at line 1669 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 1615 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 1393 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 1389 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 1683 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 1775 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 1770 of file print3.cxx.

References mpImplData.

Referenced by setupPrinter().

◆ resetPrinterOptions()

void PrinterController::resetPrinterOptions ( bool  i_bFileOutput)

Definition at line 850 of file print3.cxx.

References mpImplData.

◆ setJobState()

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

Definition at line 788 of file print3.cxx.

References mpImplData.

Referenced by abortJob(), and printFilteredPage().

◆ setLastPage()

void PrinterController::setLastPage ( bool  i_bLastPage)

Definition at line 1414 of file print3.cxx.

References mpImplData.

Referenced by abortJob().

◆ setMultipage()

void PrinterController::setMultipage ( const MultiPageSetup i_rMPS)

Definition at line 1760 of file print3.cxx.

References mpImplData.

◆ setOrientationFromUser()

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

Definition at line 1449 of file print3.cxx.

References mpImplData, and set().

◆ setPapersizeFromSetup()

void PrinterController::setPapersizeFromSetup ( bool  i_bPapersizeFromSetup)

Definition at line 1424 of file print3.cxx.

References mpImplData.

Referenced by setupPrinter().

◆ setPaperSizeFromUser()

void PrinterController::setPaperSizeFromUser ( Size  i_aUserSize)

Definition at line 1440 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 1455 of file print3.cxx.

References mpImplData.

◆ setReversePrint()

void PrinterController::setReversePrint ( bool  i_bReverse)

Definition at line 1419 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 1552 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 1537 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 1528 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: