CFx SDK Documentation  2022 SP0
FxDocumentManager.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-2021 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"
#define DDKERNEL_API
Definition: DDKERNEL.h:32
OdString OdPassword
Definition: DbSecurity.h:52
OdSmartPtr< CFxDocumentIterator > CFxDocumentIteratorPtr
OdCodePageId
Definition: OdCodePage.h:31
virtual CFxDocument * GetDocumentByFxNumber(unsigned short iFxNumber)=0
virtual void SetActiveDocument(CFxDocumentWindow *pDocumnetWindow)=0
virtual ~CFxDocumentManager(void)
virtual void AddReactor(CFxDocumentManagerReactor *pReactor)=0
virtual void RemoveReactor(CFxDocumentManagerReactor *pReactor)=0
virtual void CloseDocument(CFxDocument *pDatabase)=0
virtual unsigned short GetDocumentCount() const =0
virtual CFxDocumentIteratorPtr CreateDocumentIterator()=0
virtual CFxDocument * GetActiveDocument()=0
virtual CFxDocument * GetDocumentByIndex(unsigned short iIndex)=0
virtual CFxDocument * NewDocument(const CFxString &templateName, uintptr_t newFlags=eNewDefault, const OdPassword &password=OdPassword(), const CFxString &documentName=CFxString())=0
virtual CFxDocument * GetFxDocument(const OdDbDatabase *pDB) const =0
virtual CFxDocument * OpenDocument(const CFxString &fileName, OdCodePageId *pCodepage, uintptr_t openFlags=eOpenDefault, const OdPassword &password=OdPassword())=0
virtual void SetActiveDocument(CFxDocument *pDatabase)=0
virtual CFxDocument * GetDocumentByFileName(const CFxString &fileName)=0