-
Notifications
You must be signed in to change notification settings - Fork 76
/
TextDocument.h
110 lines (91 loc) · 2.96 KB
/
TextDocument.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#if !defined(AFX_TEXTDOCUMENT_H__D2527D3F_0F59_11D4_BB0A_0080AD7972EF__INCLUDED_)
#define AFX_TEXTDOCUMENT_H__D2527D3F_0F59_11D4_BB0A_0080AD7972EF__INCLUDED_
/*
Copyright (C) 2000 Nick Gammon.
*/
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TextDocument.h : header file
//
// enums for m_iSaveOnChange
enum
{
eNotepadSaveDefault, // 0
eNotepadSaveAlways, // 1
eNotepadSaveNever, // 2
};
/////////////////////////////////////////////////////////////////////////////
// CTextDocument document
class CTextDocument : public CDocument
{
protected:
CTextDocument(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CTextDocument)
// Attributes
public:
HANDLE m_pThread; // Notification thread
CEvent m_eventFileChanged; // file changed thread event
bool m_bInFileChanged;
CTime m_timeFileMod;
CString m_strTitle;
CMUSHclientDoc * m_pRelatedWorld; // which world it belongs to, if any
__int64 m_iUniqueDocumentNumber; // to confirm we have the right doc
CString m_strFontName; // window font
LONG m_iFontSize;
LONG m_iFontWeight;
DWORD m_iFontCharset;
bool m_bFontItalic;
bool m_bFontUnderline;
bool m_bFontStrikeout;
COLORREF m_textColour; // window colour
COLORREF m_backColour;
CString m_strSearchString; // if recall, what did they recall?
CString m_strRecallLinePreamble; // what line preamble did they want?
bool m_bMatchCase;
bool m_bRegexp; // and other params
bool m_bCommands;
bool m_bOutput;
bool m_bNotes;
int m_iSaveOnChange; // whether to save if contents changed, see enum above
int m_iLines;
int m_iNotepadType; // "type" of notepad window - see enum in doc.h
BOOL m_bReadOnly;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTextDocument)
public:
virtual void Serialize(CArchive& ar); // overridden for document i/o
virtual void OnCloseDocument();
virtual BOOL SaveModified();
protected:
virtual BOOL OnNewDocument();
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CTextDocument();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
CMUSHclientDoc * FindWorld (void);
void OnFileChanged(void);
virtual BOOL DoSave (LPCTSTR lpszPathName, BOOL bReplace = TRUE);
void CreateMonitoringThread(const char * sName);
void SetTheFont (void);
void SetReadOnly (BOOL bReadOnly);
// Generated message map functions
protected:
//{{AFX_MSG(CTextDocument)
afx_msg void OnFileOpen();
afx_msg void OnUpdateStatuslineMushname(CCmdUI* pCmdUI);
afx_msg void OnFileNew();
afx_msg void OnEditConvertclipboardforumcodes();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TEXTDOCUMENT_H__D2527D3F_0F59_11D4_BB0A_0080AD7972EF__INCLUDED_)