PlotApi.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 
69 #if !defined (resource) && !defined (type_resource_generator)
70 
71 #include <Bentley\Bentley.h>
72 #include <Bentley\BeFileName.h>
73 #include <Bentley\bmap.h>
74 #include <Bentley\bvector.h>
75 #include <Mstn\MdlApi\mstypes.h>
77 
78 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotFontMap);
79 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotFontMapList);
80 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotOleParam);
81 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotRasterizedParam);
82 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotElemDisplayParams);
83 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotElementParam);
84 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotBeginElementParam);
85 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotEndElementParam);
86 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotPreElementScanParam);
87 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotPostElementScanParam);
88 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotPrePenChartParam);
89 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotPreElementOutputParam);
90 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotPostElementOutputParam);
91 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotResymbolizeParam);
92 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotPreModelParam);
93 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotGetColorTableParam);
94 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotterForm);
95 MSTNPLATFORM_PRINT_TYPEDEFS (IPlotterFormList);
96 MSTNPLATFORM_PRINT_TYPEDEFS (IPreDynamicViewClipParam);
97 MSTNPLATFORM_PRINT_TYPEDEFS (IPrintDefCollectStateParam);
98 MSTNPLATFORM_PRINT_TYPEDEFS (IPrintDefinition);
99 MSTNPLATFORM_PRINT_TYPEDEFS (IPrintDescription);
100 MSTNPLATFORM_PRINT_TYPEDEFS (IPrinterDriverBase);
101 MSTNPLATFORM_PRINT_TYPEDEFS (IPrintEventHandler2);
102 MSTNPLATFORM_PRINT_TYPEDEFS (IPrintSetEventHandler);
103 MSTNPLATFORM_PRINT_TYPEDEFS (IPrintDefCreateEventHandler);
104 MSTNPLATFORM_PRINT_TYPEDEFS (ICadPrintHandler);
105 MSTNPLATFORM_PRINT_TYPEDEFS (IBeginPrintSetParam);
106 MSTNPLATFORM_PRINT_TYPEDEFS (IEndPrintSetParam);
107 MSTNPLATFORM_PRINT_TYPEDEFS (IPrePrintSetDefinitionParam);
108 MSTNPLATFORM_PRINT_TYPEDEFS (IPrePrintDefinitionParam);
109 MSTNPLATFORM_PRINT_TYPEDEFS (PlotFileSpec);
110 MSTNPLATFORM_PRINT_TYPEDEFS (PlotFlags);
111 MSTNPLATFORM_PRINT_TYPEDEFS (PlotLineStyleDef);
112 MSTNPLATFORM_PRINT_TYPEDEFS (PlotPaperSizeInfo);
113 MSTNPLATFORM_PRINT_TYPEDEFS (PlotPenSetup);
114 MSTNPLATFORM_PRINT_TYPEDEFS (PlotPropValue);
115 MSTNPLATFORM_PRINT_TYPEDEFS (PlotRasterCompr);
116 MSTNPLATFORM_PRINT_TYPEDEFS (PlotRasterOptions);
117 MSTNPLATFORM_PRINT_TYPEDEFS (PrintStyleName);
118 
121 
122 #endif // resource
123 
129 enum class PlotUnits
131  {
132  Undefined = -1,
133  Default = 0,
134  m = 1,
135  dm = 2,
136  cm = 3,
137  mm = 4,
138  ft = 5,
139  in = 6,
140  dots = 7,
141  tenthsmm = 8
142  };
143 
145 enum class PlotAreaMode
146  {
147  View = 0,
148  Fence = 1,
149  Sheet = 2
150  };
151 
153 enum class PlotDestination
154  {
155  Undefined = -1,
156  ToDevice = 0,
157  ToPlotFile = 1,
158  ToMetaFile = 2,
159  ToIpserver = 3
160  };
161 
163 enum class PlotOrientation
164  {
165  Undefined = -1,
166  Portrait = 0,
167  Landscape = 1
168  };
169 
172  {
173  Undefined = 0,
174  Integer = 1,
175  Double = 2,
176  String = 3
177  };
178 
180 enum class PlotError
181  {
182  NoError = 0,
183  Internal = 255,
184  DiskFull = 254,
185  UserAbort = 253,
186  Malloc = 252,
187  OpenFile = 251,
188  WriteFile = 250,
189  CreateFile = 249,
190  PermissionDenied = 248,
191  InvalidScale = 247,
192  IllegalWrite = 246,
193  Timeout = 245
194  };
195 
196 #if !defined (resource) && !defined (type_resource_generator)
197 
198 /*=================================================================================**/
203  {
206 
208  BeFileName sourceFileName;
209  };
210 
211 typedef bvector<PrintStyleName>& PrintStyleNameListR;
212 
213 /*=================================================================================**/
218  {
221 
224 
227 
231 
234  };
235 
236 typedef bvector<PlotPaperSizeInfo> PlotPaperSizeList;
237 typedef bvector<PlotPaperSizeInfo>& PlotPaperSizeListR;
238 
239 /*=================================================================================**/
268  {
269 private:
270  BeFileName m_ufs;
271  BeFileName m_hfs;
272  WString m_moniker;
273  WString m_embeddedSuffix;
274  unsigned int m_isFolder:1;
275  unsigned int m_isReadOnly:1;
276  unsigned int m_isNew:1;
277  unsigned int m_reserved:29;
278  RefCounted<IRefCounted> const* m_handle;
279 
280  void init()
281  {
282  m_isFolder = 0;
283  m_isReadOnly = 0;
284  m_reserved = 0;
285  m_isNew = 0;
286  m_handle = NULL;
287  }
288 
289  void SetHandle (void const* value, bool init = false)
290  {
291  if (! init)
292  {
293  if (value == m_handle)
294  return;
295 
296  ClearHandle();
297  }
298 
299  if (value)
300  {
301  m_handle = (RefCounted<IRefCounted> const*) value;
302  m_handle->AddRef();
303  }
304  else
305  {
306  m_handle = NULL;
307  }
308  }
309 
310  void ClearUnsupportedMoniker()
311  {
312  if (m_moniker.Contains (L"<ProviderId>pw://"))
313  return;
314 
315  if (m_moniker.Contains (L"<DmsMoniker>"))
316  return;
317 
318  ClearMoniker();
319  }
320 
321 public:
323  PlotFileSpec() { init(); }
324 
326  PlotFileSpec (WStringCR ufs) { init(); SetUfs (ufs.c_str()); }
327 
330  PlotFileSpec (WStringCR ufs, bool isHfs) { init(); if (isHfs) SetUfsAndHfs (ufs.c_str()); else SetUfs (ufs.c_str()); }
331 
333  PlotFileSpec (WCharCP ufs) { init(); SetUfs (ufs); }
334 
337  PlotFileSpec (WCharCP ufs, bool isHfs) { init(); if (isHfs) SetUfsAndHfs (ufs); else SetUfs (ufs); }
338 
343  PlotFileSpec (DgnDocumentCP document) { init(); SetFromDgnDocument (document); }
344 
349  PlotFileSpec (DgnFolderCP folder) { init(); SetFromDgnFolder (folder); }
350 
352  PlotFileSpec (PlotFileSpecCR source)
353  {
354  m_ufs = source.m_ufs;
355  m_hfs = source.m_hfs;
356  m_isFolder = source.m_isFolder;
357  m_isReadOnly = source.m_isReadOnly;
358  m_isNew = source.m_isNew;
359  m_moniker = source.m_moniker;
360  m_embeddedSuffix = source.m_embeddedSuffix;
361  m_reserved = m_reserved;
362  SetHandle (source.m_handle, true);
363  }
364 
366  PlotFileSpecR operator= (PlotFileSpecCR source)
367  {
368  if (&source != this)
369  {
370  m_ufs = source.m_ufs;
371  m_hfs = source.m_hfs;
372  m_moniker = source.m_moniker;
373  m_embeddedSuffix = source.m_embeddedSuffix;
374  m_isFolder = source.m_isFolder;
375  m_isReadOnly = source.m_isReadOnly;
376  m_isNew = source.m_isNew;
377  m_reserved = m_reserved;
378  SetHandle (source.m_handle, true);
379  }
380 
381  return *this;
382  }
383 
385  friend void swap (PlotFileSpecR a, PlotFileSpecR b)
386  {
387  if (&a != &b)
388  {
389  using std::swap;
390  swap (a.m_ufs, b.m_ufs);
391  swap (a.m_hfs, b.m_hfs);
392  swap (a.m_moniker, b.m_moniker);
393  swap (a.m_embeddedSuffix, b.m_embeddedSuffix);
394  swap (a.m_handle, b.m_handle);
395 
396  int tmp;
397  tmp = a.m_isFolder; a.m_isFolder = b.m_isFolder; b.m_isFolder = tmp;
398  tmp = a.m_isReadOnly; a.m_isReadOnly = b.m_isReadOnly; b.m_isReadOnly = tmp;
399  tmp = a.m_isNew; a.m_isNew = b.m_isNew; b.m_isNew = tmp;
400  tmp = a.m_reserved; a.m_reserved = b.m_reserved; b.m_reserved = tmp;
401  }
402  }
403 
405  ~PlotFileSpec() { ClearHandle(); }
406 
408  BeFileNameCR Ufs() const { return m_ufs; }
409 
412  BeFileName GetUfs (bool includeEmbeddedSuffix = false) const
413  {
414  BeFileName value (m_ufs);
415 
416  if ((includeEmbeddedSuffix) && (IsEmbeddedSuffixDefined()))
417  value.append (m_embeddedSuffix);
418 
419  return value;
420  }
421 
425  void SetUfs (WCharCP value)
426  {
427  Clear();
428 
429  if (value)
430  {
431  m_ufs.SetName (value);
432 
433  if (ContainsEmbeddedSuffix (m_ufs))
434  {
435  m_embeddedSuffix = GetEmbeddedSuffix (m_ufs);
436  m_ufs.SetName (RemoveEmbeddedSuffix (m_ufs));
437  }
438  }
439  }
440 
443  void SetUfsOnly (WStringCR value)
444  {
445  m_ufs.SetName (value);
446  }
447 
450  void SetUfsAndHfs (WCharCP value) { SetUfs (value); m_hfs = m_ufs; }
451 
453  BeFileNameCR Hfs() const { return m_hfs; }
454 
457  BeFileName GetHfs (bool includeEmbeddedSuffix = false) const
458  {
459  BeFileName value (m_hfs);
460 
461  if ((includeEmbeddedSuffix) && (IsEmbeddedSuffixDefined()))
462  value.append (m_embeddedSuffix);
463 
464  return value;
465  }
466 
469  void SetHfs (WCharCP value)
470  {
471  if (value)
472  {
473  m_hfs.SetName (value);
474 
475  if (ContainsEmbeddedSuffix (m_hfs))
476  {
477  m_embeddedSuffix = GetEmbeddedSuffix (m_hfs);
478  m_hfs.SetName (RemoveEmbeddedSuffix (m_hfs));
479  }
480  }
481  else
482  {
483  m_hfs.Clear();
484  }
485 
486  if (! IsValid())
487  m_ufs = m_hfs;
488  }
489 
491  void ClearHfs() { m_hfs.clear(); }
492 
495  BeFileNameCR HfsOrUfs() const { return IsHfsDefined() ? m_hfs : m_ufs; }
496 
499  BeFileName GetHfsOrUfs (bool includeEmbeddedSuffix = false) const
500  {
501  return IsHfsDefined() ? GetHfs (includeEmbeddedSuffix) : m_ufs;
502  }
503 
505  WStringCR Moniker() const { return m_moniker; }
506 
508  void SetMoniker (WCharCP value)
509  {
510  if (value)
511  {
512  m_moniker = value;
513  m_moniker.ReplaceAll (L"&space;", L" "); // TFS 346906
514  }
515 
516  ClearUnsupportedMoniker();
517  }
518 
520  void SetMoniker (WStringCR value) { SetMoniker (value.c_str()); }
521 
523  void ClearMoniker() { m_moniker.clear(); }
524 
526  WStringCR EmbeddedSuffix() const { return m_embeddedSuffix; }
527 
529  void SetEmbeddedSuffix (WCharCP value) { if (value) m_embeddedSuffix = value; else ClearEmbeddedSuffix(); }
530 
532  void SetEmbeddedSuffix (WStringCR value) { SetEmbeddedSuffix (value.c_str()); }
533 
535  void ClearEmbeddedSuffix() { m_embeddedSuffix.clear(); }
536 
538  bool IsFolder() const { return m_isFolder; }
539 
541  void SetIsFolder (bool value) { m_isFolder = value; }
542 
544  bool IsReadOnly() const { return m_isReadOnly; }
545 
547  void SetIsReadOnly (bool value) { m_isReadOnly = value; }
548 
551  bool IsNew() const { return m_isNew; }
552 
555  void SetIsNew (bool value) { m_isNew = value; }
556 
558  DgnDocumentP Document() const { return (DgnDocumentP) m_handle; }
559 
561  void SetDocument (DgnDocumentCP value) { SetHandle (value); }
562 
564  DgnFolderP Folder() const { return (DgnFolderP) m_handle; }
565 
567  void SetFolder (DgnFolderCP value) { SetHandle (value); }
568 
570  bool IsValid() const { return (! m_ufs.IsEmpty()); }
571 
573  bool IsEmpty() const { return m_ufs.IsEmpty(); }
574 
576  bool IsHfsDefined() const { return (! m_hfs.IsEmpty()); }
577 
579  bool IsMonikerDefined() const { return (! m_moniker.empty()); }
580 
582  bool IsEmbeddedSuffixDefined() const { return (! m_embeddedSuffix.empty()); }
583 
585  bool IsHandleDefined() const { return (NULL != m_handle); }
586 
588  bool IsDms() const { return IsMonikerDefined(); }
589 
592  BeFileNameCR DisplayFullName() const { return IsDms() ? m_ufs : HfsOrUfs(); }
593 
596  BeFileName GetDisplayFullName (bool includeEmbeddedSuffix = false) const
597  {
598  return IsDms() ? GetUfs (includeEmbeddedSuffix) : GetHfsOrUfs (includeEmbeddedSuffix);
599  }
600 
603  WString GetFileName (bool includeEmbeddedSuffix = false) const
604  {
605  BeFileNameCR path = HfsOrUfs();
606 
607  if ((! includeEmbeddedSuffix) || (! IsEmbeddedSuffixDefined()))
608  {
609  return BeFileName::GetFileNameAndExtension (path);
610  }
611  else
612  {
613  WString fileName = BeFileName::GetFileNameAndExtension (path);
614  fileName.append (m_embeddedSuffix);
615  return fileName;
616  }
617  }
618 
620  WString ToString() const { return GetDisplayFullName (true); }
621 
626  DLLEXPORT void SetFromDgnDocument (DgnDocumentCP document);
627 
632  DLLEXPORT void SetFromDgnFolder (DgnFolderCP folder);
633 
639  {
640  if (m_handle)
641  {
642  if (! IsFolder())
643  SetFromDgnDocument ((DgnDocumentCP) m_handle);
644  else
645  SetFromDgnFolder ((DgnFolderCP) m_handle);
646  }
647  }
648 
650  void ClearHandle()
651  {
652  if (m_handle)
653  {
654  if (! IsFolder())
655  ((DgnDocumentP)m_handle)->Release();
656  else
657  ((DgnFolderP)m_handle)->Release();
658 
659  m_handle = NULL;
660  }
661  }
662 
664  void Clear()
665  {
666  m_ufs.Clear();
667  m_hfs.Clear();
668  m_moniker.clear();
669  m_embeddedSuffix.clear();
670  ClearHandle();
671  }
672 
675  {
676  return ((WString::npos != path.find (L'<')) && (WString::npos != path.find (L'>')));
677  }
678 
681  {
682  WString embeddedSuffix;
683 
684  size_t startEmbeddedSuffixIndex;
685  if (WString::npos != (startEmbeddedSuffixIndex = path.find (L'<')))
686  embeddedSuffix.assign (path.c_str() + startEmbeddedSuffixIndex);
687 
688  return embeddedSuffix;
689  }
690 
693  {
694  size_t startEmbeddedSuffixIndex;
695  if (WString::npos == (startEmbeddedSuffixIndex = path.find (L'<')))
696  return path;
697 
698  return path.substr (0, startEmbeddedSuffixIndex);
699  }
700 
702  static bool Equals (PlotFileSpecCR comparand1, PlotFileSpecCR comparand2)
703  {
704  if (comparand1.m_isFolder != comparand2.m_isFolder)
705  return false;
706 
707  if (comparand1.m_ufs != comparand2.m_ufs)
708  return false;
709 
710  if (comparand1.m_hfs != comparand2.m_hfs)
711  return false;
712 
713  if (comparand1.m_moniker != comparand2.m_moniker)
714  return false;
715 
716  if (comparand1.m_embeddedSuffix != comparand2.m_embeddedSuffix)
717  return false;
718 
719  return true;
720  }
721  };
722 
723 /*=================================================================================**/
728  {
729 private:
730  PlotPropValueType m_type;
731 
732  union
733  {
734  int ival;
735  double dval;
737  } m_value;
738 
739  void Init()
740  {
741  m_type = PlotPropValueType::Undefined;
742  memset (&m_value, 0, sizeof (m_value));
743  }
744 
745 public:
746  PlotPropValue() { Init(); }
748 
750  PlotPropValue (int value) { Init(); Assign (value); }
751 
753  PlotPropValue (double value) { Init(); Assign (value); }
754 
756  PlotPropValue (WCharCP value) { Init(); Assign (value); }
757 
759  PlotPropValue (PlotPropValueCR source)
760  {
761  Init();
762  m_type = source.GetType();
763 
764  if (PlotPropValueType::Integer == m_type)
765  Assign (source.GetInt());
766  else if (PlotPropValueType::Double == m_type)
767  Assign (source.GetDouble());
768  else
769  Assign (source.GetString());
770  }
771 
773  friend void swap (PlotPropValueR a, PlotPropValueR b)
774  {
775  if (&a != &b)
776  {
777  using std::swap;
778  swap (a.m_type, b.m_type);
779  swap (a.m_value, b.m_value);
780  }
781  }
782 
784  PlotPropValueType GetType() const { return m_type; }
785 
787  void Assign (int value) { Clear(); m_type = PlotPropValueType::Integer; m_value.ival = value; }
788 
790  void Assign (double value) { Clear(); m_type = PlotPropValueType::Double; m_value.dval = value; }
791 
793  void Assign (WCharCP value) { Clear(); m_type = PlotPropValueType::String; if (value) m_value.sval = new WString (value); }
794 
796  void Clear()
797  {
798  if ((PlotPropValueType::String == m_type) && (m_value.sval))
799  delete m_value.sval;
800 
801  Init();
802  }
803 
806  int GetInt() const { return (PlotPropValueType::Integer == m_type) ? m_value.ival : 0; }
807 
810  bool GetBool() const { return (PlotPropValueType::Integer == m_type) ? (0 != m_value.ival) : false; }
811 
814  double GetDouble() const { return (PlotPropValueType::Double == m_type) ? m_value.dval : 0.0; }
815 
818  WCharCP GetString() const { return ((PlotPropValueType::String == m_type) && (m_value.sval)) ? m_value.sval->c_str() : NULL; }
819 
821  bool IsValid() const
822  {
823  if (PlotPropValueType::Undefined == m_type)
824  return false;
825 
826  if (PlotPropValueType::String != m_type)
827  return true;
828 
829  return ((m_value.sval) && (! m_value.sval->empty()));
830  }
831 
833  void ToString (WStringR str) const
834  {
835  if (PlotPropValueType::Integer == m_type)
836  {
837  str.Sprintf (L"%d", m_value.ival);
838  }
839  else if (PlotPropValueType::Double == m_type)
840  {
841  str.Sprintf (L"%lg", m_value.ival);
842  }
843  else
844  {
845  if (m_value.sval)
846  str.assign (m_value.sval->c_str());
847  else
848  str.clear();
849  }
850  }
851  };
852 
853 typedef bmap<WString,PlotPropValue> PlotPropertyMap;
854 typedef bmap<WString,PlotPropValue>* PlotPropertyMapP;
855 typedef bmap<WString,PlotPropValue> const* PlotPropertyMapCP;
856 typedef bmap<WString,PlotPropValue>& PlotPropertyMapR;
857 typedef bmap<WString,PlotPropValue> const& PlotPropertyMapCR;
858 
860 
861 /*---------------------------------------------------------------------------------**/
871 DLLEXPORT bool mdlPlot_getDefaultPltcfg (PlotFileSpecR pltcfgFspec);
872 
873 /*---------------------------------------------------------------------------------**/
883 DLLEXPORT bool mdlPlot_getDefaultSysPltcfg (PlotFileSpecR pltcfgFspec);
884 
885 /*---------------------------------------------------------------------------------**/
895 DLLEXPORT bool mdlPlot_getDefaultPdfPltcfg (PlotFileSpecR pltcfgFspec);
896 
897 /*---------------------------------------------------------------------------------**/
909 (
910 PlotPaperSizeListR paperSizeList,
911 WCharCP printerName,
912 PlotOrientation orientation,
913 PlotUnits units
914 );
915 
916 /*---------------------------------------------------------------------------------**/
926 (
927 PrintStyleNameListR printStyleNames,
928 bool fromActiveDgnFile,
929 bool fromDgnLibraries
930 );
931 
932 /*---------------------------------------------------------------------------------**/
941 DLLEXPORT IPrintDescriptionCP mdlPlot_getPrintDialogDescHandle();
942 
943 /*---------------------------------------------------------------------------------**/
950 
951 /*---------------------------------------------------------------------------------**/
959 
961 
963 
966 
967 #include <Mstn\Plot\IPlotter.h>
969 #include <Mstn\Plot\IPlotHook.h>
970 #include <Mstn\Plot\IPrintEngine.h>
971 
972 #endif // resource
973 
PlotAreaMode
Printing system area mode.
Definition: PlotApi.h:145
#define END_PRINT_NAMESPACE
Definition: MstnTypes.h:40
void Assign(int value)
Assigns an integer value.
Definition: PlotApi.h:787
void SetEmbeddedSuffix(WCharCP value)
Sets the embedded suffix string.
Definition: PlotApi.h:529
PlotFileSpec(WStringCR ufs, bool isHfs)
Constructs a PlotFileSpec from a universal file specification, while also optionally setting the host...
Definition: PlotApi.h:330
bool IsValid() const
True if the universal file specification is defined.
Definition: PlotApi.h:570
PlotUnits units
Paper size units.
Definition: PlotApi.h:223
bool IsReadOnly() const
Gets flag indicating if this specification represents a read-only file or folder. ...
Definition: PlotApi.h:544
struct Bentley::BeFileName const & BeFileNameCR
Definition: Bentley.h:242
void SetIsFolder(bool value)
Sets flag indicating if this specification is for a folder.
Definition: PlotApi.h:541
MSTNPLATFORM_PRINT_TYPEDEFS(IPlotFontMap)
PlotFileSpec(PlotFileSpecCR source)
Copy constructor.
Definition: PlotApi.h:352
#define END_BENTLEY_MSTNPLATFORM_NAMESPACE
Definition: DgnPlatform.h:30
Printer paper size.
Definition: PlotApi.h:217
PlotPropValue()
Definition: PlotApi.h:746
BeFileNameCR DisplayFullName() const
Gets the Ufs if DMS managed, otherwise HfsOrUfs().
Definition: PlotApi.h:592
bmap< WString, PlotPropValue > const & PlotPropertyMapCR
Definition: PlotApi.h:857
BeFileNameCR Ufs() const
Gets the universal file specification, without any embedded suffix.
Definition: PlotApi.h:408
void ClearHfs()
Clears the host file specification.
Definition: PlotApi.h:491
bool IsEmpty() const
True if the universal file specification is not defined.
Definition: PlotApi.h:573
DPoint2d printableOffset
Offset from physical origin to printable area.
Definition: PlotApi.h:233
void SetIsReadOnly(bool value)
Sets flag indicating if this specification represents a read-only file or folder. ...
Definition: PlotApi.h:547
double GetDouble() const
Gets the property value as a floating-point number.
Definition: PlotApi.h:814
signed 32-bit integer, unitless
bool mdlPlot_getDefaultPdfPltcfg(PlotFileSpecR pltcfgFspec)
Returns the name of the default PDF printer driver configuration file.
StatusInt mdlPlot_getPaperSizeListFromPrinter(PlotPaperSizeListR paperSizeList, WCharCP printerName, PlotOrientation orientation, PlotUnits units)
Returns a list of paper sizes defined for the specified printer.
A DgnDocument represents a file.
Definition: DgnDocumentManager.h:385
bvector< PrintStyleName > & PrintStyleNameListR
Definition: PlotApi.h:211
struct Bentley::WString const & WStringCR
Definition: Bentley.h:239
~PlotFileSpec()
Destructor.
Definition: PlotApi.h:405
WString name
Name.
Definition: PlotApi.h:205
PlotFileSpec(WCharCP ufs)
Constructs a PlotFileSpec from a universal file specification.
Definition: PlotApi.h:333
static bool ContainsEmbeddedSuffix(WStringCR path)
True if the given path contains an embedded file specification.
Definition: PlotApi.h:674
bool IsMonikerDefined() const
True if the externalized moniker string is defined.
Definition: PlotApi.h:579
void Sprintf(WCharCP format,...)
Replace the contents of this string with a formatted result.
WStringP sval
Definition: PlotApi.h:736
#define BEGIN_BENTLEY_MSTNPLATFORM_NAMESPACE
Definition: DgnPlatform.h:29
void SetFolder(DgnFolderCP value)
Set the DgnFolder for this folder specification. Adds reference to folder.
Definition: PlotApi.h:567
void SetEmbeddedSuffix(WStringCR value)
Sets the embedded suffix string.
Definition: PlotApi.h:532
BeFileName sourceFileName
File location in which the print style is defined.
Definition: PlotApi.h:208
bool IsNew() const
Gets flag indicating if this specification represents a file or folder being created.
Definition: PlotApi.h:551
void swap(basic_string< _CharT, _Traits, _Allocator > &__a, basic_string< _CharT, _Traits, _Allocator > &__b)
Definition: basic_string.h:1396
int ival
Definition: PlotApi.h:734
void mdlPlot_getPrintStyleNames(PrintStyleNameListR printStyleNames, bool fromActiveDgnFile, bool fromDgnLibraries)
Returns a list of print style names available in the current session.
a sheet model. Intended to aggregate and present drawings. May reference multiple drawing models...
WString GetFileName(bool includeEmbeddedSuffix=false) const
Gets the file name and extension of the Hfs if defined, otherwise that of the Ufs.
Definition: PlotApi.h:603
void ClearMoniker()
Clears the externalized DMS moniker string.
Definition: PlotApi.h:523
bool IsFolder() const
Gets flag indicating if this specification is for a folder.
Definition: PlotApi.h:538
#define BEGIN_PRINT_NAMESPACE
Definition: MstnTypes.h:39
int GetInt() const
Gets the property value as an integer.
Definition: PlotApi.h:806
wchar_t const * WCharCP
Definition: Bentley.h:224
PlotFileSpec(DgnFolderCP folder)
Constructs a PlotFileSpec from a DgnDocument.
Definition: PlotApi.h:349
bmap< WString, PlotPropValue > PlotPropertyMap
Definition: PlotApi.h:853
PlotDestination
Printing system destination.
Definition: PlotApi.h:153
Name and source file location of a print style.
Definition: PlotApi.h:202
#define NULL
Definition: Bentley.h:157
bvector< PlotPaperSizeInfo > PlotPaperSizeList
Definition: PlotApi.h:236
bstdmap & operator=(const bstdmap &__rhs)
Definition: stdcxx/bstdmap.h:170
bool IsEmbeddedSuffixDefined() const
True if the embedded suffix is defined.
Definition: PlotApi.h:582
PlotFileSpec(WCharCP ufs, bool isHfs)
Constructs a PlotFileSpec from a universal file specification, while also optionally setting the host...
Definition: PlotApi.h:337
static WString RemoveEmbeddedSuffix(WStringCR path)
Removes any embedded suffix from the given path.
Definition: PlotApi.h:692
PlotUnits
Printing system units.
Definition: PlotApi.h:130
BeFileNameCR Hfs() const
Gets the host file specification, without any embedded suffix.
Definition: PlotApi.h:453
WStringCR Moniker() const
Gets the externalized DMS moniker string.
Definition: PlotApi.h:505
IPrintDescriptionCP mdlPlot_getPrintDialogDescHandle()
Gets the IPrintDescription handle used by the plotdlg application (if it is loaded).
void ClearEmbeddedSuffix()
Clears the embedded suffix string.
Definition: PlotApi.h:535
Represents a file specification in the printing system.
Definition: PlotApi.h:267
PlotError
Printing system error code.
Definition: PlotApi.h:180
#define DLLEXPORT
Definition: basedefs.h:137
WString substr(size_type __pos=0, size_type __n=npos) const
Get a substring.
Definition: WString.h:156
PlotFileSpec(WStringCR ufs)
Constructs a PlotFileSpec from a universal file specification.
Definition: PlotApi.h:326
PlotError mdlPlot_getErrno()
Gets the current global plot error number.
#define CLRPUBLIC
Definition: DgnPlatform/ExportMacros.h:12
static WString GetEmbeddedSuffix(WStringCR path)
Returns any embedded suffix from the given path.
Definition: PlotApi.h:680
friend void swap(PlotPropValueR a, PlotPropValueR b)
Swaps two PlotPropValue instances.
Definition: PlotApi.h:773
void SetUfs(WCharCP value)
Sets the universal file specification.
Definition: PlotApi.h:425
DgnFolderP Folder() const
DgnFolder pointer. May be undefined.
Definition: PlotApi.h:564
void SetHfs(WCharCP value)
Sets the host file specification.
Definition: PlotApi.h:469
void SetUfsAndHfs(WCharCP value)
Sets both the universal and host file specifications.
Definition: PlotApi.h:450
bmap< WString, PlotPropValue > const * PlotPropertyMapCP
Definition: PlotApi.h:855
Variant value container in a print property dictionary.
Definition: PlotApi.h:727
BeFileName GetHfs(bool includeEmbeddedSuffix=false) const
Gets the host file specification.
Definition: PlotApi.h:457
bvector< PlotPaperSizeInfo > & PlotPaperSizeListR
Definition: PlotApi.h:237
The element is processed because it is passes the fence criteria.
double dval
Definition: PlotApi.h:735
bool mdlPlot_getDefaultPltcfg(PlotFileSpecR pltcfgFspec)
Returns the name of the default printer driver configuration file.
void Clear()
Clears Ufs, Hfs, moniker, and handle.
Definition: PlotApi.h:664
static bool Equals(PlotFileSpecCR comparand1, PlotFileSpecCR comparand2)
Tests two PlotFileSpec instances for equality.
Definition: PlotApi.h:702
BeFileName GetHfsOrUfs(bool includeEmbeddedSuffix=false) const
Gets the host file specification if defined, otherwise the universal file specification.
Definition: PlotApi.h:499
Defines typedefs and constants that can be used across other namespaces. All Bentley-authored C++ sou...
#define BEGIN_EXTERN_C
Definition: Bentley.h:164
WStringCR EmbeddedSuffix() const
Gets the embedded suffix string.
Definition: PlotApi.h:526
struct DgnPlatform::DgnFolder const * DgnFolderCP
Definition: DgnPlatform.h:196
PlotFileSpec()
Default constructor.
Definition: PlotApi.h:323
PlotPropValue(int value)
Constructs from an integer value.
Definition: PlotApi.h:750
void ToString(WStringR str) const
Converts the property value to a string.
Definition: PlotApi.h:833
bool mdlPlot_getDefaultSysPltcfg(PlotFileSpecR pltcfgFspec)
Returns the name of the default system printer driver configuration file.
friend void swap(PlotFileSpecR a, PlotFileSpecR b)
Swaps two PlotFileSpec instances.
Definition: PlotApi.h:385
void Assign(WCharCP value)
Assigns a string value.
Definition: PlotApi.h:793
BeFileName GetUfs(bool includeEmbeddedSuffix=false) const
Gets the universal file specification.
Definition: PlotApi.h:412
#define END_EXTERN_C
Definition: Bentley.h:165
int StatusInt
Definition: Bentley.h:222
bool IsHfsDefined() const
True if the host file specification is defined.
Definition: PlotApi.h:576
PlotPropValue(double value)
Constructs from a floating-point value.
Definition: PlotApi.h:753
void ClearHandle()
Clears the document or folder handle, if defined.
Definition: PlotApi.h:650
PlotPropValueType GetType() const
Gets the property value type.
Definition: PlotApi.h:784
BeFileNameCR HfsOrUfs() const
Gets the host file specification if defined, otherwise the universal file specification.
Definition: PlotApi.h:495
PlotOrientation
Printing system orientation.
Definition: PlotApi.h:163
PlotFileSpec(DgnDocumentCP document)
Constructs a PlotFileSpec from a DgnDocument.
Definition: PlotApi.h:343
bool IsHandleDefined() const
True if DgnDocument or DgnFolder is defined.
Definition: PlotApi.h:585
bool GetBool() const
Gets the property value as an boolean.
Definition: PlotApi.h:810
BeFileName GetDisplayFullName(bool includeEmbeddedSuffix=false) const
Gets the Ufs if DMS managed, otherwise GetHfsOrUfs (includeEmbeddedSuffix).
Definition: PlotApi.h:596
This file is the top-level include file to access all APIs supported by the DgnPlatform library and i...
PlotPropValue(PlotPropValueCR source)
Copy constructor.
Definition: PlotApi.h:759
DgnDocumentP Document() const
DgnDocument pointer. May be undefined.
Definition: PlotApi.h:558
PlotPropValue(WCharCP value)
Constructs from a string value.
Definition: PlotApi.h:756
struct DgnPlatform::DgnDocument * DgnDocumentP
Definition: DgnPlatform.h:195
void mdlPlot_setErrno(PlotError value)
Sets the current global plot error number.
struct DgnPlatform::DgnDocument const * DgnDocumentCP
Definition: DgnPlatform.h:195
void SetMoniker(WCharCP value)
Sets the externalized DMS moniker string.
Definition: PlotApi.h:508
DPoint2d totalSize
Physical paper size.
Definition: PlotApi.h:226
void UpdateFromHandle()
Updates the FolderSpec from its contained handle, if defined.
Definition: PlotApi.h:638
bool IsDms() const
True if this file is DMS managed.
Definition: PlotApi.h:588
void SetIsNew(bool value)
Sets flag indicating if this specification represents a file or folder being created.
Definition: PlotApi.h:555
void SetUfsOnly(WStringCR value)
Sets the universal file specification without clearing anything.
Definition: PlotApi.h:443
PlotPropValueType
Printing system property value type.
Definition: PlotApi.h:171
WString ToString() const
Gets the display full name, including embedded suffix.
Definition: PlotApi.h:620
bmap< WString, PlotPropValue > & PlotPropertyMapR
Definition: PlotApi.h:856
void Assign(double value)
Assigns a floating-point value.
Definition: PlotApi.h:790
WCharCP GetString() const
Gets the property value as a string.
Definition: PlotApi.h:818
~PlotPropValue()
Definition: PlotApi.h:747
bmap< WString, PlotPropValue > * PlotPropertyMapP
Definition: PlotApi.h:854
DPoint2d printableSize
Printable size.
Definition: PlotApi.h:230
Definition: DgnDocumentManager.h:669
2d point coordinates.
Definition: dpoint2d.h:23
void SetDocument(DgnDocumentCP value)
Set the DgnDocument for this file specification. Adds reference to document.
Definition: PlotApi.h:561
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
void SetMoniker(WStringCR value)
Sets the externalized DMS moniker string.
Definition: PlotApi.h:520

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.