Stroika Library 3.0d18
 
Loading...
Searching...
No Matches
LedIt/Sources/LedItView.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4
5#ifndef __LedItView_h__
6#define __LedItView_h__ 1
7
8#include "Stroika/Foundation/StroikaPreComp.h"
9
10#if qStroika_Foundation_Common_Platform_MacOS
11#include "Stroika/Frameworks/Led/Platform/Led_PP_WordProcessor.h"
12#elif defined(WIN32)
13#include "Stroika/Frameworks/Led/Platform/MFC_WordProcessor.h"
14#elif qStroika_FeatureSupported_XWindows
15#include "Stroika/Frameworks/Led/Platform/Led_Gtk_WordProcessor.h"
16#endif
17
18#include "LedItConfig.h"
19#include "LedItResources.h"
20
21#if qStroika_Foundation_Common_Platform_Windows
22class LedItControlItem;
23class LedItDocument;
24#endif
25#if qStroika_FeatureSupported_XWindows
26class LedItDocument;
27#endif
28
29#if qStroika_Foundation_Common_Platform_Windows
30using LedItViewAlmostBASE = Platform::Led_MFC_X<WordProcessor>;
31#endif
32
33DISABLE_COMPILER_MSC_WARNING_START (4250) // inherits via dominance warning
34class LedItView :
35#if qStroika_Foundation_Common_Platform_MacOS
36 public Platform::WordProcessorCommonCommandHelper_PP<Led_PPView_X<WordProcessor>>
37#elif qStroika_Foundation_Common_Platform_Windows
38 public Platform::WordProcessorCommonCommandHelper_MFC<LedItViewAlmostBASE>
39#elif qStroika_FeatureSupported_XWindows
40 public Platform::WordProcessorCommonCommandHelper_Gtk<Led_Gtk_Helper<WordProcessor>>
41#endif
42{
43private:
44#if qStroika_Foundation_Common_Platform_MacOS
45 using inherited = Platform::WordProcessorCommonCommandHelper_PP<Led_PPView_X<WordProcessor>>;
46#elif qStroika_Foundation_Common_Platform_Windows
47 using inherited = Platform::WordProcessorCommonCommandHelper_MFC<LedItViewAlmostBASE>;
48#elif qStroika_FeatureSupported_XWindows
49 using inherited = Platform::WordProcessorCommonCommandHelper_Gtk<Led_Gtk_Helper<WordProcessor>>;
50#endif
51
52#if qStroika_Foundation_Common_Platform_MacOS
53public:
54 LedItView ();
55#elif qStroika_Foundation_Common_Platform_Windows
56protected: // create from serialization only
57 LedItView ();
58 DECLARE_DYNCREATE (LedItView)
59#elif qStroika_FeatureSupported_XWindows
60public:
61 LedItView (LedItDocument* owningDoc);
62#endif
63
64public:
65 virtual ~LedItView ();
66
67#if qStroika_Foundation_Common_Platform_Windows
68protected:
69 virtual void OnInitialUpdate () override;
70#endif
71
72#if qStroika_Foundation_Common_Platform_Windows
73public:
74 virtual bool OnUpdateCommand (CommandUpdater* enabler) override;
75#endif
76
77public:
78 nonvirtual void SetWrapToWindow (bool wrapToWindow);
79
80private:
81 bool fWrapToWindow;
82
83public:
84 virtual void GetLayoutMargins (RowReference row, CoordinateType* lhs, CoordinateType* rhs) const override;
85 virtual void SetWindowRect (const Led_Rect& windowRect) override;
86
87#if qStroika_Foundation_Common_Platform_Windows
88public:
89 nonvirtual LedItDocument& GetDocument () const;
90#endif
91
92#if qStroika_Foundation_Common_Platform_Windows
93 nonvirtual LedItControlItem* GetSoleSelectedOLEEmbedding () const;
94#endif
95
96#if qStroika_Foundation_Common_Platform_MacOS
97public:
98 virtual void FindCommandStatus (CommandT inCommand, Boolean& outEnabled, Boolean& outUsesMark, UInt16& outMark, Str255 outName) override;
99#endif
100
101#if qStroika_Foundation_Common_Platform_Windows
102public:
103 afx_msg void OnContextMenu (CWnd* /*pWnd*/, CPoint /*point*/);
104
105protected:
106 virtual BOOL IsSelected (const CObject* pDocItem) const override; // support for CView/OLE
107#endif
108
109public:
110 nonvirtual IncrementalParagraphInfo GetParaFormatSelection ();
111 nonvirtual void SetParaFormatSelection (const IncrementalParagraphInfo& pf);
112
113public:
114 virtual void OnShowHideGlyphCommand (CommandNumber cmdNum) override;
115
116protected:
117 virtual SearchParameters GetSearchParameters () const override;
118 virtual void SetSearchParameters (const SearchParameters& sp) override;
119
120public:
121 nonvirtual void SetShowHiddenText (bool showHiddenText);
122
123#if qStroika_Foundation_Common_Platform_Windows
124protected:
125 afx_msg void OnSetFocus (CWnd* pOldWnd);
126 afx_msg void OnSize (UINT nType, int cx, int cy);
127 afx_msg void OnInsertObject ();
128 afx_msg void OnCancelEditCntr ();
129 afx_msg void OnCancelEditSrvr ();
130 afx_msg void OnBarReturn (NMHDR*, LRESULT*);
131 DECLARE_MESSAGE_MAP ()
132
133#ifdef _DEBUG
134public:
135 virtual void AssertValid () const override;
136 virtual void Dump (CDumpContext& dc) const override;
137#endif
138#endif
139};
140DISABLE_COMPILER_MSC_WARNING_END (4250) // inherits via dominance warning
141
142/*
143 ********************************************************************************
144 ***************************** Implementation Details ***************************
145 ********************************************************************************
146 */
147#if !qStroika_Foundation_Debug_AssertionsChecked && qStroika_Foundation_Common_Platform_Windows
148inline LedItDocument& LedItView::GetDocument () const
149{
150 return *(LedItDocument*)m_pDocument;
151}
152#endif
153
154#endif /*__LedItView_h__*/