FLImaging 6.10.23.2
GUIManagerView.h
1#pragma once
2
3#include "GUIFixedViewPlacementSet.h"
4#include "DefinitionsGUI.h"
5#include <map>
6#include <set>
7
8class CUIThread;
9
10namespace FLImaging
11{
12 namespace GUI
13 {
15 class CGUIViewImage;
16 class CGUIView3D;
18 class CGUIViewDrawing;
19 class CGUIViewGraph;
20 class CGUIViewSNAP;
21 class CGUIMainFrame;
22 class CGUIViewImageObjectFigure;
23 class CGUIChildFrameBase;
24 class CInternalViewManager;
25 class CGUIDialogCreateStencil;
26 class CGUIWndGrip;
27
28 class FL_EXPORT CGUIManagerView : public Base::CFLBase
29 {
30 CGUIManagerView();
31 CGUIManagerView(const CGUIManagerView& rh);
32 public:
33
34 virtual ~CGUIManagerView();
35
36 static const CResult CreateView(CGUIViewImageBase* pView, int32_t i32L, int32_t i32T, int32_t i32R, int32_t i32B, size_t stParentWindowHandle);
37 static const CResult CreateViewImage(CGUIViewImage* pView, int32_t i32L, int32_t i32T, int32_t i32R, int32_t i32B, size_t stParentWindowHandle);
38 static const CResult CreateViewGraph(CGUIViewGraph* pView, int32_t i32L, int32_t i32T, int32_t i32R, int32_t i32B, size_t stParentWindowHandle);
39 static const CResult CreateView3D(CGUIView3D* pView, int32_t i32L, int32_t i32T, int32_t i32R, int32_t i32B, size_t stParentWindowHandle);
40 static const CResult CreateView3DPathEditor(CGUIView3DPathEditor* pView, int32_t i32L, int32_t i32T, int32_t i32R, int32_t i32B, size_t stParentWindowHandle);
41 static const CResult CreateViewDrawing(CGUIViewDrawing* pView, int32_t i32L, int32_t i32T, int32_t i32R, int32_t i32B, size_t stParentWindowHandle);
42
43 static const CResult CloseView(CGUIViewImageBase* pView);
44 static const CResult DestroyView(CGUIViewImageBase* pView);
45 static const CResult DestroyAllViews();
46
47 static void RemoveViewThread(CUIThread* pThread);
48
49 static bool IsAvailableView(CGUIViewImageBase* pView);
50
51 static bool IsUsedUIMultiThread();
52 static void UseUIMultiThread(bool bUse);
53
54 static void SetThumbnailDraggingMode(bool bSet);
55 static bool IsThumbnailDraggingMode();
56
57 static void UpdateClipboardViewImage();
58
59 static const CResult SetCopySourceImage(Base::CFLImage* pFliSource, int32_t i32PageIndex = -1, double f64MinVal = 0., double f64MaxVal = 1.);
60 static const Base::CFLImage* GetCopySourceImage();
61 static const Base::CFLImage* GetIntrinsicCopySourceImage();
62 static int64_t GetCopySourcePageIndex();
63
64 static void SetViewImageThumbnailDraggingSource(CGUIViewImage* pViewSource);
65 static CGUIViewImage* GetViewImageThumbnailDraggingSource();
66 static CGUIViewImage* GetViewImageCopyFigureSource();
67
68 static void SetThumbnailDraggingImageSource(Base::CFLImage* pFliSource, int32_t i32SelectedPageIndex = -1);
69 static void SetThumbnailDraggingImageSource(Base::CFLImage* pFliSource, Base::CFLArray<int32_t>& flaSelectedThumbnailIndex);
70 static const Base::CFLImage* GetThumbnailDraggingImageSource();
71 static void GetSelectedThumbnailIndex(Base::CFLArray<int32_t>& flaSelectedThumbnailIndex);
72
73 static void CopyFigureObject(CGUIViewImageBase* pViewSource, const std::vector<const Foundation::CFLFigure*>* pVctFigureSrc);
74 static void PasteFigureObject(CGUIViewImageBase* pViewTarget);
75
76 static void ShowHelpDialogViewImage(CGUIViewImage* pView);
77 static void ShowHelpDialogViewGraph(CGUIViewGraph* pView);
78 static void ShowHelpDialogView3D(CGUIView3D* pView);
79 static void ShowHelpDialogViewSNAP(CGUIViewSNAP* pView);
80 static void ShowHelpDialogViewDrawing(CGUIViewDrawing* pView);
81 static void ShowHelpDialogMainFrame(CGUIMainFrame* pMF);
82
83 static void InitializeClassContainer();
84 static std::string ExtractClassName(const type_info& rhs);
85 static std::string ExtractClassNameWithNamespace(const type_info& rhs);
86 static void CommonExtractClassName(std::string& strResult, size_t stInitialPosition);
87
88 static bool AddMultiDocTemplate(UINT uIDResource, CRuntimeClass* pDoc, CRuntimeClass* pFrame, CRuntimeClass* pView);
89 static bool AddWindow(CDocument* pDoc, CFrameWnd* pFrame, CView* pView);
90
91 static bool DeleteWindow(CDocument* pDoc);
92 static bool DeleteWindow(CFrameWnd* pFrame);
93 static bool DeleteWindow(CView* pView);
94
95 static int64_t GetMultiDocTemplateCount();
96
97 static CMultiDocTemplate* GetMultiDocTemplate(size_t stIndex);
98 static CMultiDocTemplate* GetMultiDocTemplate(std::string strMultiDocTemplateName);
99
100 static std::string GetMultiDocTemplateName(size_t stIndex);
101 static std::string GetMultiDocTemplateName(CRuntimeClass* pDoc, CRuntimeClass* pFrame, CRuntimeClass* pView);
102 static std::string GetMultiDocTemplateName(CMultiDocTemplate* pMultiDocTemplate);
103
104 static size_t GetViewCount();
105 static CGUIViewBase* FindViewByIndex(size_t stIndex);
106 static CGUIViewBase* FindViewByIndex(CRuntimeClass* pRtcView, size_t stIndex);
107 static CGUIViewBase* FindViewByIndexDerivedFrom(CRuntimeClass* pRtcView, size_t stIndex);
108
109 static CGUIViewBase* FindViewByViewNumber(size_t stViewNumber);
110 static CGUIViewBase* FindViewByViewNumber(const Base::CFLString<wchar_t>& strTitle);
111 static CGUIViewBase* FindViewByViewNumber(CRuntimeClass* pRtcView, size_t stViewNumber);
112 static CGUIViewBase* FindViewByViewNumber(CRuntimeClass* pRtcView, const Base::CFLString<wchar_t>& strTitle);
113 static CGUIViewBase* FindViewByViewNumberDerivedFrom(CRuntimeClass* pRtcView, size_t stViewNumber);
114 static CGUIViewBase* FindViewByViewNumberDerivedFrom(CRuntimeClass* pRtcView, const Base::CFLString<wchar_t>& strTitle);
115
116 static std::vector<CGUIViewBase*> FindView(const Base::CFLString<wchar_t>& strTitle);
117 static std::vector<CGUIViewBase*> FindView(CRuntimeClass* pRtcView);
118 static std::vector<CGUIViewBase*> FindViewDerivedFrom(CRuntimeClass* pRtcView);
119 static std::vector<CGUIViewBase*> FindView(CRuntimeClass* pRtcView, const Base::CFLString<wchar_t>& strTitle);
120 static std::vector<CGUIViewBase*> FindViewDerivedFrom(CRuntimeClass* pRtcView, const Base::CFLString<wchar_t>& strTitle);
121 static std::vector<CGUIViewImage*> FindViewImage();
122
123 static const CResult FindView(const Base::CFLString<wchar_t>& strTitle, std::vector<CGUIViewBase*>& vctResult);
124 static const CResult FindView(CRuntimeClass* pRtcView, std::vector<CGUIViewBase*>& vctResult);
125 static const CResult FindViewDerivedFrom(CRuntimeClass* pRtcView, std::vector<CGUIViewBase*>& vctResult);
126 static const CResult FindView(CRuntimeClass* pRtcView, const Base::CFLString<wchar_t>& strTitle, std::vector<CGUIViewBase*>& vctResult);
127 static const CResult FindViewDerivedFrom(CRuntimeClass* pRtcView, const Base::CFLString<wchar_t>& strTitle, std::vector<CGUIViewBase*>& vctResult);
128 static const CResult FindViewImage(std::vector<CGUIViewImage*>& vctResult);
129
130 static bool DoesViewImageExist();
131 static bool DoesViewGraphExist();
132 static bool DoesView3DExist();
133 static bool DoesView3DPathEditorExist();
134 static bool DoesViewDrawingExist();
135 static bool DoesViewSNAPExist();
136
137 static bool DoesVisibleViewImageExist();
138 static bool DoesVisibleViewGraphExist();
139 static bool DoesVisibleView3DExist();
140 static bool DoesVisibleView3DPathEditorExist();
141 static bool DoesVisibleViewDrawingExist();
142 static bool DoesVisibleViewSNAPExist();
143
144 // 주어진 문자열과 일치 또는 유사한 제목을 가진 View를 모두 찾아 반환
145 // 대소문자를 구분하지 않고 비교했을 때, 뷰의 제목에 strTitle이 포함되거나, strTitle에 뷰의 제목이 포함되는 경우 해당 뷰를 반환합니다.
146 static std::vector<CGUIViewBase*> FindViewAnyOf(const Base::CFLString<wchar_t>& strTitle);
147
148 static CDocument* FindWindowVDocument(size_t stIndex);
149 static std::vector<CDocument*> FindWindowVDocument(const Base::CFLString<wchar_t>& strTitle);
150 static CFrameWnd* FindWindowFrame(size_t stIndex);
151 static std::vector <CFrameWnd*> FindWindowFrame(const Base::CFLString<wchar_t>& strTitle);
152 static CView* FindWindowView(size_t stIndex);
153 static std::vector <CView*>FindWindowView(const Base::CFLString<wchar_t>& strTitle);
154
155
156 static bool AddFixedViewDeclaration(CGUIFixedViewDeclaration* pFixedViewDeclaration);
157 static int64_t GetFixedViewDeclarationCount();
158 static int64_t GetFixedViewDeclarationIndex(const CGUIFixedViewDeclaration* pFVD);
159 static const CResult RemoveFixedViewDeclaration(size_t stIndex);
160 static const CResult RemoveFixedViewDeclaration(CGUIFixedViewDeclaration* pFixedViewDeclaration);
161 static CGUIFixedViewDeclaration* GetFixedViewDeclaration(int64_t i64Index);
162
163 static const CResult AddFixedViewPlacementSet(CGUIFixedViewPlacementSet& fvpSet, bool bAddMenuItem = true);
164 static const CResult AddFixedViewPlacementSet(CGUIFixedViewPlacementSet* pFvpSet, bool bAddMenuItem = true);
165 static const CResult RemoveFixedViewPlacementSet(size_t stIndex);
166 static int64_t GetFixedViewPlacementSetCount();
167 static CGUIFixedViewPlacementSet* GetFixedViewPlacementSet(size_t stIndex);
168 static CGUIFixedViewPlacementSet* GetFixedViewPlacementSet(const Base::CFLString<wchar_t>& strFvpSetName);
169 static int64_t GetFixedViewPlacementSetIndex(const CGUIFixedViewPlacementSet* pFvpSet);
170
171 static int64_t GetSelectedFixedViewPlacementSetIndex();
172 static CGUIFixedViewPlacementSet* GetSelectedFixedViewPlacementSet();
173
174 static bool SelectFixedViewPlacementSet(const Base::CFLString<wchar_t>& strFvpSetName);
175 static bool SelectFixedViewPlacementSet(size_t stIndex);
176
177 static bool CreateFixedView(size_t stIndex, bool bLoadFixedViewSetting = true);
178 static bool RelocateFixedView();
179
180 static bool PreDestroyViewImage();
181 static bool PreDestroyViewGraph();
182 static bool PreDestroyView3D();
183 static bool PreDestroyView3DPathEditor();
184 static bool PreDestroyViewDrawing();
185 static bool PreDestroyViewSNAP();
186 static bool PreDestroyViewImageBase();
187
188 static void LButtonDownOnNcHitView(const Base::TPoint<int>& tpScreen);
189 static void LButtonUpOnNcHitView(const Base::TPoint<int>& tpScreen);
190 static void MouseMoveOnNcHitView(Base::TPoint<int>& tpScreen);
191 static bool InitializeLayoutGrip(CWnd* pWndParent);
192 static void HideLayoutGrip();
193 static void ViewNcHitTest(const Base::TPoint<int>& tpScreen);
194
195 static bool IsInitialized();
196
197 static int64_t GetSNAPViewSerialNumber();
198
199 DeclareGetClassType();
200
201 protected:
202 static Foundation::CStencil* GetInternalStencilPtr();
203
204 private:
205 static bool Initialize();
206 static bool Terminate();
207
208 static bool CreateFixedView();
209 static bool ShowOnlySelectedFixedViews();
210
211 static void SetInitialize(bool bSet);
212
213 virtual void OnReceiveBroadcast(const Base::CBroadcastMessage* pMessage) override;
214 static CGUIManagerView* GetObject();
215
216 private:
217 CInternalViewManager* m_pInternal;
218 Base::CFLImage* m_pFliCopySource;
219 Base::CFLImage m_fliIntrinsicCopySource;
220 int64_t m_i64FliCopySourcePageNum;
221 CGUIViewImage* m_pViewCopyFigureSource;
222
223 CGUIViewImage* m_pViewImageThumbnailDraggingSource;
224 Base::CFLImage* m_pFliThumbnailDraggingSource;
225 Base::CFLArray<int32_t> m_flaSelectedThumbnailIdx;
226 bool m_bThumbnailDraggingMode;
227
228 bool m_bUsedUIMultiThread;
229 std::map<CGUIViewImageBase*, CUIThread*>& m_mapThreads;
230 DWORD m_dwClipboardSequenceNumber;
231
232 volatile bool m_bInitialized;
233
234 CGUIWndGrip* m_pLayoutGripVert;
235 CGUIWndGrip* m_pLayoutGripHorz;
236 Base::TPoint<int> m_tpScreenPrev;
237 Base::TRect<int> m_trScreenVertRect;
238 Base::TRect<int> m_trScreenHorzRect;
239 int32_t m_i32MFOffsetX;
240 int32_t m_i32MFOffsetY;
241
242 bool m_bHorzRectVisible;
243 bool m_bVertRectVisible;
244 bool m_bLButtonDownOnNcHitView;
245
246 std::vector<CMultiDocTemplate*>& m_vctMultiDocTemplates;
247 std::map<std::string, CMultiDocTemplate*>& m_mapMultiDocTemplates;
248 std::map<CMultiDocTemplate*, std::string>& m_mapMultiDocTemplatesReverse;
249
250 std::vector<CGUIFixedViewDeclaration*>& m_vctFixedViewDeclaration;
251 std::vector<CGUIFixedViewPlacementSet*>& m_vctFixedViewPlacementSet;
252
253 std::vector<CDocument*>& m_vctDoc;
254 std::vector<CFrameWnd*>& m_vctFrame;
255 std::vector<CView*>& m_vctView;
256
257 std::vector <CGUIChildFrameBase*>& m_vctFrameToResize;
258 std::set <int32_t>& m_setI32FrameX;
259 std::set <int32_t>& m_setI32FrameY;
260
261 size_t m_stSelectedPlacementSet;
262
263 friend class CGUIManager;
264
265 friend class CInternalViewManager;
266 friend class CGUIDialogCreateStencil;
267 };
268 }
269}
270
3D 뷰 클래스
Definition GUIView3D.h:118
3D 경로 편집기 클래스
Definition GUIView3DPathEditor.h:29
도면 뷰 클래스
Definition GUIViewDrawing.h:52
그래프 뷰 클래스
Definition GUIViewGraph.h:45
뷰의 기반 클래스
Definition GUIViewImageBase.h:43
이미지 뷰 클래스
Definition GUIViewImage.h:319
SNAP 뷰 클래스
Definition GUIViewSNAP.h:35
Definition D2DObject.h:12