CFx SDK Documentation  2023 SP0
DbBaseHostAppServices.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 
25 
26 
27 #ifndef _ODDB_BASEHOSTAPPSERVICES_INCLUDED_
28 #define _ODDB_BASEHOSTAPPSERVICES_INCLUDED_
29 
30 
31 #include "TD_PackPush.h"
32 
33 
34 #include "DbRootExport.h"
35 #include "DbBaseDatabase.h"
36 #include "DbHostAppProgressMeter.h"
37 #include "RxObject.h"
38 #include "SmartPtr.h"
39 #include "OdFont.h"
41 
42 class OdGsDevice;
47 
48 class OdDbUndoController;
53 
54 class OdAuditInfo;
55 class OdTtfDescriptor;
56 
57 
58 typedef unsigned long LCID;
59 
61 {
66 };
67 
69 {
70  kProd_ACAD = 1, // Plain
71  kProd_LT = 2, // Lite
72  kProd_OEM = 3, // OEM
73  kProd_OdDb = 4 // ..
74 };
75 
76 
85 {
86 public:
88 
90 
92  {
93  kDrawingOpen = 0,
94  kXrefResolution = 1,
95  kRasterResolution = 2
96  };
97 
99  {
100  kDefault = 0, // Any file.
101  kFontFile = 1, // Can be either SHX or TTF file.
102  kCompiledShapeFile = 2, // SHX file.
103  kTrueTypeFontFile = 3, // TTF file.
104  kEmbeddedImageFile = 4, // Image file (ISM).
105  kXRefDrawing = 5, // Drawing template file (DWT).
106  kPatternFile = 6, // Pattern file (PAT).
107  kTXApplication = 7, // Teigha(R) Xtension file (TX).
108  kFontMapFile = 8, // FontMap file (FMP).
109  kUnderlayFile = 9, // Underlay file.
110  kTextureMapFile = 10, // Material texture file.
111  kPhotometricWebFile = 11 // Photometric web file (IES).
112  };
113 
115  {
116  kUseSoftwareHLR = (1 << 0), // Enable use of SoftwareHLR on device
117  kFor2dExportRender = (1 << 1), // Device for shaded viewport export
118  kFor2dExportRenderHLR = (1 << 2), // Device for HiddenLine viewport export
119  kForThumbnail = (1 << 3) // Device for thumbnail image generation
120  };
121 
170  const OdString& filename,
171  OdDbBaseDatabase* pDb = 0,
172  FindFileHint hint = kDefault) = 0;
173 
178 
188  virtual void releaseProgressMeter(
189  OdDbHostAppProgressMeter* pProgressMeter);
190 
200  virtual const OdString program() = 0;
201 
211  virtual const OdString product() = 0;
212 
222  virtual const OdString companyName() = 0;
223 
243  virtual ProdIdCode prodcode();
244 
252 
259  virtual int releaseMajorVersion();
260 
267  virtual int releaseMinorVersion();
268 
275  virtual const OdString versionString();
276 
285  virtual void warning(
286  const OdString& message);
287 
297  virtual void warning(
298  const char* warnVisGroup,
299  const OdString& message);
300 
306  virtual void warning(
307  OdWarning warningOb);
308 
315  virtual void warning(
316  const char* warnVisGroup,
317  OdWarning warningOb);
318 
319  //virtual void warning(
320  // OdWarning warningOb,
321  // OdDbObjectId objectId);
322 
331  unsigned int errorCode);
332 
338  unsigned int errorCode,...);
339 #ifdef ODA_FORMAT
344  virtual OdString formatMessage(unsigned int errorCode, long i, const OdString& str) { return formatMessage(errorCode, i, (void*)str.c_str()); }
345 #endif
346 
356 
367 
378  virtual void auditPrintReport(
379  OdAuditInfo* pAuditInfo,
380  const OdString& strLine,
381  int printDest) const;
382 
396  const OdTtfDescriptor& description,
397  OdString& filename);
398 
406  virtual OdString getAlternateFontName() const = 0;
407 
418  virtual OdString getFontMapFileName() const = 0;
419 
448  const OdString& fontName,
449  OdFontType fontType) = 0;
450 
480  const OdString& fontName,
481  OdFontType fontType) = 0;
482 
497  const OdFont& pFont,
498  OdChar unicodeChar, OdDbBaseDatabase *pDb) { return OdString::kEmpty; }
499 
508  virtual bool getSystemFontFolders(
509  OdStringArray& aDirs);
510 
521  virtual void collectFilePathsInDirectory(OdStringArray& res, // out
522  const OdString& sPath, // in
523  const OdString& sFilter = L"*.*");
524 
554  int flags,
555  const OdString& dialogCaption = OdString::kEmpty,
556  const OdString& defExt = OdString::kEmpty,
557  const OdString& defFilename = OdString::kEmpty,
558  const OdString& filter = OdString::kEmpty);
559 
568  OdRxObject* pViewObj = NULL,
569  OdDbBaseDatabase* pDb = NULL,
570  OdUInt32 flags = 0);
571 
575  virtual OdString getTempPath() const;
576 
577 // ODA_MT_DBIO_BEGIN
581  virtual OdInt16 getMtMode() const;
582 
586  virtual int numThreads(OdDb::MultiThreadedMode mtMode);
587 // ODA_MT_DBIO_END
588 
596  virtual OdResult brepBuilder(OdBrepBuilder& bbuilder, BrepType bbType);
597 };
598 
600 
601 
602 #include "TD_PackPop.h"
603 
604 #endif // _ODDB_BASEHOSTAPPSERVICES_INCLUDED_
@ kDefault
Definition: BrEnums.h:102
BrepType
Definition: BrepBuilder.h:35
OdSmartPtr< OdGsDevice > OdGsDevicePtr
unsigned long LCID
OdSmartPtr< OdDbBaseHostAppServices > OdDbBaseHostAppServicesPtr
OdSmartPtr< OdDbUndoController > OdDbUndoControllerPtr
@ kProd_ACAD
@ kProd_OdDb
@ kSDIAppEnforced
@ kSDIUserAndAppEnforced
@ kMDIEnabled
@ kSDIUserEnforced
#define DBROOT_EXPORT
Definition: DbRootExport.h:39
#define NULL
Definition: GsProperties.h:177
OdFontType
Definition: OdFont.h:49
unsigned int OdUInt32
short OdInt16
#define ODRX_ABSTRACT
wchar_t OdChar
OdResult
Definition: OdResult.h:29
virtual ProdIdCode prodcode()
virtual OdString getPreferableFont(const OdString &fontName, OdFontType fontType)=0
virtual OdGsDevicePtr gsBitmapDevice(OdRxObject *pViewObj=NULL, OdDbBaseDatabase *pDb=NULL, OdUInt32 flags=0)
virtual void warning(const char *warnVisGroup, const OdString &message)
virtual void warning(const OdString &message)
virtual OdString findFile(const OdString &filename, OdDbBaseDatabase *pDb=0, FindFileHint hint=kDefault)=0
virtual void warning(OdWarning warningOb)
virtual int numThreads(OdDb::MultiThreadedMode mtMode)
virtual const OdString releaseMajorMinorString()
virtual OdInt16 getMtMode() const
virtual bool getSystemFontFolders(OdStringArray &aDirs)
virtual const OdString companyName()=0
virtual const OdString versionString()
virtual const OdString program()=0
virtual OdString getSubstituteFontByChar(const OdFont &pFont, OdChar unicodeChar, OdDbBaseDatabase *pDb)
virtual int releaseMajorVersion()
virtual void warning(const char *warnVisGroup, OdWarning warningOb)
virtual OdDbUndoControllerPtr newUndoController()
virtual const OdString product()=0
virtual bool ttfFileNameByDescriptor(const OdTtfDescriptor &description, OdString &filename)
virtual void releaseProgressMeter(OdDbHostAppProgressMeter *pProgressMeter)
virtual OdDbHostAppProgressMeter * newProgressMeter()
virtual OdString getTempPath() const
virtual OdString getSubstituteFont(const OdString &fontName, OdFontType fontType)=0
virtual OdStreamBufPtr newUndoStream()
virtual void collectFilePathsInDirectory(OdStringArray &res, const OdString &sPath, const OdString &sFilter=L"*.*")
ODRX_DECLARE_MEMBERS(OdDbBaseHostAppServices)
virtual int releaseMinorVersion()
virtual void auditPrintReport(OdAuditInfo *pAuditInfo, const OdString &strLine, int printDest) const
virtual OdString getErrorDescription(unsigned int errorCode)
virtual OdResult brepBuilder(OdBrepBuilder &bbuilder, BrepType bbType)
virtual OdString getAlternateFontName() const =0
virtual OdString fileDialog(int flags, const OdString &dialogCaption=OdString::kEmpty, const OdString &defExt=OdString::kEmpty, const OdString &defFilename=OdString::kEmpty, const OdString &filter=OdString::kEmpty)
virtual OdString formatMessage(unsigned int errorCode,...)
virtual OdString getFontMapFileName() const =0
Definition: OdFont.h:235
const OdChar * c_str() const
Definition: OdString.h:200
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition: OdString.h:98
MultiThreadedMode
Definition: OdaDefs.h:424