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>

Inheritance diagram for vcl::PrinterController:
[legend]

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
 
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 SizegetPaperSizeSetup () const
 
VCL_DLLPRIVATE void setPaperSizeFromUser (Size i_aUserSize)
 
VCL_DLLPRIVATE SizegetPaperSizeFromUser () const
 
VCL_DLLPRIVATE bool isPaperSizeFromUser () const
 
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 *)
 

Private Attributes

std::unique_ptr< ImplPrinterControllerDatampImplData
 

Detailed Description

Definition at line 392 of file print.hxx.

Constructor & Destructor Documentation

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

Definition at line 223 of file print3.cxx.

References mpImplData.

PrinterController::~PrinterController ( )
virtual

Definition at line 757 of file print3.cxx.

Member Function Documentation

void PrinterController::abortJob ( )

Definition at line 1342 of file print3.cxx.

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

void PrinterController::createProgressDialog ( )
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 1765 of file print3.cxx.

References getValue().

Referenced by isDirectPrint(), and isShowDialogs().

int PrinterController::getFilteredPageCount ( ) const

Definition at line 1210 of file print3.cxx.

References getPageCountProtected(), and mpImplData.

Referenced by getFilteredPageFile().

PrinterController::PageSize PrinterController::getFilteredPageFile ( int  i_nFilteredPage,
GDIMetaFile o_rMtf,
bool  i_bMayUseCache = false 
)
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 1774 of file print3.cxx.

References getValue().

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 1416 of file print3.cxx.

References mpImplData.

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

Definition at line 761 of file print3.cxx.

References mpImplData.

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

Definition at line 1715 of file print3.cxx.

References mpImplData.

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

App must override this.

Implemented in vcl::OldStylePrintAdaptor.

Referenced by getPageCountProtected().

int PrinterController::getPageCountProtected ( ) const

Definition at line 952 of file print3.cxx.

References getPageCount(), and mpImplData.

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

PrinterController::PageSize PrinterController::getPageFile ( int  i_inUnfilteredPage,
GDIMetaFile rMtf,
bool  i_bMayUseCache = false 
)
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

Implemented in vcl::OldStylePrintAdaptor.

Referenced by getPageParametersProtected().

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

Definition at line 963 of file print3.cxx.

References getPageParameters(), and mpImplData.

Referenced by getPageFile().

bool PrinterController::getPapersizeFromSetup ( ) const

Definition at line 1377 of file print3.cxx.

References mpImplData.

Referenced by setupPrinter().

Size & PrinterController::getPaperSizeFromUser ( ) const

Definition at line 1396 of file print3.cxx.

References mpImplData.

Size & PrinterController::getPaperSizeSetup ( ) const

Definition at line 1382 of file print3.cxx.

References mpImplData.

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

Definition at line 1411 of file print3.cxx.

References mpImplData.

Referenced by setupPrinter().

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 1459 of file print3.cxx.

References mpImplData.

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

Get the PropertyValue of a Property.

Definition at line 1464 of file print3.cxx.

References mpImplData.

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

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

Definition at line 1471 of file print3.cxx.

References mpImplData.

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

Definition at line 776 of file print3.cxx.

References mpImplData.

Referenced by createProgressDialog().

bool PrinterController::isDirectPrint ( ) const

Definition at line 1759 of file print3.cxx.

References getBoolProperty().

bool PrinterController::isPaperSizeFromUser ( ) const

Definition at line 1401 of file print3.cxx.

References mpImplData.

bool PrinterController::isProgressCanceled ( ) const

Definition at line 1705 of file print3.cxx.

References mpImplData.

bool PrinterController::isShowDialogs ( ) const

Definition at line 1753 of file print3.cxx.

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

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

Definition at line 1619 of file print3.cxx.

References mpImplData.

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

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

Definition at line 1565 of file print3.cxx.

References getValue(), and mpImplData.

Referenced by makeEnabled().

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

Definition at line 1338 of file print3.cxx.

void PrinterController::jobStarted ( )
virtual

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

Definition at line 1334 of file print3.cxx.

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 1633 of file print3.cxx.

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

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

App must override this.

Implemented in vcl::OldStylePrintAdaptor.

Referenced by getPageFile().

void PrinterController::pushPropertiesToPrinter ( )

Definition at line 1725 of file print3.cxx.

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

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

Definition at line 1720 of file print3.cxx.

References mpImplData.

Referenced by setupPrinter().

void PrinterController::resetPrinterOptions ( bool  i_bFileOutput)

Definition at line 795 of file print3.cxx.

References mpImplData, and PrinterOptions::ReadFromConfig().

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

Definition at line 766 of file print3.cxx.

References mpImplData.

Referenced by abortJob(), and printFilteredPage().

void PrinterController::setLastPage ( bool  i_bLastPage)

Definition at line 1359 of file print3.cxx.

References mpImplData.

Referenced by abortJob().

void PrinterController::setMultipage ( const MultiPageSetup i_rMPS)

Definition at line 1710 of file print3.cxx.

References mpImplData.

void PrinterController::setPapersizeFromSetup ( bool  i_bPapersizeFromSetup)

Definition at line 1369 of file print3.cxx.

References mpImplData.

Referenced by setupPrinter().

void PrinterController::setPaperSizeFromUser ( Size  i_aUserSize)

Definition at line 1387 of file print3.cxx.

References mpImplData.

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

Definition at line 781 of file print3.cxx.

References Printer::GetName(), mpImplData, and setValue().

void PrinterController::setPrinterModified ( bool  i_bPapersizeFromSetup)

Definition at line 1406 of file print3.cxx.

References mpImplData.

void PrinterController::setReversePrint ( bool  i_bReverse)

Definition at line 1364 of file print3.cxx.

References mpImplData.

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 1502 of file print3.cxx.

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

void PrinterController::setupPrinter ( weld::Window i_pDlgParent)
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 1478 of file print3.cxx.

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

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

Definition at line 1487 of file print3.cxx.

References mpImplData.

Member Data Documentation

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

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