FLImaging 6.6.27.1
GUIManagerView.h
1#pragma once
2
3#include "GUIFixedViewPlacementSet.h"
4#include "GUIDefinitions.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 CResult CreateView(CGUIViewImageBase* pView, int32_t i32L, int32_t i32T, int32_t i32R, int32_t i32B, size_t stParentWindowHandle);
37 static CResult CreateViewImage(CGUIViewImage* pView, int32_t i32L, int32_t i32T, int32_t i32R, int32_t i32B, size_t stParentWindowHandle);
38 static CResult CreateViewGraph(CGUIViewGraph* pView, int32_t i32L, int32_t i32T, int32_t i32R, int32_t i32B, size_t stParentWindowHandle);
39 static CResult CreateView3D(CGUIView3D* pView, int32_t i32L, int32_t i32T, int32_t i32R, int32_t i32B, size_t stParentWindowHandle);
40 static CResult CreateView3DPathEditor(CGUIView3DPathEditor* pView, int32_t i32L, int32_t i32T, int32_t i32R, int32_t i32B, size_t stParentWindowHandle);
41 static 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 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 CResult RemoveFixedViewDeclaration(size_t stIndex);
159 static CResult RemoveFixedViewDeclaration(CGUIFixedViewDeclaration* pFixedViewDeclaration);
160 static CGUIFixedViewDeclaration* GetFixedViewDeclaration(int64_t i64Index);
161
162 static void AddFixedViewPlacementSet(CGUIFixedViewPlacementSet& fvpSet, bool bAddMenuItem = true);
163 static void AddFixedViewPlacementSet(CGUIFixedViewPlacementSet* pFvpSet, bool bAddMenuItem = true);
164 static CResult RemoveFixedViewPlacementSet(size_t stIndex);
165 static int64_t GetFixedViewPlacementSetCount();
166 static CGUIFixedViewPlacementSet* GetFixedViewPlacementSet(size_t stIndex);
167 static CGUIFixedViewPlacementSet* GetFixedViewPlacementSet(const Base::CFLString<wchar_t>& strFvpSetName);
168 static int64_t GetFixedViewPlacementSetIndex(const CGUIFixedViewPlacementSet* pFvpSet);
169
170 static int64_t GetSelectedFixedViewPlacementSetIndex();
171 static CGUIFixedViewPlacementSet* GetSelectedFixedViewPlacementSet();
172
173 static bool SelectFixedViewPlacementSet(const Base::CFLString<wchar_t>& strFvpSetName);
174 static bool SelectFixedViewPlacementSet(size_t stIndex);
175
176 static bool CreateFixedView(size_t stIndex);
177 static bool RelocateFixedView();
178
179 static bool PreDestroyViewImage();
180 static bool PreDestroyViewGraph();
181 static bool PreDestroyView3D();
182 static bool PreDestroyView3DPathEditor();
183 static bool PreDestroyViewDrawing();
184 static bool PreDestroyViewSNAP();
185 static bool PreDestroyViewImageBase();
186
187 static void LButtonDownOnNcHitView(const Base::TPoint<int>& tpScreen);
188 static void LButtonUpOnNcHitView(const Base::TPoint<int>& tpScreen);
189 static void MouseMoveOnNcHitView(Base::TPoint<int>& tpScreen);
190 static bool InitializeLayoutGrip(CWnd* pWndParent);
191 static void HideLayoutGrip();
192 static void ViewNcHitTest(const Base::TPoint<int>& tpScreen);
193
194 static bool IsInitialized();
195
196 static int64_t GetSNAPViewSerialNumber();
197
198 DeclareGetClassType();
199
200 protected:
201 static Foundation::CStencil* GetInternalStencilPtr();
202
203 private:
204 static bool Initialize();
205 static bool Terminate();
206
207 static bool CreateFixedView();
208 static bool ShowOnlySelectedFixedViews();
209
210 static void SetInitialize(bool bSet);
211
212 virtual void OnReceiveBroadcast(const Base::CBroadcastMessage* pMessage) override;
213 static CGUIManagerView* GetObject();
214
215 private:
216 CInternalViewManager* m_pInternal;
217 Base::CFLImage* m_pFliCopySource;
218 Base::CFLImage m_fliIntrinsicCopySource;
219 int64_t m_i64FliCopySourcePageNum;
220 CGUIViewImage* m_pViewCopyFigureSource;
221
222 CGUIViewImage* m_pViewImageThumbnailDraggingSource;
223 Base::CFLImage* m_pFliThumbnailDraggingSource;
224 Base::CFLArray<int32_t> m_flaSelectedThumbnailIdx;
225 bool m_bThumbnailDraggingMode;
226
227 bool m_bUsedUIMultiThread;
228 std::map<CGUIViewImageBase*, CUIThread*>& m_mapThreads;
229 DWORD m_dwClipboardSequenceNumber;
230
231 volatile bool m_bInitialized;
232
233 CGUIWndGrip* m_pLayoutGripVert;
234 CGUIWndGrip* m_pLayoutGripHorz;
235 Base::TPoint<int> m_tpScreenPrev;
236 Base::TRect<int> m_trScreenVertRect;
237 Base::TRect<int> m_trScreenHorzRect;
238 int32_t m_i32MFOffsetX;
239 int32_t m_i32MFOffsetY;
240
241 bool m_bHorzRectVisible;
242 bool m_bVertRectVisible;
243 bool m_bLButtonDownOnNcHitView;
244
245 std::vector<CMultiDocTemplate*>& m_vctMultiDocTemplates;
246 std::map<std::string, CMultiDocTemplate*>& m_mapMultiDocTemplates;
247 std::map<CMultiDocTemplate*, std::string>& m_mapMultiDocTemplatesReverse;
248
249 std::vector<CGUIFixedViewDeclaration*>& m_vctFixedViewDeclaration;
250 std::vector<CGUIFixedViewPlacementSet*>& m_vctFixedViewPlacementSet;
251
252 std::vector<CDocument*>& m_vctDoc;
253 std::vector<CFrameWnd*>& m_vctFrame;
254 std::vector<CView*>& m_vctView;
255
256 std::vector <CGUIChildFrameBase*>& m_vctFrameToResize;
257 std::set <int32_t>& m_setI32FrameX;
258 std::set <int32_t>& m_setI32FrameY;
259
260 size_t m_stSelectedPlacementSet;
261
262 friend class CGUIManager;
263
264 friend class CInternalViewManager;
265 friend class CGUIDialogCreateStencil;
266 };
267 }
268}
269
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