Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / vcl / print.hxx
blob240bc7333b791f41f6eb73015b447f200657bf9b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_VCL_PRINT_HXX
21 #define INCLUDED_VCL_PRINT_HXX
23 #include <rtl/ustring.hxx>
25 #include <vcl/errcode.hxx>
26 #include <tools/solar.h>
27 #include <vcl/dllapi.h>
28 #include <vcl/outdev.hxx>
29 #include <vcl/prntypes.hxx>
30 #include <vcl/jobset.hxx>
31 #include <vcl/gdimtf.hxx>
32 #include <tools/multisel.hxx>
34 #include <com/sun/star/beans/PropertyValue.hpp>
35 #include <com/sun/star/view/PrintableState.hpp>
37 #include <memory>
38 #include <set>
39 #include <unordered_map>
41 class SalInfoPrinter;
42 struct SalPrinterQueueInfo;
43 class SalPrinter;
44 class VirtualDevice;
45 namespace vcl { class Window; }
47 namespace vcl {
48 class PrinterController;
49 class PrintDialog;
53 enum class PrinterSupport
55 SetOrientation,
56 SetPaperSize, SetPaper,
57 CollateCopy,
58 SetupDialog
62 class VCL_DLLPUBLIC QueueInfo
64 friend class Printer;
66 private:
67 OUString maPrinterName;
68 OUString maDriver;
69 OUString maLocation;
70 OUString maComment;
71 PrintQueueFlags mnStatus;
72 sal_uInt32 mnJobs;
74 public:
75 QueueInfo();
76 QueueInfo( const QueueInfo& rInfo );
77 ~QueueInfo();
79 const OUString& GetPrinterName() const { return maPrinterName; }
80 const OUString& GetDriver() const { return maDriver; }
81 const OUString& GetLocation() const { return maLocation; }
82 const OUString& GetComment() const { return maComment; }
83 PrintQueueFlags GetStatus() const { return mnStatus; }
84 sal_uInt32 GetJobs() const { return mnJobs; }
88 enum class PrinterTransparencyMode
90 Auto = 0,
91 NONE = 1
95 enum class PrinterGradientMode
97 Stripes = 0,
98 Color = 1
102 enum class PrinterBitmapMode
104 Optimal = 0,
105 Normal = 1,
106 Resolution = 2
110 class VCL_DLLPUBLIC PrinterOptions
112 private:
114 bool mbReduceTransparency;
115 PrinterTransparencyMode meReducedTransparencyMode;
116 bool mbReduceGradients;
117 PrinterGradientMode meReducedGradientsMode;
118 sal_uInt16 mnReducedGradientStepCount;
119 bool mbReduceBitmaps;
120 PrinterBitmapMode meReducedBitmapMode;
121 sal_uInt16 mnReducedBitmapResolution;
122 bool mbReducedBitmapsIncludeTransparency;
123 bool mbConvertToGreyscales;
124 bool mbPDFAsStandardPrintJobFormat;
126 public:
127 PrinterOptions();
128 ~PrinterOptions();
130 bool IsReduceTransparency() const { return mbReduceTransparency; }
131 void SetReduceTransparency( bool bSet ) { mbReduceTransparency = bSet; }
133 PrinterTransparencyMode GetReducedTransparencyMode() const { return meReducedTransparencyMode; }
134 void SetReducedTransparencyMode( PrinterTransparencyMode eMode )
135 { meReducedTransparencyMode = eMode; }
137 bool IsReduceGradients() const { return mbReduceGradients; }
138 void SetReduceGradients( bool bSet ) { mbReduceGradients = bSet; }
140 PrinterGradientMode GetReducedGradientMode() const { return meReducedGradientsMode; }
141 void SetReducedGradientMode( PrinterGradientMode eMode ) { meReducedGradientsMode = eMode; }
143 sal_uInt16 GetReducedGradientStepCount() const { return mnReducedGradientStepCount; }
144 void SetReducedGradientStepCount( sal_uInt16 nStepCount )
145 { mnReducedGradientStepCount = nStepCount; }
147 bool IsReduceBitmaps() const { return mbReduceBitmaps; }
148 void SetReduceBitmaps( bool bSet ) { mbReduceBitmaps = bSet; }
150 PrinterBitmapMode GetReducedBitmapMode() const { return meReducedBitmapMode; }
151 void SetReducedBitmapMode( PrinterBitmapMode eMode ) { meReducedBitmapMode = eMode; }
153 sal_uInt16 GetReducedBitmapResolution() const { return mnReducedBitmapResolution; }
154 void SetReducedBitmapResolution( sal_uInt16 nResolution )
155 { mnReducedBitmapResolution = nResolution; }
157 bool IsReducedBitmapIncludesTransparency() const { return mbReducedBitmapsIncludeTransparency; }
158 void SetReducedBitmapIncludesTransparency( bool bSet )
159 { mbReducedBitmapsIncludeTransparency = bSet; }
161 bool IsConvertToGreyscales() const { return mbConvertToGreyscales; }
162 void SetConvertToGreyscales( bool bSet ) { mbConvertToGreyscales = bSet; }
164 bool IsPDFAsStandardPrintJobFormat() const { return mbPDFAsStandardPrintJobFormat; }
165 void SetPDFAsStandardPrintJobFormat( bool bSet ) { mbPDFAsStandardPrintJobFormat = bSet; }
167 /** Read printer options from configuration
169 parameter decides whether the set for
170 print "to printer" or "to file" should be read.
171 @return True if config was read, false if an error occurred
173 bool ReadFromConfig( bool bFile );
177 class VCL_DLLPUBLIC Printer : public OutputDevice
179 friend class ::OutputDevice;
181 private:
182 SalInfoPrinter* mpInfoPrinter;
183 SalPrinter* mpPrinter;
184 SalGraphics* mpJobGraphics;
185 VclPtr<Printer> mpPrev;
186 VclPtr<Printer> mpNext;
187 VclPtr<VirtualDevice> mpDisplayDev;
188 PrinterOptions* mpPrinterOptions;
189 OUString maPrinterName;
190 OUString maDriver;
191 OUString maPrintFile;
192 OUString maJobName;
193 JobSetup maJobSetup;
194 Point maPageOffset;
195 Size maPaperSize;
196 sal_uLong mnError;
197 sal_uInt16 mnCurPage;
198 sal_uInt16 mnCurPrintPage;
199 sal_uInt16 mnPageQueueSize;
200 sal_uInt16 mnCopyCount;
201 bool mbDefPrinter;
202 bool mbPrinting;
203 bool mbJobActive;
204 bool mbCollateCopy;
205 bool mbPrintFile;
206 bool mbInPrintPage;
207 bool mbNewJobSetup;
209 SAL_DLLPRIVATE void ImplInitData();
210 SAL_DLLPRIVATE void ImplInit( SalPrinterQueueInfo* pInfo );
211 SAL_DLLPRIVATE void ImplInitDisplay();
212 SAL_DLLPRIVATE static SalPrinterQueueInfo*
213 ImplGetQueueInfo( const OUString& rPrinterName, const OUString* pDriver );
214 SAL_DLLPRIVATE void ImplUpdatePageData();
215 SAL_DLLPRIVATE void ImplUpdateFontList();
216 SAL_DLLPRIVATE void ImplFindPaperFormatForUserSize( JobSetup&, bool bMatchNearest );
218 SAL_DLLPRIVATE bool StartJob( const OUString& rJobName, std::shared_ptr<vcl::PrinterController>& );
220 static SAL_DLLPRIVATE sal_uLong
221 ImplSalPrinterErrorCodeToVCL( sal_uLong nError );
223 private:
224 SAL_DLLPRIVATE bool EndJob();
225 Printer( const Printer& rPrinter ) = delete;
226 Printer& operator =( const Printer& rPrinter ) = delete;
228 public:
229 SAL_DLLPRIVATE void ImplStartPage();
230 SAL_DLLPRIVATE void ImplEndPage();
232 protected:
233 virtual bool AcquireGraphics() const override;
234 virtual void ReleaseGraphics( bool bRelease = true ) override;
235 virtual void ImplReleaseFonts() override;
237 virtual long GetGradientStepCount( long nMinRect ) override;
238 virtual bool UsePolyPolygonForComplexGradient() override;
239 virtual void ClipAndDrawGradientMetafile ( const Gradient &rGradient,
240 const tools::PolyPolygon &rPolyPoly ) override;
242 void ScaleBitmap ( Bitmap&, SalTwoRect& ) override { };
244 public:
245 void DrawGradientEx( OutputDevice* pOut, const tools::Rectangle& rRect,
246 const Gradient& rGradient );
247 virtual Bitmap GetBitmap( const Point& rSrcPt, const Size& rSize ) const override;
249 protected:
250 virtual void DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
251 const Point& rDestPt, const Size& rDestSize,
252 const Point& rSrcPtPixel, const Size& rSrcSizePixel) override;
254 bool DrawTransformBitmapExDirect( const basegfx::B2DHomMatrix& aFullTransform,
255 const BitmapEx& rBitmapEx) override;
257 bool TransformAndReduceBitmapExToTargetRange( const basegfx::B2DHomMatrix& aFullTransform,
258 basegfx::B2DRange &aVisibleRange, double &fMaximumArea) override;
260 void DrawDeviceBitmap( const Point& rDestPt, const Size& rDestSize,
261 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
262 BitmapEx& rBitmapEx ) override;
264 virtual void EmulateDrawTransparent( const tools::PolyPolygon& rPolyPoly,
265 sal_uInt16 nTransparencePercent ) override;
267 virtual void InitFont() const override;
268 virtual void SetFontOrientation( LogicalFontInstance* const pFontInstance ) const override;
270 public:
271 Printer();
272 Printer( const JobSetup& rJobSetup );
273 Printer( const QueueInfo& rQueueInfo );
274 Printer( const OUString& rPrinterName );
275 virtual ~Printer() override;
276 virtual void dispose() override;
278 static const std::vector< OUString >&
279 GetPrinterQueues();
280 static const QueueInfo* GetQueueInfo( const OUString& rPrinterName, bool bStatusUpdate );
281 static OUString GetDefaultPrinterName();
283 const OUString& GetName() const { return maPrinterName; }
284 const OUString& GetDriverName() const { return maDriver; }
285 bool IsDefPrinter() const { return mbDefPrinter; }
286 bool IsDisplayPrinter() const { return mpDisplayDev != nullptr; }
287 bool IsValid() const { return !IsDisplayPrinter(); }
289 sal_uInt32 GetCapabilities( PrinterCapType nType ) const;
290 bool HasSupport( PrinterSupport eFeature ) const;
292 bool SetJobSetup( const JobSetup& rSetup );
293 const JobSetup& GetJobSetup() const { return maJobSetup; }
295 bool Setup( vcl::Window* pWindow, bool bPapersizeFromSetup = false );
296 bool SetPrinterProps( const Printer* pPrinter );
298 /** SetPrinterOptions is used internally only now
300 in earlier times it was used only to set the options loaded directly from the configuration
301 in SfxPrinter::InitJob, this is now handled internally
302 should the need arise to set the printer options outside vcl, also a method would have to be devised
303 to not override these again internally
305 SAL_DLLPRIVATE void SetPrinterOptions( const PrinterOptions& rOptions );
306 const PrinterOptions& GetPrinterOptions() const { return( *mpPrinterOptions ); }
308 bool SetOrientation( Orientation eOrient );
309 Orientation GetOrientation() const;
310 bool SetDuplexMode( DuplexMode );
312 bool SetPaperBin( sal_uInt16 nPaperBin );
313 sal_uInt16 GetPaperBin() const;
314 bool SetPaper( Paper ePaper );
315 bool SetPaperSizeUser( const Size& rSize );
316 bool SetPaperSizeUser( const Size& rSize, bool bMatchNearest );
317 Paper GetPaper() const;
318 static OUString GetPaperName( Paper ePaper );
320 /** @return A UI string for the current paper; an empty string for PAPER_USER */
321 OUString GetPaperName() const;
323 /** @return Number of available paper formats */
324 int GetPaperInfoCount() const;
326 /** @return Info about paper format nPaper */
327 const PaperInfo& GetPaperInfo( int nPaper ) const;
328 sal_uInt16 GetPaperBinCount() const;
329 OUString GetPaperBinName( sal_uInt16 nPaperBin ) const;
331 const Size& GetPaperSizePixel() const { return maPaperSize; }
332 Size GetPaperSize() const { return PixelToLogic( maPaperSize ); }
333 const Point& GetPageOffsetPixel() const { return maPageOffset; }
334 Point GetPageOffset() const { return PixelToLogic( maPageOffset ); }
336 bool SetCopyCount( sal_uInt16 nCopy, bool bCollate );
337 sal_uInt16 GetCopyCount() const { return mnCopyCount; }
338 bool IsCollateCopy() const { return mbCollateCopy; }
340 bool IsPrinting() const { return mbPrinting; }
342 bool IsJobActive() const { return mbJobActive; }
344 /** Checks the printer list and updates it necessary
346 sends a DataChanged event of type DataChangedEventType::PRINTER if the printer list changed
348 static void updatePrinters();
350 /** Execute a print job
352 starts a print job asynchronously that is will return
354 static void PrintJob( const std::shared_ptr<vcl::PrinterController>& i_pController,
355 const JobSetup& i_rInitSetup );
357 virtual bool HasMirroredGraphics() const override;
359 virtual void DrawOutDev( const Point& rDestPt, const Size& rDestSize,
360 const Point& rSrcPt, const Size& rSrcSize ) override;
362 virtual void DrawOutDev( const Point& rDestPt, const Size& rDestSize,
363 const Point& rSrcPt, const Size& rSrcSize,
364 const OutputDevice& rOutDev ) override;
366 virtual void CopyArea( const Point& rDestPt, const Point& rSrcPt,
367 const Size& rSrcSize, bool bWindowInvalidate = false ) override;
369 // These 3 together are more modular PrintJob(), allowing printing more documents as one print job
370 // by repeated calls to ExecutePrintJob(). Used by mailmerge.
371 static bool PreparePrintJob( std::shared_ptr<vcl::PrinterController> i_pController,
372 const JobSetup& i_rInitSetup );
373 static bool ExecutePrintJob( std::shared_ptr<vcl::PrinterController> i_pController );
374 static void FinishPrintJob( const std::shared_ptr<vcl::PrinterController>& i_pController );
376 /** Implementation detail of PrintJob being asynchronous
378 not exported, not usable outside vcl
380 static void SAL_DLLPRIVATE ImplPrintJob( const std::shared_ptr<vcl::PrinterController>& i_pController,
381 const JobSetup& i_rInitSetup );
384 namespace vcl
386 class ImplPrinterControllerData;
388 enum class NupOrderType
390 LRTB, TBLR, TBRL, RLTB
393 class VCL_DLLPUBLIC PrinterController
395 std::unique_ptr<ImplPrinterControllerData>
396 mpImplData;
397 protected:
398 PrinterController( const VclPtr<Printer>& );
399 public:
400 struct MultiPageSetup
402 // all metrics in 100th mm
403 int nRows;
404 int nColumns;
405 Size aPaperSize;
406 long nLeftMargin;
407 long nTopMargin;
408 long nRightMargin;
409 long nBottomMargin;
410 long nHorizontalSpacing;
411 long nVerticalSpacing;
412 bool bDrawBorder;
413 NupOrderType nOrder;
415 MultiPageSetup()
416 : nRows( 1 ), nColumns( 1 ), aPaperSize( 21000, 29700 )
417 , nLeftMargin( 0 ), nTopMargin( 0 )
418 , nRightMargin( 0 ), nBottomMargin( 0 )
419 , nHorizontalSpacing( 0 ), nVerticalSpacing( 0 )
420 , bDrawBorder( false )
421 , nOrder( NupOrderType::LRTB ) {}
424 struct PageSize
426 /// In 100th mm
427 Size aSize;
429 /// Full paper, not only imageable area is printed
430 bool bFullPaper;
432 PageSize( const Size& i_rSize = Size( 21000, 29700 ),
433 bool i_bFullPaper = false)
434 : aSize( i_rSize ), bFullPaper( i_bFullPaper ) {}
437 virtual ~PrinterController();
439 const VclPtr<Printer>& getPrinter() const;
441 /** For implementations: get current job properties as changed by e.g. print dialog
443 this gets the current set of properties initially told to Printer::PrintJob
445 For convenience a second sequence will be merged in to get a combined sequence.
446 In case of duplicate property names, the value of i_MergeList wins.
448 css::uno::Sequence< css::beans::PropertyValue >
449 getJobProperties(const css::uno::Sequence< css::beans::PropertyValue >& i_rMergeList ) const;
451 /// Get the PropertyValue of a Property
452 css::beans::PropertyValue* getValue( const OUString& i_rPropertyName );
453 const css::beans::PropertyValue* getValue( const OUString& i_rPropertyName ) const;
455 /** Get a bool property
457 in case the property is unknown or not convertible to bool, i_bFallback is returned
459 bool getBoolProperty( const OUString& i_rPropertyName, bool i_bFallback ) const;
461 /** Get an int property
463 in case the property is unknown or not convertible to bool, i_nFallback is returned
465 sal_Int32 getIntProperty( const OUString& i_rPropertyName, sal_Int32 i_nFallback ) const;
467 /// Set a property value - can also be used to add another UI property
468 void setValue( const OUString& i_rPropertyName, const css::uno::Any& i_rValue );
469 void setValue( const css::beans::PropertyValue& i_rValue );
471 /** @return The currently active UI options. These are the same that were passed to setUIOptions. */
472 const css::uno::Sequence< css::beans::PropertyValue >&
473 getUIOptions() const;
475 /** Set possible UI options.
477 should only be done once before passing the PrinterListener to Printer::PrintJob
479 void setUIOptions( const css::uno::Sequence< css::beans::PropertyValue >& );
481 /// Enable/disable an option; this can be used to implement dialog logic.
482 bool isUIOptionEnabled( const OUString& rPropName ) const;
483 bool isUIChoiceEnabled( const OUString& rPropName, sal_Int32 nChoice ) const;
485 /** @return The property name rPropName depends on or an empty string
487 if no dependency exists.
489 OUString getDependency( const OUString& rPropName ) const;
491 /** MakeEnabled will change the property rPropName depends on to the value
493 that makes rPropName enabled. If the dependency itself is also disabled,
494 no action will be performed.
496 @return The property name rPropName depends on or an empty string if no change was made.
498 OUString makeEnabled( const OUString& rPropName );
500 /// App must override this
501 virtual int getPageCount() const = 0;
503 /** Get the page parameters
505 namely the jobsetup that should be active for the page
506 (describing among others the physical page size) and the "page size". In writer
507 case this would probably be the same as the JobSetup since writer sets the page size
508 draw/impress for example print their page on the paper set on the printer,
509 possibly adjusting the page size to fit. That means the page size can be different from
510 the paper size.
512 App must override this
514 @return Page size in 1/100th mm
516 virtual css::uno::Sequence< css::beans::PropertyValue >
517 getPageParameters( int i_nPage ) const = 0;
518 /// App must override this
519 virtual void printPage(int i_nPage) const = 0;
521 /// Will be called after a possible dialog has been shown and the real printjob starts
522 virtual void jobStarted();
523 virtual void jobFinished( css::view::PrintableState );
525 css::view::PrintableState getJobState() const;
527 void abortJob();
529 bool isShowDialogs() const;
530 bool isDirectPrint() const;
532 // implementation details, not usable outside vcl
533 // don't use outside vcl. Some of these are exported for
534 // the benefit of vcl's plugins.
535 // Still: DO NOT USE OUTSIDE VCL
536 VCL_PLUGIN_PUBLIC int getFilteredPageCount();
537 SAL_DLLPRIVATE PageSize getPageFile( int i_inUnfilteredPage, GDIMetaFile& rMtf,
538 bool i_bMayUseCache = false );
539 VCL_PLUGIN_PUBLIC PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf,
540 bool i_bMayUseCache = false );
541 VCL_PLUGIN_PUBLIC void printFilteredPage( int i_nPage );
542 SAL_DLLPRIVATE void setPrinter( const VclPtr<Printer>& );
543 VCL_PLUGIN_PUBLIC void createProgressDialog();
544 VCL_PLUGIN_PUBLIC bool isProgressCanceled() const;
545 SAL_DLLPRIVATE void setMultipage( const MultiPageSetup& );
546 SAL_DLLPRIVATE const MultiPageSetup&
547 getMultipage() const;
548 VCL_PLUGIN_PUBLIC void setLastPage( bool i_bLastPage );
549 SAL_DLLPRIVATE void setReversePrint( bool i_bReverse );
550 SAL_DLLPRIVATE bool getReversePrint() const;
551 SAL_DLLPRIVATE void setPapersizeFromSetup( bool i_bPapersizeFromSetup );
552 SAL_DLLPRIVATE bool getPapersizeFromSetup() const;
553 VCL_PLUGIN_PUBLIC void setPrinterModified( bool i_bPapersizeFromSetup );
554 VCL_PLUGIN_PUBLIC bool getPrinterModified() const;
555 SAL_DLLPRIVATE void pushPropertiesToPrinter();
556 SAL_DLLPRIVATE void resetPaperToLastConfigured();
557 VCL_PLUGIN_PUBLIC void setJobState( css::view::PrintableState );
558 SAL_DLLPRIVATE bool setupPrinter( vcl::Window* i_pDlgParent );
560 SAL_DLLPRIVATE int getPageCountProtected() const;
561 SAL_DLLPRIVATE css::uno::Sequence< css::beans::PropertyValue >
562 getPageParametersProtected( int i_nPage ) const;
564 SAL_DLLPRIVATE DrawModeFlags removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut );
565 SAL_DLLPRIVATE void resetPrinterOptions( bool i_bFileOutput );
568 class VCL_DLLPUBLIC PrinterOptionsHelper
570 protected:
571 std::unordered_map< OUString, css::uno::Any, OUStringHash >
572 m_aPropertyMap;
573 std::vector< css::beans::PropertyValue >
574 m_aUIProperties;
576 public:
578 /// Create without ui properties
579 PrinterOptionsHelper() {}
581 /** Process a new set of properties
583 merges changed properties and returns "true" if any occurred
585 bool processProperties( const css::uno::Sequence< css::beans::PropertyValue >& i_rNewProp );
587 /** Append to a sequence of property values the ui property sequence passed at creation
589 as the "ExtraPrintUIOptions" property. if that sequence was empty, no "ExtraPrintUIOptions" property
590 will be appended.
592 void appendPrintUIOptions( css::uno::Sequence< css::beans::PropertyValue >& io_rProps ) const;
594 /** @return An empty Any for not existing properties */
595 css::uno::Any getValue( const OUString& i_rPropertyName ) const;
597 bool getBoolValue( const OUString& i_rPropertyName, bool i_bDefault ) const;
598 // convenience for fixed strings
599 bool getBoolValue( const char* i_pPropName, bool i_bDefault = false ) const
600 { return getBoolValue( OUString::createFromAscii( i_pPropName ), i_bDefault ); }
602 sal_Int64 getIntValue( const OUString& i_rPropertyName, sal_Int64 i_nDefault ) const;
603 // convenience for fixed strings
604 sal_Int64 getIntValue( const char* i_pPropName, sal_Int64 i_nDefault ) const
605 { return getIntValue( OUString::createFromAscii( i_pPropName ), i_nDefault ); }
607 OUString getStringValue( const OUString& i_rPropertyName ) const;
608 // convenience for fixed strings
609 OUString getStringValue( const char* i_pPropName ) const
610 { return getStringValue( OUString::createFromAscii( i_pPropName ) ); }
612 // helper functions for user to create a single control
613 struct UIControlOptions
615 OUString maDependsOnName;
616 sal_Int32 mnDependsOnEntry;
617 bool mbAttachToDependency;
618 OUString maGroupHint;
619 bool mbInternalOnly;
620 bool mbEnabled;
621 std::vector< css::beans::PropertyValue >
622 maAddProps;
624 UIControlOptions( const OUString& i_rDependsOnName = OUString(),
625 sal_Int32 i_nDependsOnEntry = -1, bool i_bAttachToDependency = false)
626 : maDependsOnName( i_rDependsOnName )
627 , mnDependsOnEntry( i_nDependsOnEntry )
628 , mbAttachToDependency( i_bAttachToDependency )
629 , mbInternalOnly( false )
630 , mbEnabled( true ) {}
633 // note: in the following helper functions HelpIds are expected as an OUString
634 // the normal HelpId form is OString (byte string instead of UTF16 string)
635 // this is because the whole interface is base on UNO properties; in fact the structures
636 // are passed over UNO interfaces. UNO does not know a byte string, hence the string is
637 // transported via UTF16 strings.
639 /// Show general control
640 static css::uno::Any setUIControlOpt( const css::uno::Sequence< OUString >& i_rIDs, const OUString& i_rTitle,
641 const css::uno::Sequence< OUString >& i_rHelpId, const OUString& i_rType,
642 const css::beans::PropertyValue* i_pValue = nullptr,
643 const UIControlOptions& i_rControlOptions = UIControlOptions());
645 /// Show and set the title of a TagPage of id i_rID
646 static css::uno::Any setGroupControlOpt( const OUString& i_rID, const OUString& i_rTitle,
647 const OUString& i_rHelpId);
649 /// Show and set the label of a VclFrame of id i_rID
650 static css::uno::Any setSubgroupControlOpt( const OUString& i_rID, const OUString& i_rTitle, const OUString& i_rHelpId,
651 const UIControlOptions& i_rControlOptions = UIControlOptions());
653 /// Show a bool option as a checkbox
654 static css::uno::Any setBoolControlOpt( const OUString& i_rID, const OUString& i_rTitle, const OUString& i_rHelpId,
655 const OUString& i_rProperty, bool i_bValue,
656 const UIControlOptions& i_rControlOptions = UIControlOptions());
658 /// Show a set of choices in a list box
659 static css::uno::Any setChoiceListControlOpt( const OUString& i_rID, const OUString& i_rTitle,
660 const css::uno::Sequence< OUString >& i_rHelpId, const OUString& i_rProperty,
661 const css::uno::Sequence< OUString >& i_rChoices, sal_Int32 i_nValue,
662 const css::uno::Sequence< sal_Bool >& i_rDisabledChoices = css::uno::Sequence< sal_Bool >(),
663 const UIControlOptions& i_rControlOptions = UIControlOptions());
665 /// Show a set of choices as radio buttons
666 static css::uno::Any setChoiceRadiosControlOpt( const css::uno::Sequence< OUString >& i_rIDs,
667 const OUString& i_rTitle, const css::uno::Sequence< OUString >& i_rHelpId,
668 const OUString& i_rProperty, const css::uno::Sequence< OUString >& i_rChoices,
669 sal_Int32 i_nValue,
670 const css::uno::Sequence< sal_Bool >& i_rDisabledChoices = css::uno::Sequence< sal_Bool >(),
671 const UIControlOptions& i_rControlOptions = UIControlOptions());
673 /** Show an integer range (e.g. a spin field)
675 note: max value < min value means do not apply min/max values
677 static css::uno::Any setRangeControlOpt( const OUString& i_rID, const OUString& i_rTitle, const OUString& i_rHelpId,
678 const OUString& i_rProperty, sal_Int32 i_nValue, sal_Int32 i_nMinValue,
679 sal_Int32 i_nMaxValue, const UIControlOptions& i_rControlOptions);
681 /** Show a string field
683 note: max value < min value means do not apply min/max values
685 static css::uno::Any setEditControlOpt( const OUString& i_rID, const OUString& i_rTitle, const OUString& i_rHelpId,
686 const OUString& i_rProperty, const OUString& i_rValue,
687 const UIControlOptions& i_rControlOptions);
688 }; // class PrinterOptionsHelper
690 } // namespace vcl
693 #endif // INCLUDED_VCL_PRINT_HXX
695 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */