ISessionMgr.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 #include "DocumentManager.h"
11 
12 
14 /*=================================================================================**/
39  {
43  };
44 
46 enum class UIItemStateType
47  {
48  None = 0,
49  Visible = (1 << 0),
50  Enabled = (1 << 1),
51  Checked = (1 << 2),
52  };
53 
54 
55 /*=================================================================================**/
61  {
62  virtual void _OnMasterFileStart (DgnFileR) {}
63  virtual void _OnMasterFileStop (DgnFileR, bool changingFiles) {}
64 
65  virtual void _OnModelRefPreActivate (DgnModelRefR modelRef) {}
66  virtual void _OnModelRefActivate (DgnModelRefR newModelRef, DgnModelRefP oldModelRef) {}
67  virtual void _OnModelRefActivated (DgnModelRefR newModelRef, DgnModelRefP oldModelRef) {}
68 
69  virtual void _OnReleaseWriteLock (T_DgnFilePtrVectorCR dgnFileVector) {}
70  virtual void _OnReleasedWriteLock (T_DgnFilePtrVectorCR dgnFileVector) {}
71 
72  virtual void _OnWriteLocked (DgnFileR) {}
74 
75  virtual bool __cdecl Dummy5() {return false;}
76  virtual bool __cdecl Dummy4() {return false;}
77  virtual bool __cdecl Dummy3() {return false;}
78  virtual bool __cdecl Dummy2() {return false;}
79  virtual bool __cdecl Dummy1() {return false;}
80  };
81 
82 /*=================================================================================**/
87 {
88 private:
89  virtual void MakeClassAbstract() = 0;
90 public:
91 public:
93  MSCORE_EXPORT static DgnHostR GetMicroStationDgnHost();
94 
96  MSCORE_EXPORT static ISessionMgrR GetManager();
97 
101  MSCORE_EXPORT DgnDocumentP GetMaster();
102 
106  MSCORE_EXPORT static DgnFileP GetMasterDgnFile();
107 
111  MSCORE_EXPORT static DgnFileP GetActiveDgnFile();
112 
116  MSCORE_EXPORT static DgnModelP GetActiveDgnModelP();
117 
120  MSCORE_EXPORT static bool IsMasterFileClosing();
121 
124  MSCORE_EXPORT static bool IsDesignFileInitialized();
125 
128  MSCORE_EXPORT bool IsReadyForUIProcessing();
129 
132  MSCORE_EXPORT static bool IsMasterDgnFile(DgnFileP);
133 
136  MSCORE_EXPORT static bool IsActiveDgnFile(DgnFileP);
137 
140  MSCORE_EXPORT static DgnModelRefP GetActiveDgnModelRefP();
141 
144  MSCORE_EXPORT static bool IsActiveModel(DgnModelRefCP);
145 
148  MSCORE_EXPORT static bool InMasterFile(DgnModelRefP);
149 
152  MSCORE_EXPORT static bool InActiveFile(DgnModelRefP);
153 
156  MSCORE_EXPORT static bool InTransactableFile(DgnModelRefP);
157 
159  MSCORE_EXPORT static void SetAutoLockActiveModel(bool val);
161  MSCORE_EXPORT static bool IsActiveModelLocked();
163  MSCORE_EXPORT static void SetActiveModelLocked(bool val);
165 
190  MSCORE_EXPORT DgnPlatform::DgnFileStatus SwitchToNewFile(DgnDocumentR doc, WCharCP inputModelName, int fileType, bool doUpdate, bool releaseReferences, bool reopeningAfterSave = false, bool runInitUCM = false);
191 
209  MSCORE_EXPORT DgnFilePtr FindDesignFile(DgnPlatform::DgnFileStatus& status, WCharCP inFileName, WCharCP inModelName, int fileType, bool allowCancel);
210 
218  MSCORE_EXPORT DgnDocumentPtr OpenDgnFileDialog(DgnPlatform::DgnFileStatus& status);
219 
230  MSCORE_EXPORT StatusInt CreateNewDgnFile(WStringR newName, WCharCP defaultDir, bool switchToNewFile);
231 
238  MSCORE_EXPORT static void AddSessionMonitor(SessionMonitor& mon);
239 
245  MSCORE_EXPORT static void DropSessionMonitor(SessionMonitor& mon);
246 
249  MSCORE_EXPORT T_DgnFilePtrVectorCR GetWriteableFiles();
250 
253  MSCORE_EXPORT bool SaveDgnFileChanges(T_DgnFilePtrVectorCR docs);
254 
261  MSCORE_EXPORT void SetUIItemState(WCharCP key, UIItemStateType itemState, bool value, bool sendImmediateMessage = false);
262 
269  MSCORE_EXPORT bool GetUIItemState(WCharCP key, UIItemStateType itemState, bool defaultIfKeyNotFound);
270 
276  MSCORE_EXPORT void SetUIItemMenuMarkState(WCharCP key, MenuMarkType value = MARK_NONE, bool sendImmediateMessage = false);
277 
283  MSCORE_EXPORT MenuMarkType GetUIItemMenuMarkState(WCharCP key, MenuMarkType defaultIfKeyNotFound = MARK_NONE);
284 
288  MSCORE_EXPORT void RemoveUIItemStateEntry(WCharCP key);
289 };
290 
291 
virtual void _OnModelRefPreActivate(DgnModelRefR modelRef)
Definition: ISessionMgr.h:65
DgnFileStatus
Definition: DgnPlatformErrors.r.h:66
virtual bool __cdecl Dummy4()
Definition: ISessionMgr.h:76
virtual bool __cdecl Dummy2()
Definition: ISessionMgr.h:78
The Session Manager manages the Master DGN.
Definition: ISessionMgr.h:86
#define END_BENTLEY_MSTNPLATFORM_NAMESPACE
Definition: DgnPlatform.h:30
ChooseMasterFileStatus
Definition: ISessionMgr.h:38
virtual void _OnMasterFileStart(DgnFileR)
Definition: ISessionMgr.h:62
A DgnDocument represents a file.
Definition: DgnDocumentManager.h:385
UIItemStateType
The state types that match up with the different expression type in an XCommad definiton.
Definition: ISessionMgr.h:46
Definition: dlogbox.r.h:472
For use with Toggle expression.
#define BEGIN_BENTLEY_MSTNPLATFORM_NAMESPACE
Definition: DgnPlatform.h:29
bvector< DgnFilePtr > const & T_DgnFilePtrVectorCR
Definition: DocumentManager.h:32
A DgnFile is an in-memory representation of a physical file, regardless of its format.
Definition: DgnFile.h:308
wchar_t const * WCharCP
Definition: Bentley.h:224
virtual bool __cdecl Dummy3()
Definition: ISessionMgr.h:77
virtual void _OnWriteLocked(DgnFileR)
Definition: ISessionMgr.h:72
virtual void _OnModelRefActivate(DgnModelRefR newModelRef, DgnModelRefP oldModelRef)
Definition: ISessionMgr.h:66
Definition: DgnHost.h:19
A DgnModel represents a DgnModel in memory.
Definition: DgnModel.h:236
virtual void _OnReleasedWriteLock(T_DgnFilePtrVectorCR dgnFileVector)
Definition: ISessionMgr.h:70
virtual bool __cdecl Dummy1()
Definition: ISessionMgr.h:79
virtual bool __cdecl Dummy5()
Definition: ISessionMgr.h:75
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
Definition: DgnModelRef.h:172
IManager * GetManager()
Return a pointer to the one and only relationship manager.
MenuMarkType
Definition: dlogbox.r.h:470
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
Create a subclass of this class to monitor significant session-related events.
Definition: ISessionMgr.h:60
virtual void _OnMasterFileStop(DgnFileR, bool changingFiles)
Definition: ISessionMgr.h:63
struct DgnPlatform::DgnModelRef const * DgnModelRefCP
Definition: DgnPlatform.h:223
virtual void _OnChooseMasterFile(ChooseMasterFileStatus &, DgnDocumentPtr &, WCharCP modelName)
Definition: ISessionMgr.h:73
int StatusInt
Definition: Bentley.h:222
virtual void _OnModelRefActivated(DgnModelRefR newModelRef, DgnModelRefP oldModelRef)
Definition: ISessionMgr.h:67
virtual void _OnReleaseWriteLock(T_DgnFilePtrVectorCR dgnFileVector)
Definition: ISessionMgr.h:69
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
For use with Enable/Disable expression.

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.