4#ifndef __LedLineItDocument_h__
5#define __LedLineItDocument_h__ 1
7#include "Stroika/Frameworks/StroikaPreComp.h"
9DISABLE_COMPILER_MSC_WARNING_START (5054)
11DISABLE_COMPILER_MSC_WARNING_END (5054)
17#include "Stroika/Frameworks/Led/ChunkedArrayTextStore.h"
18#include "Stroika/Frameworks/Led/Command.h"
20#include "LedLineItConfig.h"
24using namespace Stroika::Frameworks::Led;
27using Stroika::Foundation::Characters::CodePagesInstalled;
29const CodePage kDefaultNewDocCodePage =
30 CodePagesInstalled{}.IsCodePageAvailable (Characters::WellKnownCodePages::kUTF8) ? Characters::WellKnownCodePages::kUTF8 : CP_ACP;
35class LedLineItServerItem;
37class LedLineItDocument :
public COleServerDoc,
public MarkerOwner {
40 DECLARE_DYNCREATE (LedLineItDocument)
43 virtual ~LedLineItDocument ();
46 virtual void DidUpdateText (
const UpdateInfo& )
noexcept override;
47 virtual TextStore* PeekAtTextStore ()
const override;
50 nonvirtual LedLineItServerItem* GetEmbeddedItem ();
53 virtual BOOL OnNewDocument ()
override;
54 virtual BOOL OnOpenDocument (LPCTSTR lpszPathName)
override;
55 virtual void Serialize (CArchive& ar)
override;
58 virtual COleServerItem* OnGetEmbeddedItem ()
override;
61 virtual BOOL DoSave (LPCTSTR lpszPathName, BOOL bReplace)
override;
67 afx_msg
void OnUpdateFileSave (CCmdUI* pCmdUI);
68 afx_msg
void OnFileSaveCopyAs ();
69 virtual void DeleteContents ()
override;
72 nonvirtual TextStore& GetTextStore ();
73 nonvirtual CommandHandler& GetCommandHandler ();
76 ChunkedArrayTextStore fTextStore;
77 MultiLevelUndoCommandHandler fCommandHandler;
84 static bool DoPromptSaveAsFileName (::CString* fileName, CodePage* codePage);
85 static bool DoPromptSaveCopyAsFileName (::CString* fileName, CodePage* codePage);
86 static bool DoPromptOpenFileName (::CString* fileName, CodePage* codePage);
89 static bool DoPromptFileName (::CString* fileName, UINT nIDSTitle,
bool isOpenDialogCall,
long fileDLogFlags, CodePage* codePage);
91#if qStroika_Foundation_Debug_AssertionsChecked
93 virtual void AssertValid ()
const override;
98 DECLARE_MESSAGE_MAP ()
100 DECLARE_DISPATCH_MAP ()
101 DECLARE_INTERFACE_MAP ()
109inline LedLineItServerItem* LedLineItDocument::GetEmbeddedItem ()
111 return (LedLineItServerItem*)COleServerDoc::GetEmbeddedItem ();
113inline TextStore& LedLineItDocument::GetTextStore ()
117inline CommandHandler& LedLineItDocument::GetCommandHandler ()
119 return fCommandHandler;