CFx SDK Documentation  2020SP3
FxDocumentManager.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-2020 by Graebert GmbH.
3 //
4 // Permission to use, copy, modify, and distribute this software in
5 // object code form for any purpose and without fee is hereby granted,
6 // provided that the above copyright notice appears in all copies and
7 // that both that copyright notice and the limited warranty and
8 // restricted rights notice below appear in all supporting
9 // documentation.
10 //
11 // GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12 // GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13 // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14 // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15 // UNINTERRUPTED OR ERROR FREE.
16 
17 #pragma once
18 
19 #include "DDKERNEL.h"
20 #include "FxString.h"
21 
22 #include <DbDatabase.h>
23 
24 #if defined (__GNUC__)
25 #include <stdint.h>
26 #endif
27 
28 #include "FxPragmaPush.h"
29 
30 class CFxDocument;
31 class CFxDocumentWindow;
33 
34 class QWidget;
35 
38 
45 {
46 public:
48  virtual ~CFxDocumentManager(void);
49 
50  typedef enum
51  {
52  eNewDefault = 0x0,
53  eNewImperial = 0x1, //imperial or metric
54  } NewFlags;
55 
65  virtual CFxDocument* NewDocument( const CFxString& templateName, uintptr_t newFlags = eNewDefault, const OdPassword& password = OdPassword(), const CFxString& documentName = CFxString() ) = 0;
66 
67  typedef enum
68  {
69  eOpenDefault = 0x0,
70  eOpenRecover = 0x1, //recover or open
71  eOpenReadOnly = 0x2 //open read only or depending on file's attributes
72  } OpenFlags;
73 
83  virtual CFxDocument* OpenDocument( const CFxString& fileName, OdCodePageId* pCodepage, uintptr_t openFlags = eOpenDefault, const OdPassword& password = OdPassword() ) = 0;
84 
90  virtual void CloseDocument( CFxDocument* pDatabase ) = 0;
91 
97 
103  virtual void SetActiveDocument( CFxDocument* pDatabase ) = 0;
104 
110  virtual void SetActiveDocument( CFxDocumentWindow* pDocumnetWindow ) = 0;
111 
116  virtual unsigned short GetDocumentCount() const = 0;
117 
124  virtual CFxDocument* GetDocumentByIndex( unsigned short iIndex ) = 0;
125 
132  virtual CFxDocument* GetDocumentByFxNumber( unsigned short iFxNumber ) = 0;
133 
140  virtual CFxDocument* GetDocumentByFileName( const CFxString& fileName ) = 0;
141 
148  virtual CFxDocument* GetFxDocument( const OdDbDatabase* pDB ) const = 0;
149 
155  virtual void AddReactor( CFxDocumentManagerReactor* pReactor ) = 0;
156 
162  virtual void RemoveReactor( CFxDocumentManagerReactor* pReactor ) = 0;
163 
169 
170 #if defined(_MSC_VER)
171  // Windows only features. Not Implemented on other OSs
172 
178  virtual void PushResourceHandle( HINSTANCE hNewResourceHandle ) = 0;
182  virtual void PushCadResourceHandle() = 0;
186  virtual void PopResourceHandle() = 0;
187 
188  // Windows only End
189 #endif
190 
191 };
192 
193 #include "FxPragmaPop.h"
FxPragmaPop.h
OdString
Definition: OdString.h:95
OdDbDatabase
Definition: DbDatabase.h:421
CFxDocumentManager::CFxDocumentManager
CFxDocumentManager(void)
CFxDocumentManager::GetActiveDocument
virtual CFxDocument * GetActiveDocument()=0
CFxDocumentManager::NewDocument
virtual CFxDocument * NewDocument(const CFxString &templateName, uintptr_t newFlags=eNewDefault, const OdPassword &password=OdPassword(), const CFxString &documentName=CFxString())=0
OdPassword
OdString OdPassword
Definition: DbSecurity.h:52
CFxDocumentManager::CreateDocumentIterator
virtual CFxDocumentIteratorPtr CreateDocumentIterator()=0
CFxDocumentManager::GetDocumentCount
virtual unsigned short GetDocumentCount() const =0
CFxDocumentManager::GetDocumentByFxNumber
virtual CFxDocument * GetDocumentByFxNumber(unsigned short iFxNumber)=0
OdCodePageId
OdCodePageId
Definition: OdCodePage.h:31
CFxDocumentManager::GetDocumentByFileName
virtual CFxDocument * GetDocumentByFileName(const CFxString &fileName)=0
DDKERNEL.h
CFxDocumentManager
Definition: FxDocumentManager.h:45
CFxDocumentManager::GetDocumentByIndex
virtual CFxDocument * GetDocumentByIndex(unsigned short iIndex)=0
FxString.h
CFxDocumentManager::~CFxDocumentManager
virtual ~CFxDocumentManager(void)
CFxDocumentManager::OpenDocument
virtual CFxDocument * OpenDocument(const CFxString &fileName, OdCodePageId *pCodepage, uintptr_t openFlags=eOpenDefault, const OdPassword &password=OdPassword())=0
CFxDocumentManagerReactor
Definition: FxDocumentManagerReactor.h:34
OdSmartPtr
Definition: SmartPtr.h:58
CFxString
Definition: FxString.h:48
DbDatabase.h
CFxDocument
Definition: FxDocument.h:47
DDKERNEL_API
#define DDKERNEL_API
Definition: DDKERNEL.h:32
CFxDocumentManager::CloseDocument
virtual void CloseDocument(CFxDocument *pDatabase)=0
CFxDocumentManager::GetFxDocument
virtual CFxDocument * GetFxDocument(const OdDbDatabase *pDB) const =0
CFxDocumentIterator
Definition: FxDocumentIterator.h:33
CFxDocumentManager::RemoveReactor
virtual void RemoveReactor(CFxDocumentManagerReactor *pReactor)=0
CFxDocumentManager::SetActiveDocument
virtual void SetActiveDocument(CFxDocument *pDatabase)=0
CFxDocumentIteratorPtr
OdSmartPtr< CFxDocumentIterator > CFxDocumentIteratorPtr
Definition: FxDocumentManager.h:36
FxPragmaPush.h
CFxDocumentManager::SetActiveDocument
virtual void SetActiveDocument(CFxDocumentWindow *pDocumnetWindow)=0
CFxDocumentManager::AddReactor
virtual void AddReactor(CFxDocumentManagerReactor *pReactor)=0