3#include "GUIFixedViewPlacementSet.h"
4#include "GUIDefinitions.h"
14 class CGUIViewImageBase;
17 class CGUIView3DPathEditor;
18 class CGUIViewDrawing;
22 class CGUIViewImageObjectFigure;
23 class CGUIChildFrameBase;
24 class CInternalViewManager;
25 class CGUIDialogCreateStencil;
28 class FL_EXPORT CGUIManagerView :
public Base::CFLBase
31 CGUIManagerView(
const CGUIManagerView& rh);
34 virtual ~CGUIManagerView();
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);
43 static const CResult CloseView(CGUIViewImageBase* pView);
44 static const CResult DestroyView(CGUIViewImageBase* pView);
45 static const CResult DestroyAllViews();
47 static void RemoveViewThread(CUIThread* pThread);
49 static bool IsAvailableView(CGUIViewImageBase* pView);
51 static bool IsUsedUIMultiThread();
52 static void UseUIMultiThread(
bool bUse);
54 static void SetThumbnailDraggingMode(
bool bSet);
55 static bool IsThumbnailDraggingMode();
57 static void UpdateClipboardViewImage();
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();
64 static void SetViewImageThumbnailDraggingSource(CGUIViewImage* pViewSource);
65 static CGUIViewImage* GetViewImageThumbnailDraggingSource();
66 static CGUIViewImage* GetViewImageCopyFigureSource();
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);
73 static void CopyFigureObject(CGUIViewImageBase* pViewSource);
74 static void PasteFigureObject(CGUIViewImageBase* pViewTarget);
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);
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);
88 static bool AddMultiDocTemplate(UINT uIDResource, CRuntimeClass* pDoc, CRuntimeClass* pFrame, CRuntimeClass* pView);
89 static bool AddWindow(CDocument* pDoc, CFrameWnd* pFrame, CView* pView);
91 static bool DeleteWindow(CDocument* pDoc);
92 static bool DeleteWindow(CFrameWnd* pFrame);
93 static bool DeleteWindow(CView* pView);
95 static int64_t GetMultiDocTemplateCount();
97 static CMultiDocTemplate* GetMultiDocTemplate(
size_t stIndex);
98 static CMultiDocTemplate* GetMultiDocTemplate(std::string strMultiDocTemplateName);
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);
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);
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);
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();
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);
130 static bool DoesViewImageExist();
131 static bool DoesViewGraphExist();
132 static bool DoesView3DExist();
133 static bool DoesView3DPathEditorExist();
134 static bool DoesViewDrawingExist();
135 static bool DoesViewSNAPExist();
137 static bool DoesVisibleViewImageExist();
138 static bool DoesVisibleViewGraphExist();
139 static bool DoesVisibleView3DExist();
140 static bool DoesVisibleView3DPathEditorExist();
141 static bool DoesVisibleViewDrawingExist();
142 static bool DoesVisibleViewSNAPExist();
144 static std::vector<CGUIViewBase*> FindViewAnyOf(Base::CFLString<wchar_t> strTitle);
146 static CDocument* FindWindowVDocument(
size_t stIndex);
147 static std::vector<CDocument*> FindWindowVDocument(Base::CFLString<wchar_t> strTitle);
148 static CFrameWnd* FindWindowFrame(
size_t stIndex);
149 static std::vector <CFrameWnd*> FindWindowFrame(Base::CFLString<wchar_t> strTitle);
150 static CView* FindWindowView(
size_t stIndex);
151 static std::vector <CView*>FindWindowView(Base::CFLString<wchar_t> strTitle);
154 static bool AddFixedViewDeclaration(CGUIFixedViewDeclaration* pFLImagingGUIFVP);
155 static int64_t GetFixedViewDeclarationCount();
156 static CResult RemoveFixedViewDeclaration(
size_t stIndex);
157 static CResult RemoveFixedViewDeclaration(CGUIFixedViewDeclaration* pFLImagingGUIFVP);
158 static CGUIFixedViewDeclaration* GetFixedViewDeclaration(int64_t i64Index);
160 static void AddFixedViewPlacementSet(CGUIFixedViewPlacementSet& fvpSet,
bool bAddMenuItem =
true);
161 static void AddFixedViewPlacementSet(CGUIFixedViewPlacementSet* pFvpSet,
bool bAddMenuItem =
true);
162 static CResult RemoveFixedViewPlacementSet(
size_t stIndex);
163 static int64_t GetFixedViewPlacementSetCount();
164 static CGUIFixedViewPlacementSet* GetFixedViewPlacementSet(
size_t stIndex);
165 static CGUIFixedViewPlacementSet* GetFixedViewPlacementSet(
const Base::CFLString<wchar_t>& strFvpSetName);
166 static int64_t GetFixedViewPlacementSetIndex(
const CGUIFixedViewPlacementSet* pFvpSet);
168 static int64_t GetSelectedFixedViewPlacementSetIndex();
169 static CGUIFixedViewPlacementSet* GetSelectedFixedViewPlacementSet();
171 static bool SelectFixedViewPlacementSet(
const Base::CFLString<wchar_t>& strFvpSetName);
172 static bool SelectFixedViewPlacementSet(
size_t stIndex);
174 static bool CreateFixedView(
size_t stIndex);
175 static bool RelocateFixedView();
177 static bool PreDestroyViewImage();
178 static bool PreDestroyViewGraph();
179 static bool PreDestroyView3D();
180 static bool PreDestroyView3DPathEditor();
181 static bool PreDestroyViewDrawing();
182 static bool PreDestroyViewSNAP();
183 static bool PreDestroyViewImageBase();
185 static void LButtonDownOnNcHitView(
const Base::TPoint<int>& tpScreen);
186 static void LButtonUpOnNcHitView(
const Base::TPoint<int>& tpScreen);
187 static void MouseMoveOnNcHitView(Base::TPoint<int>& tpScreen);
188 static bool InitializeLayoutGrip(CWnd* pWndParent);
189 static void HideLayoutGrip();
190 static void ViewNcHitTest(
const Base::TPoint<int>& tpScreen);
192 static bool IsInitialized();
194 static int64_t GetSNAPViewSerialNumber();
196 DeclareGetClassType();
199 static Foundation::CStencil* GetInternalStencilPtr();
202 static bool Initialize();
203 static bool Terminate();
205 static bool CreateFixedView();
206 static bool ShowOnlySelectedFixedViews();
208 static void SetInitialize(
bool bSet);
210 virtual void OnReceiveBroadcast(
const Base::CBroadcastMessage* pMessage)
override;
211 static CGUIManagerView* GetObject();
214 CInternalViewManager* m_pInternal;
215 Base::CFLImage* m_pFliCopySource;
216 Base::CFLImage m_fliIntrinsicCopySource;
217 int64_t m_i64FliCopySourcePageNum;
218 CGUIViewImage* m_pViewCopyFigureSource;
220 CGUIViewImage* m_pViewImageThumbnailDraggingSource;
221 Base::CFLImage* m_pFliThumbnailDraggingSource;
222 Base::CFLArray<int32_t> m_flaSelectedThumbnailIdx;
223 bool m_bThumbnailDraggingMode;
225 bool m_bUsedUIMultiThread;
226 std::map<CGUIViewImageBase*, CUIThread*>& m_mapThreads;
227 DWORD m_dwClipboardSequenceNumber;
229 volatile bool m_bInitialized;
231 CGUIWndGrip* m_pLayoutGripVert;
232 CGUIWndGrip* m_pLayoutGripHorz;
233 Base::TPoint<int> m_tpScreenPrev;
234 Base::TRect<int> m_trScreenVertRect;
235 Base::TRect<int> m_trScreenHorzRect;
236 int32_t m_i32MFOffsetX;
237 int32_t m_i32MFOffsetY;
239 bool m_bHorzRectVisible;
240 bool m_bVertRectVisible;
241 bool m_bLButtonDownOnNcHitView;
243 std::vector<CMultiDocTemplate*>& m_vctMultiDocTemplates;
244 std::map<std::string, CMultiDocTemplate*>& m_mapMultiDocTemplates;
245 std::map<CMultiDocTemplate*, std::string>& m_mapMultiDocTemplatesReverse;
247 std::vector<CGUIFixedViewDeclaration*>& m_vctFixedViewDeclaration;
248 std::vector<CGUIFixedViewPlacementSet*>& m_vctFixedViewPlacementSet;
250 std::vector<CDocument*>& m_vctDoc;
251 std::vector<CFrameWnd*>& m_vctFrame;
252 std::vector<CView*>& m_vctView;
254 std::vector <CGUIChildFrameBase*>& m_vctFrameToResize;
255 std::set <int32_t>& m_setI32FrameX;
256 std::set <int32_t>& m_setI32FrameY;
258 size_t m_stSelectedPlacementSet;
260 friend class CGUIManager;
262 friend class CInternalViewManager;
263 friend class CGUIDialogCreateStencil;