CFx SDK Documentation  2020SP3
DbHostAppServices.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 _ODDBHOSTAPPLICATIONSERVICES_INCLUDED_
28 #define _ODDBHOSTAPPLICATIONSERVICES_INCLUDED_
29 
30 
31 #include "TD_PackPush.h"
32 
33 #include "SmartPtr.h"
34 #include "DbBaseHostAppServices.h"
35 #include "DbLayoutManager.h"
36 #include "OdStreamBuf.h"
37 #include "DbDatabase.h"
38 #include "OdFont.h"
39 #include "OdBinaryData.h"
40 #include "DbSecurity.h"
42 #include "ModelerGeometryCreator.h"
43 
44 class OdDbKey;
45 class OdDbAbstractClipBoundaryDefinition;
46 class ClipBoundaryArray;
48 class OdDbPageController;
49 
54 
55 
65 {
66 public:
68 
71 
120  const OdString& filename,
121  OdDbBaseDatabase* pDb = 0,
122  FindFileHint hint = kDefault);
123 
128 
138  virtual void releaseProgressMeter(
139  OdDbHostAppProgressMeter* pProgressMeter);
140 
147  virtual OdRxClass* databaseClass() const;
148 
172  bool createDefault = true,
173  OdDb::MeasurementValue measurement = OdDb::kEnglish) const;
174 
188  OdStreamBuf* pStreamBuf,
189  bool allowCPConversion = false,
190  bool partialLoad = false,
191  const OdPassword& password = OdPassword());
192 
208  OdStreamBuf* pStreamBuf,
209  OdDbAuditInfo *pAuditInfo = 0,
210  const OdPassword& password = OdPassword());
211 
231  const OdString& filename,
232  bool allowCPConversion = false,
233  bool partialLoad = false,
235  const OdPassword& password = OdPassword())
236  {
237  Oda::FileAccessMode nDesiredAccess = Oda::kFileRead;
238  return readFile(odSystemServices()->createFile(filename, nDesiredAccess, shareMode),
239  allowCPConversion, partialLoad, password);
240  }
241 
242 
249  virtual const OdString program();
250 
257  virtual const OdString product();
258 
265  virtual const OdString companyName();
266 
283  virtual ProdIdCode prodcode();
284 
292 
299  virtual int releaseMajorVersion();
300 
307  virtual int releaseMinorVersion();
308 
315  virtual const OdString versionString();
316 
329  //virtual void warning(
330  // const OdString& message) { odSystemServices()->warning(NULL, message); };
331  //virtual void warning(
332  // const char* warnVisGroup,
333  // const OdString& message) { odSystemServices()->warning(warnVisGroup, message); };
334  //virtual void warning(
335  // OdWarning warningOb) { warning(NULL, getErrorDescription(warningOb)); }
336  //virtual void warning(
337  // const char* warnVisGroup,
338  // OdWarning warningOb) { warning(warnVisGroup, getErrorDescription(warningOb)); }
339 
340  virtual void warning(
341  OdWarning warningOb,
342  OdDbObjectId objectId) { warning(NULL, warningOb, objectId); }
343  virtual void warning(
344  const char* warnVisGroup,
345  OdWarning warningOb,
346  OdDbObjectId objectId);
347  virtual void warning(
348  const OdError& err) { warning(NULL, err.description()); }
349  virtual void warning(
350  const char* warnVisGroup,
351  const OdError& err) { warning(warnVisGroup, err.description()); }
352 
361  unsigned int errorCode);
362 
368  unsigned int errorCode,...);
369 #ifdef ODA_FORMAT
370  virtual OdString formatMessage(unsigned int errorCode, long i, const OdString& str) { return formatMessage(errorCode, i, (void*)str.c_str()); }
371 #endif
372 
373 
381  virtual bool doFullCRCCheck();
382 
392 
403  virtual void auditPrintReport(
404  OdAuditInfo* pAuditInfo,
405  const OdString& strLine,
406  int printDest) const;
407 
416 
429 /* Moved to OdDbBaseHostAppServices
430  virtual bool ttfFileNameByDescriptor(
431  const OdTtfDescriptor& description,
432  OdString& filename) = 0;
433 */
434 #define REGVAR_DEF(type, name, unused3, unused4, unused5)\
435 protected:\
436  \
437  type m_##name;\
438 public:\
439  \
440  SVARS_FUNC_MODIFIER type get##name() const;\
441  \
442  \
443  SVARS_FUNC_MODIFIER void set##name(type val);
444 
445 #include "SysVarDefs.h"
446 
447 #undef REGVAR_DEF
448 
449 
451 
462  virtual OdString getFontMapFileName() const;
463 
492  const OdString& fontName,
493  OdFontType fontType);
494 
524  const OdString& fontName,
525  OdFontType fontType);
526 
541  const OdFont& pFont,
542  OdChar unicodeChar, OdDbBaseDatabase *pDb);
543 
552  virtual bool getSystemFontFolders(
553  OdStringArray& aDirs);
554 
565  virtual void collectFilePathsInDirectory(OdStringArray& res, // out
566  const OdString& sPath, // in
567  const OdString& sFilter = L"*.*");
568 
577 
594  virtual bool getPassword(
595  const OdString& dwgName,
596  bool isXref,
597  OdPassword& password);
598 
599  /* { Secret } */
601 
615 
626 
656  int flags,
657  const OdString& dialogCaption = OdString::kEmpty,
658  const OdString& defExt = OdString::kEmpty,
659  const OdString& defFilename = OdString::kEmpty,
660  const OdString& filter = OdString::kEmpty);
661 
663 
668 
673 
677  virtual void getThumbSize(unsigned int& nWidth, unsigned int& nHeight);
678 
687  OdRxObject* pViewObj = NULL,
688  OdDbBaseDatabase* pDb = NULL,
689  OdUInt32 flags = 0);
690 
694  virtual OdString getTempPath() const;
695 
697 
698  virtual OdResult brepBuilder(OdBrepBuilder& brepBuilder, BrepType bbType)
699  {
700  OdRxClassPtr pService(odrxServiceDictionary()->getAt(OD_T("OdModelerGeometryCreator")));
701  if (!pService.isNull())
702  {
703  OdModelerGeometryCreatorPtr pCreator = pService->create();
704  if (!pCreator.isNull())
705  {
706  return pCreator->initBrepBuilder(brepBuilder, bbType);
707  }
708  }
709  return eNoInterface;
710 }
711 
712 #ifdef SWIG
713  friend class OdDbHostAppServices2;
714 private:
715 #endif
716  virtual OdDbKey* key() const = 0;
717 protected:
721 // OdMutex m_WarningMutex;
725 };
726 
736 {
737  virtual OdDbKey* key() const;
738 protected:
740 };
741 
742 #include "TD_PackPop.h"
743 
744 #endif /* _ODDBHOSTAPPLICATIONSERVICES_INCLUDED_ */
745 
746 
747 
OdDbHostAppServices::m_pPwdCache
OdPwdCachePtr m_pPwdCache
Definition: DbHostAppServices.h:724
DbSecurity.h
OdResult
OdResult
Definition: OdResult.h:29
OdDb::MeasurementValue
MeasurementValue
Definition: OdaDefs.h:437
OdString
Definition: OdString.h:95
OdDbDatabase
Definition: DbDatabase.h:421
NULL
#define NULL
Definition: GsProperties.h:177
OdDbHostAppServices::getPasswordCache
virtual OdPwdCachePtr getPasswordCache()
OdDbHostAppServices::readFile
virtual OdDbDatabasePtr readFile(OdStreamBuf *pStreamBuf, bool allowCPConversion=false, bool partialLoad=false, const OdPassword &password=OdPassword())
OdDbHostAppServices::doFullCRCCheck
virtual bool doFullCRCCheck()
OdDbHostAppServices2::m_KeyMutex
OdMutex m_KeyMutex
Definition: DbHostAppServices.h:739
odSystemServices
TOOLKIT_EXPORT OdDbSystemServices * odSystemServices()
OdDbHostAppServices::getSubstituteFontByChar
virtual OdString getSubstituteFontByChar(const OdFont &pFont, OdChar unicodeChar, OdDbBaseDatabase *pDb)
OdDbHostAppServices::prodcode
virtual ProdIdCode prodcode()
OdDbHostAppServices::warning
virtual void warning(OdWarning warningOb, OdDbObjectId objectId)
Definition: DbHostAppServices.h:340
OdDbHostAppServices::getThumbSize
virtual void getThumbSize(unsigned int &nWidth, unsigned int &nHeight)
OdPassword
OdString OdPassword
Definition: DbSecurity.h:52
OdDbHostAppServices::OdDbHostAppServices
OdDbHostAppServices()
OdRxObject
Definition: RxObject.h:564
OdDbObjectId
Definition: DbObjectId.h:99
OdDbBaseHostAppServices::formatMessage
virtual OdString formatMessage(unsigned int errorCode,...)
kDefault
@ kDefault
Definition: BrEnums.h:102
OdDbHostAppServices::warning
virtual void warning(const OdError &err)
Definition: DbHostAppServices.h:347
OdDbHostAppServices::getAlternateFontName
virtual OdString getAlternateFontName() const
OdDbHostAppServices::gsBitmapDevice
virtual OdGsDevicePtr gsBitmapDevice(OdRxObject *pViewObj=NULL, OdDbBaseDatabase *pDb=NULL, OdUInt32 flags=0)
OdDb::kEnglish
@ kEnglish
English system.
Definition: OdaDefs.h:438
OdDbHostAppServices::getHistoryFile
virtual OdStreamBufPtr getHistoryFile(OdDbDatabase *)
OdError::description
OdString description() const
OdArray< OdString >
TD_PackPop.h
Oda::kFileRead
@ kFileRead
Definition: RxSystemServices.h:56
ProdIdCode
ProdIdCode
Definition: DbBaseHostAppServices.h:69
OdDbPageControllerPtr
OdSmartPtr< OdDbPageController > OdDbPageControllerPtr
Definition: DbHostAppServices.h:48
OdDbHostAppServices::newProgressMeter
virtual OdDbHostAppProgressMeter * newProgressMeter()
OdDbHostAppServices::warning
virtual void warning(const char *warnVisGroup, const OdError &err)
Definition: DbHostAppServices.h:349
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
Oda::kShareDenyNo
@ kShareDenyNo
Definition: RxSystemServices.h:68
OD_T
#define OD_T(x)
Definition: OdPlatformSettings.h:714
ModelerGeometryCreator.h
OdDbHostAppServices::TD_USING
TD_USING(OdDbBaseHostAppServices::warning)
OdBinaryData.h
OdDbHostAppServices::pageObjects
virtual OdResult pageObjects(OdDbDatabase *pDb)
OdDbHostAppServices::newPageController
virtual OdDbPageControllerPtr newPageController()
OdDbHostAppProgressMeter
Definition: DbHostAppProgressMeter.h:58
OdDbHostAppServices::companyName
virtual const OdString companyName()
OdDbHostAppServices::fileDialog
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)
OdDbBaseHostAppServices
Definition: DbBaseHostAppServices.h:85
OdStreamBuf.h
OdRxClass
Definition: RxObject.h:865
OdDbHostAppServices2
Definition: DbHostAppServices.h:736
OdSmartPtr
Definition: SmartPtr.h:58
OdDbHostAppServices::releaseMajorMinorString
virtual const OdString releaseMajorMinorString()
OdDbHostAppServices::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdDbHostAppServices)
OdDbHostAppServices::getSystemFontFolders
virtual bool getSystemFontFolders(OdStringArray &aDirs)
DbDatabase.h
OdDbPlotSettingsValidator
Definition: DbPlotSettingsValidator.h:57
OdDbHostAppServices::versionString
virtual const OdString versionString()
OdDbHostAppServices::releaseMajorVersion
virtual int releaseMajorVersion()
OdDbHostAppServices::releaseMinorVersion
virtual int releaseMinorVersion()
SysVarDefs.h
OdDbHostAppServices::auditPrintReport
virtual void auditPrintReport(OdAuditInfo *pAuditInfo, const OdString &strLine, int printDest) const
OdDbHostAppServices::databaseClass
virtual OdRxClass * databaseClass() const
OdDbBaseHostAppServices::warning
virtual void warning(const OdString &message)
OdDbHostAppServices::recoverFile
virtual OdDbDatabasePtr recoverFile(OdStreamBuf *pStreamBuf, OdDbAuditInfo *pAuditInfo=0, const OdPassword &password=OdPassword())
OdChar
wchar_t OdChar
Definition: OdPlatformSettings.h:745
OdDbHostAppServices::getTempPath
virtual OdString getTempPath() const
OdDbHostAppServices::getSubstituteFont
virtual OdString getSubstituteFont(const OdString &fontName, OdFontType fontType)
OdDbHostAppServices::brepBuilder
virtual OdResult brepBuilder(OdBrepBuilder &brepBuilder, BrepType bbType)
Definition: DbHostAppServices.h:698
OdDbBaseHostAppServices::FindFileHint
FindFileHint
Definition: DbBaseHostAppServices.h:99
OdDbHostAppServices::getPassword
virtual bool getPassword(const OdString &dwgName, bool isXref, OdPassword &password)
OdDbHostAppServices::findFile
virtual OdString findFile(const OdString &filename, OdDbBaseDatabase *pDb=0, FindFileHint hint=kDefault)
OdDbHostAppServices::warning
virtual void warning(const char *warnVisGroup, OdWarning warningOb, OdDbObjectId objectId)
OdDbHostAppServices::~OdDbHostAppServices
virtual ~OdDbHostAppServices()
OdDbHostAppServices::collectFilePathsInDirectory
virtual void collectFilePathsInDirectory(OdStringArray &res, const OdString &sPath, const OdString &sFilter=L"*.*")
OdHatchPatternManager
Definition: HatchPatternManager.h:43
OdDbHostAppServices
Definition: DbHostAppServices.h:65
DbBaseHostAppServices.h
TD_PackPush.h
DbPlotSettingsValidator.h
OdDbHostAppServices::getPreferableFont
virtual OdString getPreferableFont(const OdString &fontName, OdFontType fontType)
OdDbHostAppServices::layoutManager
virtual OdDbLayoutManagerPtr layoutManager() const
OdDbHostAppServices::formatMessage
virtual OdString formatMessage(unsigned int errorCode,...)
ODRX_ABSTRACT
#define ODRX_ABSTRACT
Definition: OdPlatformSettings.h:117
OdBrepBuilder
Definition: BrepBuilder.h:47
SmartPtr.h
OdDbHostAppServices::releaseProgressMeter
virtual void releaseProgressMeter(OdDbHostAppProgressMeter *pProgressMeter)
OdDbHostAppServices::readFile
virtual OdDbDatabasePtr readFile(const OdString &filename, bool allowCPConversion=false, bool partialLoad=false, Oda::FileShareMode shareMode=Oda::kShareDenyNo, const OdPassword &password=OdPassword())
Definition: DbHostAppServices.h:230
OdDbHostAppServices::m_LayoutManagerMutex
OdMutex m_LayoutManagerMutex
Definition: DbHostAppServices.h:718
OdDbHostAppServices::m_PwdCacheMutex
OdMutex m_PwdCacheMutex
Definition: DbHostAppServices.h:720
OdDbHostAppServices::m_pValidator
OdDbPlotSettingsValidatorPtr m_pValidator
Definition: DbHostAppServices.h:723
BrepType
BrepType
Definition: BrepBuilder.h:35
OdStreamBuf
Definition: OdStreamBuf.h:67
OdDbHostAppServices::getErrorDescription
virtual OdString getErrorDescription(unsigned int errorCode)
OdDbHostAppServices::getDgnHostAppServices
virtual OdDbBaseHostAppServices * getDgnHostAppServices() const
OdError
Definition: OdError.h:43
OdDbPageController
Definition: DbPageController.h:82
odrxServiceDictionary
FIRSTDLL_EXPORT OdRxDictionaryPtr odrxServiceDictionary()
OdFontType
OdFontType
Definition: OdFont.h:49
OdDbHostAppServices::m_ValidatorMutex
OdMutex m_ValidatorMutex
Definition: DbHostAppServices.h:719
OdRxClass::create
virtual OdRxObjectPtr create() const =0
DbLayoutManager.h
OdDbHostAppServices::educationalPlotStamp
virtual OdUInt32 educationalPlotStamp() const
OdString::kEmpty
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition: OdString.h:98
TOOLKIT_EXPORT
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdDbHostAppServices::product
virtual const OdString product()
OdDbHostAppServices::m_pLayoutManager
OdDbLayoutManagerPtr m_pLayoutManager
Definition: DbHostAppServices.h:722
OdDbAuditInfo
Definition: DbAudit.h:60
OdAuditInfo
Definition: OdAuditInfo.h:48
OdString::c_str
const OdChar * c_str() const
Definition: OdString.h:200
OdFont
Definition: OdFont.h:235
OdMutex
Definition: OdMutex.h:50
Oda::FileShareMode
FileShareMode
Definition: RxSystemServices.h:64
OdFont.h
Oda::FileAccessMode
FileAccessMode
Definition: RxSystemServices.h:55
OdDbHostAppServices::getFontMapFileName
virtual OdString getFontMapFileName() const
OdDbHostAppServices::key
virtual OdDbKey * key() const =0
OdDbHostAppServices::plotSettingsValidator
virtual OdDbPlotSettingsValidator * plotSettingsValidator()
OdDbHostAppServices::newUndoController
virtual OdDbUndoControllerPtr newUndoController()
OdDbHostAppServices::createDatabase
virtual OdDbDatabasePtr createDatabase(bool createDefault=true, OdDb::MeasurementValue measurement=OdDb::kEnglish) const
OdDbHostAppServices::program
virtual const OdString program()
OdDbHostAppServices::patternManager
virtual OdHatchPatternManager * patternManager()=0