Develop and Download Open Source Software

Browse CVS Repository

Contents of /tombo/Tombo/Src/MemoDetailsView.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.14 - (show annotations) (download) (as text)
Mon Feb 20 15:07:42 2006 UTC (18 years, 1 month ago) by hirami
Branch: MAIN
CVS Tags: B217, B219, B218, Tombo_2_0b2, Tombo_2_0b3, Tombo_2_0b1, Tombo_2_0b4, B228, B229, B226, B227, B224, B225, B222, B223, B220, B231, B230, HEAD
Changes since 1.13: +3 -6 lines
File MIME type: text/x-chdr
- Enable YAE Option

1 #ifndef MEMODETAILSVIEW_H
2 #define MEMODETAILSVIEW_H
3
4 class MemoDetailsView;
5 class SearchEngineA;
6 class TString;
7 class TomboURI;
8 class MemoManager;
9
10 ///////////////////////////////////////
11 // Edit view abstraction
12 ///////////////////////////////////////
13
14 class MemoDetailsView {
15 protected:
16 TomboURI *pCurrentURI;
17 MemoManager *pManager;
18 public:
19
20 MemoDetailsView(MemoManager *pMgr);
21 virtual ~MemoDetailsView();
22
23 virtual BOOL Create(LPCTSTR pName, RECT &r, HWND hParent, HINSTANCE hInst, HFONT hFont) = 0;
24
25 virtual void SetTabstop() = 0;
26 virtual BOOL SetFolding(BOOL bFold) = 0;
27 virtual void SetReadOnly(BOOL bReadOnly) = 0;
28 virtual BOOL IsReadOnly() = 0;
29
30 virtual void SetModifyStatus() = 0;
31
32 virtual void SetMDSearchFlg(BOOL bFlg) = 0;
33
34 virtual BOOL Show(int nCmdShow) = 0;
35 virtual void SetFocus() = 0;
36 virtual void SetFont(HFONT hFont) = 0;
37 virtual void MoveWindow(DWORD x, DWORD y, DWORD nWidth, DWORD nHeight) = 0;
38
39 virtual BOOL OnCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) = 0;
40 virtual BOOL OnHotKey(HWND hWnd, WPARAM wParam) = 0;
41 virtual void OnGetFocus() = 0;
42
43 virtual BOOL SetMemo(LPCTSTR pMemo, DWORD nPos, BOOL bReadOnly) = 0;
44 virtual LPTSTR GetMemo() = 0;
45 virtual BOOL IsModify() = 0;
46 virtual void ResetModify() = 0;
47
48 virtual DWORD GetCursorPos() = 0;
49 virtual DWORD GetInitialPos() = 0;
50
51 virtual void SelectAll() = 0;
52
53 BOOL Search(BOOL bFirstSearch, BOOL bForward, BOOL bNFMsg, BOOL bSearchFromTop);
54
55 BOOL Save(const TomboURI *pCurrentURI, TomboURI *pNewURI, TString *pNewHeadLine, LPCTSTR pText);
56
57 const TomboURI *GetCurrentURI();
58 void SetCurrentNote(const TomboURI *pURI);
59
60 // Is the note displayed in details view?
61 BOOL IsNoteDisplayed(const TomboURI *pURI);
62
63 BOOL StoreCursorPos();
64 BOOL DiscardMemo();
65
66 BOOL LoadNote(const TomboURI *pURI);
67
68 virtual BOOL ReplaceText(LPCTSTR p) = 0;
69 virtual void SetSelectRegion(DWORD nStart, DWORD nEnd) = 0;
70
71 void InsertDate1();
72 void InsertDate2();
73 };
74
75 //////////////////////////////////////////
76 // Edit view
77 //////////////////////////////////////////
78
79 class SimpleEditor : public MemoDetailsView {
80 HWND hViewWnd; // The window handle used now(hViewWnd_fd or hViewWnd_nf)
81 HWND hViewWnd_fd; // The window created by wrapping options
82 HWND hViewWnd_nf; // The window created by no wrapping options
83
84 DWORD nID, nID_nf;
85
86 DWORD nLeftOffset;
87
88 BOOL bShowStatus; // Is view displayed?
89
90 BOOL bReadOnly; // is read only mode?
91
92 DWORD nInitialPos; // cursor position when open this note.
93
94 public:
95
96 ///////////////////////
97 // Initialize
98
99 SimpleEditor(MemoManager *pMgr);
100 BOOL Init(DWORD nID, DWORD nID_nf);
101 BOOL Create(LPCTSTR pName, RECT &r, HWND hParent, HINSTANCE hInst, HFONT hFont);
102
103 static BOOL RegisterClass(HINSTANCE hInst);
104
105 ///////////////////////
106 // Properties
107
108 void SetTabstop(); // Tab stop
109 BOOL SetFolding(BOOL bFold); // Change wrapping
110
111 void SetReadOnly(BOOL bReadOnly);
112 BOOL IsReadOnly() { return bReadOnly; }
113
114 void SetModifyStatus();
115
116 ////////////////////////
117 // Message handler
118
119 BOOL Show(int nCmdShow);
120 void SetFocus() { ::SetFocus(hViewWnd); }
121 void SetFont(HFONT hFont);
122 void MoveWindow(DWORD x, DWORD y, DWORD nWidth, DWORD nHeight);
123
124 BOOL OnCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
125 BOOL OnHotKey(HWND hWnd, WPARAM wParam);
126 UINT OnKeyDown(HWND hWnd, WPARAM wParam, LPARAM lParam);
127
128 void OnGetFocus();
129
130 ////////////////////////////
131 // Data access
132
133 BOOL SetMemo(LPCTSTR pMemo, DWORD nPos, BOOL bReadOnly);
134 LPTSTR GetMemo();
135 BOOL IsModify() { if (hViewWnd) return SendMessage(hViewWnd, EM_GETMODIFY, 0, 0); else return FALSE; }
136 void ResetModify() { SendMessage(hViewWnd, EM_SETMODIFY, (WPARAM)(UINT)FALSE, 0); }
137
138 void SetMDSearchFlg(BOOL bFlg);
139
140
141 DWORD GetCursorPos();
142 DWORD GetInitialPos() { return nInitialPos; }
143
144 void SelectAll();
145
146 BOOL ReplaceText(LPCTSTR p);
147 void SetSelectRegion(DWORD nStart, DWORD nEnd);
148 };
149
150 #endif

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26