CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DbHostAppServices.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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"
35#include "DbLayoutManager.h"
36#include "OdStreamBuf.h"
37#include "DbDatabase.h"
38#include "OdFont.h"
39#include "OdBinaryData.h"
40#include "DbSecurity.h"
43
44class OdDbKey;
45class OdDbAbstractClipBoundaryDefinition;
46class ClipBoundaryArray;
50
55
56
66{
67public:
69
72
121 const OdString& filename,
122 OdDbBaseDatabase* pDb = 0,
123 FindFileHint hint = kDefault);
124
129
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
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)\
435protected:\
436 \
437 type m_##name;\
438public:\
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
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
553 OdStringArray& aDirs);
554
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
645 int flags,
646 const OdString& dialogCaption = OdString::kEmpty,
647 const OdString& defExt = OdString::kEmpty,
648 const OdString& defFilename = OdString::kEmpty,
649 const OdString& filter = OdString::kEmpty);
650
652
657
662
666 virtual void getThumbSize(unsigned int& nWidth, unsigned int& nHeight);
667
676 OdRxObject* pViewObj = NULL,
677 OdDbBaseDatabase* pDb = NULL,
678 OdUInt32 flags = 0);
679
681
682 virtual OdResult brepBuilder(OdBrepBuilder& brepBuilder, BrepType bbType)
683 {
684 OdRxClassPtr pService(odrxServiceDictionary()->getAt(OD_T("OdModelerGeometryCreator")));
685 if (!pService.isNull())
686 {
688 if (!pCreator.isNull())
689 {
690 return pCreator->initBrepBuilder(brepBuilder, bbType);
691 }
692 }
693 return eNoInterface;
694 }
695
696 virtual OdString fixName(const OdDbSymbolTableRecord* pRecord);
697
698#ifdef SWIG
699 friend class OdDbHostAppServices2;
700private:
701#endif
702 virtual OdDbKey* key() const = 0;
703protected:
707// OdMutex m_WarningMutex;
711};
712
720{
721 virtual OdDbKey* key() const;
722protected:
724};
725
726#include "TD_PackPop.h"
727
728#endif /* _ODDBHOSTAPPLICATIONSERVICES_INCLUDED_ */
729
730
731
@ kDefault
Definition: BrEnums.h:132
BrepType
Definition: BrepBuilder.h:43
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbPageController > OdDbPageControllerPtr
OdString OdPassword
Definition: DbSecurity.h:52
TOOLKIT_EXPORT OdDbSystemServices * odSystemServices()
OdFontType
Definition: OdFont.h:52
#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:86
virtual void warning(const OdString &message)
virtual OdString formatMessage(unsigned int errorCode,...)
virtual OdString getSubstituteFont(const OdString &fontName, OdFontType fontType)
virtual OdStreamBufPtr getHistoryFile(OdDbDatabase *)
virtual OdDbKey * key() const =0
virtual void auditPrintReport(OdAuditInfo *pAuditInfo, const OdString &strLine, int printDest) const
virtual OdUInt32 educationalPlotStamp() const
virtual OdString getPreferableFont(const OdString &fontName, OdFontType fontType)
virtual OdDbHostAppProgressMeter * newProgressMeter()
virtual const OdString product()
virtual int releaseMajorVersion()
virtual OdGsDevicePtr gsBitmapDevice(OdRxObject *pViewObj=NULL, OdDbBaseDatabase *pDb=NULL, OdUInt32 flags=0)
OdDbPlotSettingsValidatorPtr m_pValidator
virtual OdRxClass * databaseClass() const
virtual OdDbPlotSettingsValidator * plotSettingsValidator()
virtual OdDbDatabasePtr readFile(const OdString &filename, bool allowCPConversion=false, bool partialLoad=false, Oda::FileShareMode shareMode=Oda::kShareDenyNo, const OdPassword &password=OdPassword())
virtual void collectFilePathsInDirectory(OdStringArray &res, const OdString &sPath, const OdString &sFilter=L"*.*")
virtual OdString fixName(const OdDbSymbolTableRecord *pRecord)
virtual OdString getFontMapFileName() const
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 OdHatchPatternManager * patternManager()=0
virtual void getThumbSize(unsigned int &nWidth, unsigned int &nHeight)
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 OdDbBaseHostAppServices * getDgnHostAppServices() const
virtual bool getSystemFontFolders(OdStringArray &aDirs)
OdPwdCachePtr m_pPwdCache
virtual const OdString companyName()
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:371
virtual OdRxObjectPtr create() const
OdRxObject * get()
Definition: RxObject.h:503
const OdChar * c_str() const
Definition: OdString.h:203
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition: OdString.h:98
MeasurementValue
Definition: OdaDefs.h:442
@ kEnglish
English system.
Definition: OdaDefs.h:443
@ kShareDenyNo