workaround segfault in compiler on macos-clang-intel
[LibreOffice.git] / include / vcl / print.hxx
bloba1aacf8f0d90d35e83da0002f9a6bfd0f0b1f315
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 <sal/config.h>
25 #include <sal/types.h>
26 #include <rtl/ustring.hxx>
27 #include <tools/gen.hxx>
28 #include <tools/long.hxx>
29 #include <i18nutil/paper.hxx>
31 #include <vcl/dllapi.h>
32 #include <utility>
33 #include <vcl/PrinterSupport.hxx>
34 #include <comphelper/errcode.hxx>
35 #include <vcl/outdev.hxx>
36 #include <vcl/prntypes.hxx>
37 #include <vcl/region.hxx>
38 #include <vcl/jobset.hxx>
40 #include <com/sun/star/beans/PropertyValue.hpp>
41 #include <com/sun/star/uno/Sequence.hxx>
42 #include <com/sun/star/view/PrintableState.hpp>
44 #include <memory>
45 #include <unordered_map>
47 class GDIMetaFile;
48 class SalInfoPrinter;
49 struct SalPrinterQueueInfo;
50 class QueueInfo;
51 class SalPrinter;
52 class VirtualDevice;
53 enum class SalPrinterError;
55 namespace vcl {
56 class PrinterController;
58 namespace printer {
59 class Options;
63 namespace weld { class Window; }
65 class VCL_DLLPUBLIC Printer : public OutputDevice
67 friend class ::OutputDevice;
69 private:
70 SalInfoPrinter* mpInfoPrinter;
71 std::unique_ptr<SalPrinter> mpPrinter;
72 SalGraphics* mpJobGraphics;
73 VclPtr<Printer> mpPrev;
74 VclPtr<Printer> mpNext;
75 VclPtr<VirtualDevice> mpDisplayDev;
76 std::unique_ptr<vcl::printer::Options> mpPrinterOptions;
77 OUString maPrinterName;
78 OUString maDriver;
79 OUString maPrintFile;
80 JobSetup maJobSetup;
81 Point maPageOffset;
82 Size maPaperSize;
83 Size maPrintPageSize;
84 ErrCode mnError;
85 sal_uInt16 mnPageQueueSize;
86 sal_uInt16 mnCopyCount;
87 bool mbDefPrinter;
88 bool mbPrinting;
89 bool mbJobActive;
90 bool mbCollateCopy;
91 bool mbPrintFile;
92 bool mbInPrintPage;
93 bool mbNewJobSetup;
94 bool mbSinglePrintJobs;
95 bool mbUsePrintSetting;
96 bool mbResetPrintArea;
98 SAL_DLLPRIVATE void ImplInitData();
99 SAL_DLLPRIVATE void ImplInit( SalPrinterQueueInfo* pInfo );
100 SAL_DLLPRIVATE void ImplInitDisplay();
101 SAL_DLLPRIVATE static SalPrinterQueueInfo*
102 ImplGetQueueInfo( const OUString& rPrinterName, const OUString* pDriver );
103 SAL_DLLPRIVATE void ImplUpdatePageData();
104 SAL_DLLPRIVATE void ImplUpdateFontList();
105 SAL_DLLPRIVATE void ImplFindPaperFormatForUserSize( JobSetup& );
107 SAL_DLLPRIVATE bool StartJob( const OUString& rJobName, std::shared_ptr<vcl::PrinterController> const & );
109 static SAL_DLLPRIVATE ErrCode
110 ImplSalPrinterErrorCodeToVCL( SalPrinterError nError );
112 SAL_DLLPRIVATE void ImplPrintTransparent (
113 const Bitmap& rBmp,
114 const Point& rDestPt, const Size& rDestSize,
115 const Point& rSrcPtPixel, const Size& rSrcSizePixel );
117 private:
118 SAL_DLLPRIVATE void EndJob();
119 Printer( const Printer& rPrinter ) = delete;
120 Printer& operator =( const Printer& rPrinter ) = delete;
122 public:
123 SAL_DLLPRIVATE void ImplStartPage();
124 SAL_DLLPRIVATE void ImplEndPage();
126 protected:
127 virtual bool AcquireGraphics() const override;
128 virtual void ReleaseGraphics( bool bRelease = true ) override;
129 SAL_DLLPRIVATE void ImplReleaseGraphics(bool bRelease = true);
130 virtual void ImplReleaseFonts() override;
132 virtual tools::Long GetGradientStepCount( tools::Long nMinRect ) override;
133 virtual bool UsePolyPolygonForComplexGradient() override;
134 virtual void ClipAndDrawGradientMetafile ( const Gradient &rGradient,
135 const tools::PolyPolygon &rPolyPoly ) override;
137 bool CanSubsampleBitmap() const override { return false; }
138 vcl::Region ClipToDeviceBounds(vcl::Region aRegion) const override;
140 public:
141 void SetSystemTextColor(SystemTextColorFlags, bool) override;
142 SAL_DLLPRIVATE void DrawGradientEx( OutputDevice* pOut, const tools::Rectangle& rRect,
143 const Gradient& rGradient );
144 virtual Bitmap GetBitmap( const Point& rSrcPt, const Size& rSize ) const override;
145 virtual Size GetButtonBorderSize() override;
146 virtual Color GetMonochromeButtonColor() override { return COL_LIGHTGRAY; }
148 bool IsScreenComp() const override { return false; }
150 void DrawBorder(tools::Rectangle aBorderRect) override
152 SetLineColor(COL_BLACK);
153 DrawRect(aBorderRect);
156 css::awt::DeviceInfo GetDeviceInfo() const override;
158 protected:
159 virtual void DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
160 const Point& rDestPt, const Size& rDestSize,
161 const Point& rSrcPtPixel, const Size& rSrcSizePixel) override;
163 bool DrawTransformBitmapExDirect( const basegfx::B2DHomMatrix& aFullTransform,
164 const BitmapEx& rBitmapEx, double fAlpha = 1.0) override;
166 bool TransformAndReduceBitmapExToTargetRange( const basegfx::B2DHomMatrix& aFullTransform,
167 basegfx::B2DRange &aVisibleRange, double &fMaximumArea) override;
169 void DrawDeviceBitmapEx( const Point& rDestPt, const Size& rDestSize,
170 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
171 BitmapEx& rBitmapEx ) override;
173 virtual void EmulateDrawTransparent( const tools::PolyPolygon& rPolyPoly,
174 sal_uInt16 nTransparencePercent ) override;
176 virtual void SetFontOrientation( LogicalFontInstance* const pFontInstance ) const override;
178 bool shouldDrawWavePixelAsRect(tools::Long) const override { return true; }
179 void SetWaveLineColors(Color const& rColor, tools::Long) override;
180 Size GetWaveLineSize(tools::Long nLineWidth) const override;
182 public:
183 Printer();
184 Printer( const JobSetup& rJobSetup );
185 Printer( const QueueInfo& rQueueInfo );
186 Printer( const OUString& rPrinterName );
187 virtual ~Printer() override;
188 virtual void dispose() override;
190 virtual void SetMetafileMapMode(const MapMode& rNewMapMode, bool) override { SetMapMode(rNewMapMode); }
192 static const std::vector< OUString >&
193 GetPrinterQueues();
194 static const QueueInfo* GetQueueInfo( const OUString& rPrinterName, bool bStatusUpdate );
195 static OUString GetDefaultPrinterName();
197 const OUString& GetName() const { return maPrinterName; }
198 const OUString& GetDriverName() const { return maDriver; }
199 bool IsDefPrinter() const { return mbDefPrinter; }
200 bool IsDisplayPrinter() const { return mpDisplayDev != nullptr; }
201 bool IsValid() const { return !IsDisplayPrinter(); }
203 SAL_DLLPRIVATE sal_uInt32 GetCapabilities( PrinterCapType nType ) const;
204 bool HasSupport( PrinterSupport eFeature ) const;
206 bool SetJobSetup( const JobSetup& rSetup );
207 const JobSetup& GetJobSetup() const { return maJobSetup; }
209 bool Setup(weld::Window* pWindow,
210 PrinterSetupMode eMode = PrinterSetupMode::DocumentGlobal);
211 bool SetPrinterProps( const Printer* pPrinter );
213 Color GetBackgroundColor() const override { return COL_WHITE; }
214 Color GetReadableFontColor(const Color&, const Color&) const override { return COL_BLACK; }
216 /** SetPrinterOptions is used internally only now
218 in earlier times it was used only to set the options loaded directly from the configuration
219 in SfxPrinter::InitJob, this is now handled internally
220 should the need arise to set the printer options outside vcl, also a method would have to be devised
221 to not override these again internally
223 SAL_DLLPRIVATE void SetPrinterOptions( const vcl::printer::Options& rOptions );
224 const vcl::printer::Options& GetPrinterOptions() const { return( *mpPrinterOptions ); }
226 void ResetPrintArea(bool bReset) { mbResetPrintArea = bReset; }
227 bool IsPrintAreaReset() { return mbResetPrintArea; }
228 void SetUsePrintDialogSetting(bool bUsed) { mbUsePrintSetting = bUsed; }
229 bool IsUsePrintDialogSetting() { return mbUsePrintSetting; }
230 void SetPrintPageSize(Size aPrintPageSize) { maPrintPageSize = aPrintPageSize; }
231 Size GetPrintPageSize() { return maPrintPageSize; }
232 bool SetOrientation( Orientation eOrient );
233 Orientation GetOrientation() const;
234 SAL_DLLPRIVATE void SetDuplexMode( DuplexMode );
235 SAL_DLLPRIVATE DuplexMode GetDuplexMode() const;
237 bool SetPaperBin( sal_uInt16 nPaperBin );
238 sal_uInt16 GetPaperBin() const;
239 sal_uInt16 GetPaperBinBySourceIndex(sal_uInt16 nPaperSource) const;
240 sal_uInt16 GetSourceIndexByPaperBin(sal_uInt16 nPaperBin) const;
241 void SetPaper( Paper ePaper );
242 bool SetPaperSizeUser( const Size& rSize );
243 /** @return The paper format of the printer's current "jobsetup". Note that if PAPER_USER the actual size can be anything. */
244 Paper GetPaper() const;
245 /** @return Size of the paper of the printer's current "jobsetup". */
246 SAL_DLLPRIVATE Size GetSizeOfPaper() const;
247 static OUString GetPaperName( Paper ePaper );
249 /** @return Number of available paper formats */
250 SAL_DLLPRIVATE int GetPaperInfoCount() const;
252 /** @return Info about paper format nPaper */
253 SAL_DLLPRIVATE const PaperInfo& GetPaperInfo( int nPaper ) const;
254 sal_uInt16 GetPaperBinCount() const;
255 OUString GetPaperBinName( sal_uInt16 nPaperBin ) const;
257 bool GetPrinterSettingsPreferred() const;
258 void SetPrinterSettingsPreferred( bool bPaperSizeFromSetup );
260 const Size& GetPaperSizePixel() const { return maPaperSize; }
261 Size GetPaperSize() const { return PixelToLogic( maPaperSize ); }
262 SAL_DLLPRIVATE Size GetPaperSize( int nPaper ) const;
263 const Point& GetPageOffsetPixel() const { return maPageOffset; }
264 Point GetPageOffset() const { return PixelToLogic( maPageOffset ); }
266 SAL_DLLPRIVATE void SetCopyCount( sal_uInt16 nCopy, bool bCollate );
267 sal_uInt16 GetCopyCount() const { return mnCopyCount; }
268 bool IsCollateCopy() const { return mbCollateCopy; }
269 void SetSinglePrintJobs(bool bSinglePrintJobs) { mbSinglePrintJobs = bSinglePrintJobs; }
270 bool IsSinglePrintJobs() const { return mbSinglePrintJobs; }
272 bool IsPrinting() const { return mbPrinting; }
274 bool IsJobActive() const { return mbJobActive; }
276 /** Checks the printer list and updates it necessary
278 sends a DataChanged event of type DataChangedEventType::PRINTER if the printer list changed
280 static void updatePrinters();
282 /** Execute a print job
284 starts a print job asynchronously that is will return
286 static void PrintJob( const std::shared_ptr<vcl::PrinterController>& i_pController,
287 const JobSetup& i_rInitSetup );
289 virtual bool HasMirroredGraphics() const override;
291 virtual void DrawOutDev( const Point& rDestPt, const Size& rDestSize,
292 const Point& rSrcPt, const Size& rSrcSize ) override;
294 virtual void DrawOutDev( const Point& rDestPt, const Size& rDestSize,
295 const Point& rSrcPt, const Size& rSrcSize,
296 const OutputDevice& rOutDev ) override;
298 virtual void CopyArea( const Point& rDestPt, const Point& rSrcPt,
299 const Size& rSrcSize, bool bWindowInvalidate = false ) override;
301 virtual tools::Rectangle GetBackgroundComponentBounds() const override;
303 // These 3 together are more modular PrintJob(), allowing printing more documents as one print job
304 // by repeated calls to ExecutePrintJob(). Used by mailmerge.
305 SAL_DLLPRIVATE static bool PreparePrintJob( std::shared_ptr<vcl::PrinterController> i_pController,
306 const JobSetup& i_rInitSetup );
307 SAL_DLLPRIVATE static bool ExecutePrintJob(const std::shared_ptr<vcl::PrinterController>& i_pController);
308 static void FinishPrintJob( const std::shared_ptr<vcl::PrinterController>& i_pController );
310 /** Implementation detail of PrintJob being asynchronous
312 not exported, not usable outside vcl
314 static void SAL_DLLPRIVATE ImplPrintJob( const std::shared_ptr<vcl::PrinterController>& i_pController,
315 const JobSetup& i_rInitSetup );
318 namespace vcl
320 class ImplPrinterControllerData;
322 enum class NupOrderType
324 LRTB, TBLR, TBRL, RLTB
327 class VCL_DLLPUBLIC PrinterController
329 std::unique_ptr<ImplPrinterControllerData>
330 mpImplData;
331 protected:
332 PrinterController(const VclPtr<Printer>&, weld::Window* pDialogParent);
333 public:
334 struct MultiPageSetup
336 // all metrics in 100th mm
337 int nRows;
338 int nColumns;
339 Size aPaperSize;
340 tools::Long nLeftMargin;
341 tools::Long nTopMargin;
342 tools::Long nRightMargin;
343 tools::Long nBottomMargin;
344 tools::Long nHorizontalSpacing;
345 tools::Long nVerticalSpacing;
346 bool bDrawBorder;
347 NupOrderType nOrder;
349 MultiPageSetup()
350 : nRows( 1 ), nColumns( 1 ), aPaperSize( 21000, 29700 )
351 , nLeftMargin( 0 ), nTopMargin( 0 )
352 , nRightMargin( 0 ), nBottomMargin( 0 )
353 , nHorizontalSpacing( 0 ), nVerticalSpacing( 0 )
354 , bDrawBorder( false )
355 , nOrder( NupOrderType::LRTB ) {}
358 struct PageSize
360 /// In 100th mm
361 Size aSize;
363 /// Full paper, not only imageable area is printed
364 bool bFullPaper;
366 PageSize( const Size& i_rSize = Size( 21000, 29700 ),
367 bool i_bFullPaper = false)
368 : aSize( i_rSize ), bFullPaper( i_bFullPaper ) {}
371 virtual ~PrinterController();
373 const VclPtr<Printer>& getPrinter() const;
374 SAL_DLLPRIVATE weld::Window* getWindow() const;
376 /** For implementations: get current job properties as changed by e.g. print dialog
378 this gets the current set of properties initially told to Printer::PrintJob
380 For convenience a second sequence will be merged in to get a combined sequence.
381 In case of duplicate property names, the value of i_MergeList wins.
383 css::uno::Sequence< css::beans::PropertyValue >
384 getJobProperties(const css::uno::Sequence< css::beans::PropertyValue >& i_rMergeList ) const;
386 /// Get the PropertyValue of a Property
387 css::beans::PropertyValue* getValue( const OUString& i_rPropertyName );
388 const css::beans::PropertyValue* getValue( const OUString& i_rPropertyName ) const;
390 /** Get a bool property
392 in case the property is unknown or not convertible to bool, i_bFallback is returned
394 SAL_DLLPRIVATE bool getBoolProperty( const OUString& i_rPropertyName, bool i_bFallback ) const;
396 /** Get an int property
398 in case the property is unknown or not convertible to bool, i_nFallback is returned
400 SAL_DLLPRIVATE sal_Int32 getIntProperty( const OUString& i_rPropertyName, sal_Int32 i_nFallback ) const;
402 /// Set a property value - can also be used to add another UI property
403 void setValue( const OUString& i_rPropertyName, const css::uno::Any& i_rValue );
404 SAL_DLLPRIVATE void setValue( const css::beans::PropertyValue& i_rValue );
406 /** @return The currently active UI options. These are the same that were passed to setUIOptions. */
407 const css::uno::Sequence< css::beans::PropertyValue >&
408 getUIOptions() const;
410 /** Set possible UI options.
412 should only be done once before passing the PrinterListener to Printer::PrintJob
414 void setUIOptions( const css::uno::Sequence< css::beans::PropertyValue >& );
416 /// Enable/disable an option; this can be used to implement dialog logic.
417 bool isUIOptionEnabled( const OUString& rPropName ) const;
418 SAL_DLLPRIVATE bool isUIChoiceEnabled( const OUString& rPropName, sal_Int32 nChoice ) const;
420 /** MakeEnabled will change the property rPropName depends on to the value
422 that makes rPropName enabled. If the dependency itself is also disabled,
423 no action will be performed.
425 @return The property name rPropName depends on or an empty string if no change was made.
427 SAL_DLLPRIVATE OUString makeEnabled( const OUString& rPropName );
429 /// App must override this
430 virtual int getPageCount() const = 0;
432 /** Get the page parameters
434 namely the jobsetup that should be active for the page
435 (describing among others the physical page size) and the "page size". In writer
436 case this would probably be the same as the JobSetup since writer sets the page size
437 draw/impress for example print their page on the paper set on the printer,
438 possibly adjusting the page size to fit. That means the page size can be different from
439 the paper size.
441 App must override this
443 @return Page size in 1/100th mm
445 virtual css::uno::Sequence< css::beans::PropertyValue >
446 getPageParameters( int i_nPage ) const = 0;
447 /// App must override this
448 virtual void printPage(int i_nPage) const = 0;
450 /// Will be called after a possible dialog has been shown and the real printjob starts
451 SAL_DLLPRIVATE virtual void jobStarted();
452 SAL_DLLPRIVATE virtual void jobFinished( css::view::PrintableState );
454 SAL_DLLPRIVATE css::view::PrintableState getJobState() const;
456 SAL_DLLPRIVATE void abortJob();
458 bool isShowDialogs() const;
459 bool isDirectPrint() const;
461 void dialogsParentClosing();
463 // implementation details, not usable outside vcl
464 // don't use outside vcl. Some of these are exported for
465 // the benefit of vcl's plugins.
466 // Still: DO NOT USE OUTSIDE VCL
467 int getFilteredPageCount() const;
468 SAL_DLLPRIVATE PageSize getPageFile( int i_inUnfilteredPage, GDIMetaFile& rMtf,
469 bool i_bMayUseCache = false );
470 PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf,
471 bool i_bMayUseCache = false );
472 void printFilteredPage( int i_nPage );
473 SAL_DLLPRIVATE void setPrinter( const VclPtr<Printer>& );
474 SAL_DLLPRIVATE void createProgressDialog();
475 SAL_DLLPRIVATE bool isProgressCanceled() const;
476 SAL_DLLPRIVATE void setMultipage( const MultiPageSetup& );
477 SAL_DLLPRIVATE const MultiPageSetup&
478 getMultipage() const;
479 void setLastPage( bool i_bLastPage );
480 SAL_DLLPRIVATE void setReversePrint( bool i_bReverse );
481 SAL_DLLPRIVATE void setPapersizeFromSetup( bool i_bPapersizeFromSetup );
482 SAL_DLLPRIVATE bool getPapersizeFromSetup() const;
483 SAL_DLLPRIVATE void setPaperSizeFromUser( Size i_aUserSize );
484 SAL_DLLPRIVATE void setOrientationFromUser( Orientation eOrientation, bool set );
485 void setPrinterModified( bool i_bPapersizeFromSetup );
486 SAL_DLLPRIVATE bool getPrinterModified() const;
487 SAL_DLLPRIVATE void pushPropertiesToPrinter();
488 SAL_DLLPRIVATE void resetPaperToLastConfigured();
489 SAL_DLLPRIVATE void resetPrintArea();
490 void setJobState( css::view::PrintableState );
491 SAL_DLLPRIVATE void setupPrinter( weld::Window* i_pDlgParent );
493 SAL_DLLPRIVATE int getPageCountProtected() const;
494 SAL_DLLPRIVATE css::uno::Sequence< css::beans::PropertyValue >
495 getPageParametersProtected( int i_nPage ) const;
497 SAL_DLLPRIVATE DrawModeFlags removeTransparencies( GDIMetaFile const & i_rIn, GDIMetaFile& o_rOut );
498 SAL_DLLPRIVATE void resetPrinterOptions( bool i_bFileOutput );
501 class VCL_DLLPUBLIC PrinterOptionsHelper
503 protected:
504 std::unordered_map< OUString, css::uno::Any >
505 m_aPropertyMap;
506 std::vector< css::beans::PropertyValue >
507 m_aUIProperties;
509 public:
511 /// Create without ui properties
512 PrinterOptionsHelper() {}
514 /** Process a new set of properties
516 merges changed properties and returns "true" if any occurred
518 bool processProperties( const css::uno::Sequence< css::beans::PropertyValue >& i_rNewProp );
520 /** Append to a sequence of property values the ui property sequence passed at creation
522 as the "ExtraPrintUIOptions" property. if that sequence was empty, no "ExtraPrintUIOptions" property
523 will be appended.
525 void appendPrintUIOptions( css::uno::Sequence< css::beans::PropertyValue >& io_rProps ) const;
527 /** @return An empty Any for not existing properties */
528 css::uno::Any getValue( const OUString& i_rPropertyName ) const;
530 bool getBoolValue( const OUString& i_rPropertyName, bool i_bDefault ) const;
531 // convenience for fixed strings
532 bool getBoolValue( const char* i_pPropName, bool i_bDefault = false ) const
533 { return getBoolValue( OUString::createFromAscii( i_pPropName ), i_bDefault ); }
535 sal_Int64 getIntValue( const OUString& i_rPropertyName, sal_Int64 i_nDefault ) const;
536 // convenience for fixed strings
537 sal_Int64 getIntValue( const char* i_pPropName, sal_Int64 i_nDefault ) const
538 { return getIntValue( OUString::createFromAscii( i_pPropName ), i_nDefault ); }
540 OUString getStringValue( const OUString& i_rPropertyName ) const;
541 // convenience for fixed strings
542 OUString getStringValue( const char* i_pPropName ) const
543 { return getStringValue( OUString::createFromAscii( i_pPropName ) ); }
545 // helper functions for user to create a single control
546 struct UIControlOptions
548 OUString maDependsOnName;
549 OUString maGroupHint;
550 std::vector< css::beans::PropertyValue >
551 maAddProps;
552 sal_Int32 mnDependsOnEntry;
553 bool mbAttachToDependency;
554 bool mbInternalOnly;
555 bool mbEnabled;
557 UIControlOptions( OUString i_DependsOnName = OUString(),
558 sal_Int32 i_nDependsOnEntry = -1, bool i_bAttachToDependency = false)
559 : maDependsOnName(std::move( i_DependsOnName ))
560 , mnDependsOnEntry( i_nDependsOnEntry )
561 , mbAttachToDependency( i_bAttachToDependency )
562 , mbInternalOnly( false )
563 , mbEnabled( true ) {}
566 // note: in the following helper functions HelpIds are expected as an OUString
567 // the normal HelpId form is OString (byte string instead of UTF16 string)
568 // this is because the whole interface is base on UNO properties; in fact the structures
569 // are passed over UNO interfaces. UNO does not know a byte string, hence the string is
570 // transported via UTF16 strings.
572 /// Show general control
573 static css::uno::Any setUIControlOpt( const css::uno::Sequence< OUString >& i_rIDs, const OUString& i_rTitle,
574 const css::uno::Sequence< OUString >& i_rHelpId, const OUString& i_rType,
575 const css::beans::PropertyValue* i_pValue = nullptr,
576 const UIControlOptions& i_rControlOptions = UIControlOptions());
578 /// Show and set the title of a TagPage of id i_rID
579 static css::uno::Any setGroupControlOpt( const OUString& i_rID, const OUString& i_rTitle,
580 const OUString& i_rHelpId);
582 /// Show and set the label of a VclFrame of id i_rID
583 static css::uno::Any setSubgroupControlOpt( const OUString& i_rID, const OUString& i_rTitle, const OUString& i_rHelpId,
584 const UIControlOptions& i_rControlOptions = UIControlOptions());
586 /// Show a bool option as a checkbox
587 static css::uno::Any setBoolControlOpt( const OUString& i_rID, const OUString& i_rTitle, const OUString& i_rHelpId,
588 const OUString& i_rProperty, bool i_bValue,
589 const UIControlOptions& i_rControlOptions = UIControlOptions());
591 /// Show a set of choices in a list box
592 static css::uno::Any setChoiceListControlOpt( const OUString& i_rID, const OUString& i_rTitle,
593 const css::uno::Sequence< OUString >& i_rHelpId, const OUString& i_rProperty,
594 const css::uno::Sequence< OUString >& i_rChoices, sal_Int32 i_nValue,
595 const css::uno::Sequence< sal_Bool >& i_rDisabledChoices = css::uno::Sequence< sal_Bool >(),
596 const UIControlOptions& i_rControlOptions = UIControlOptions());
598 /// Show a set of choices as radio buttons
599 static css::uno::Any setChoiceRadiosControlOpt( const css::uno::Sequence< OUString >& i_rIDs,
600 const OUString& i_rTitle, const css::uno::Sequence< OUString >& i_rHelpId,
601 const OUString& i_rProperty, const css::uno::Sequence< OUString >& i_rChoices,
602 sal_Int32 i_nValue,
603 const css::uno::Sequence< sal_Bool >& i_rDisabledChoices = css::uno::Sequence< sal_Bool >(),
604 const UIControlOptions& i_rControlOptions = UIControlOptions());
606 /** Show an integer range (e.g. a spin field)
608 note: max value < min value means do not apply min/max values
610 static css::uno::Any setRangeControlOpt( const OUString& i_rID, const OUString& i_rTitle, const OUString& i_rHelpId,
611 const OUString& i_rProperty, sal_Int32 i_nValue, sal_Int32 i_nMinValue,
612 sal_Int32 i_nMaxValue, const UIControlOptions& i_rControlOptions);
614 /** Show a string field
616 note: max value < min value means do not apply min/max values
618 static css::uno::Any setEditControlOpt( const OUString& i_rID, const OUString& i_rTitle, const OUString& i_rHelpId,
619 const OUString& i_rProperty, const OUString& i_rValue,
620 const UIControlOptions& i_rControlOptions);
621 }; // class PrinterOptionsHelper
623 } // namespace vcl
626 #endif // INCLUDED_VCL_PRINT_HXX
628 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */