CFx SDK Documentation  2023 SP0
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 
@ kDefault
Definition: BrEnums.h:102
BrepType
Definition: BrepBuilder.h:35
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbPageController > OdDbPageControllerPtr
OdString OdPassword
Definition: DbSecurity.h:52
TOOLKIT_EXPORT OdDbSystemServices * odSystemServices()
#define NULL
Definition: GsProperties.h:177
OdFontType
Definition: OdFont.h:49
#define OD_T(x)
unsigned int OdUInt32
#define ODRX_ABSTRACT
wchar_t OdChar
OdResult
Definition: OdResult.h:29
FIRSTDLL_EXPORT OdRxDictionaryPtr odrxServiceDictionary()
bool isNull() const
Definition: BaseObjectPtr.h:70
virtual void warning(const OdString &message)
virtual OdString formatMessage(unsigned int errorCode,...)
virtual OdHatchPatternManager * patternManager()=0
virtual OdString getSubstituteFont(const OdString &fontName, OdFontType fontType)
virtual OdStreamBufPtr getHistoryFile(OdDbDatabase *)
virtual void auditPrintReport(OdAuditInfo *pAuditInfo, const OdString &strLine, int printDest) const
virtual OdUInt32 educationalPlotStamp() const
virtual OdString getPreferableFont(const OdString &fontName, OdFontType fontType)
virtual OdString getTempPath() const
virtual const OdString product()
virtual int releaseMajorVersion()
virtual OdGsDevicePtr gsBitmapDevice(OdRxObject *pViewObj=NULL, OdDbBaseDatabase *pDb=NULL, OdUInt32 flags=0)
OdDbPlotSettingsValidatorPtr m_pValidator
virtual OdDbDatabasePtr readFile(const OdString &filename, bool allowCPConversion=false, bool partialLoad=false, Oda::FileShareMode shareMode=Oda::kShareDenyNo, const OdPassword &password=OdPassword())
virtual OdRxClass * databaseClass() const
virtual OdDbPlotSettingsValidator * plotSettingsValidator()
virtual void collectFilePathsInDirectory(OdStringArray &res, const OdString &sPath, const OdString &sFilter=L"*.*")
virtual OdString getFontMapFileName() const
virtual OdDbHostAppProgressMeter * newProgressMeter()
virtual OdResult pageObjects(OdDbDatabase *pDb)
virtual OdString getAlternateFontName() const
virtual int releaseMinorVersion()
virtual OdDbPageControllerPtr newPageController()
virtual OdDbUndoControllerPtr newUndoController()
virtual const OdString versionString()
virtual void warning(const char *warnVisGroup, OdWarning warningOb, OdDbObjectId objectId)
virtual OdPwdCachePtr getPasswordCache()
virtual OdString findFile(const OdString &filename, OdDbBaseDatabase *pDb=0, FindFileHint hint=kDefault)
virtual void getThumbSize(unsigned int &nWidth, unsigned int &nHeight)
virtual OdDbBaseHostAppServices * getDgnHostAppServices() const
virtual OdString getErrorDescription(unsigned int errorCode)
virtual const OdString releaseMajorMinorString()
virtual OdString formatMessage(unsigned int errorCode,...)
ODRX_DECLARE_MEMBERS(OdDbHostAppServices)
OdDbLayoutManagerPtr m_pLayoutManager
virtual bool getPassword(const OdString &dwgName, bool isXref, OdPassword &password)
virtual void warning(OdWarning warningOb, OdDbObjectId objectId)
virtual void warning(const char *warnVisGroup, const OdError &err)
virtual OdString getSubstituteFontByChar(const OdFont &pFont, OdChar unicodeChar, OdDbBaseDatabase *pDb)
virtual bool getSystemFontFolders(OdStringArray &aDirs)
OdPwdCachePtr m_pPwdCache
virtual const OdString companyName()
virtual OdDbKey * key() const =0
virtual ~OdDbHostAppServices()
virtual ProdIdCode prodcode()
virtual OdDbDatabasePtr readFile(OdStreamBuf *pStreamBuf, bool allowCPConversion=false, bool partialLoad=false, const OdPassword &password=OdPassword())
virtual OdResult brepBuilder(OdBrepBuilder &brepBuilder, BrepType bbType)
TD_USING(OdDbBaseHostAppServices::warning)
virtual OdDbDatabasePtr createDatabase(bool createDefault=true, OdDb::MeasurementValue measurement=OdDb::kEnglish) const
virtual OdDbDatabasePtr recoverFile(OdStreamBuf *pStreamBuf, OdDbAuditInfo *pAuditInfo=0, const OdPassword &password=OdPassword())
virtual bool doFullCRCCheck()
virtual void releaseProgressMeter(OdDbHostAppProgressMeter *pProgressMeter)
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 void warning(const OdError &err)
virtual OdDbLayoutManagerPtr layoutManager() const
virtual const OdString program()
OdString description() const
Definition: OdFont.h:235
virtual OdRxObjectPtr create() const =0
const OdChar * c_str() const
Definition: OdString.h:200
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition: OdString.h:98
MeasurementValue
Definition: OdaDefs.h:439
@ kEnglish
English system.
Definition: OdaDefs.h:440
@ kShareDenyNo
int createFile(const OdString &path, const char *data, unsigned int size)