Develop and Download Open Source Software

Browse CVS Repository

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

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


Revision 1.39 - (show annotations) (download) (as text)
Sun Sep 3 12:56:34 2006 UTC (17 years, 7 months ago) by hirami
Branch: MAIN
CVS Tags: Tombo_2_0b2, Tombo_2_0b3, Tombo_2_0b1, Tombo_2_0b4, B228, B229, B226, B227, B225, B231, B230, HEAD
Changes since 1.38: +0 -6 lines
File MIME type: text/x-chdr
* In edit view, display "OK" button insted of "x" on title bar.
* Support WM5 style menubar(WM5 version).
* FIX: Input method ATOK is not work good on W-ZERO3[es].
	This fix is port from B221.

- L9N is not completed(menubar label)

1 #ifndef MAINFRAME_H
2 #define MAINFRAME_H
3
4 #include "Message.h"
5 #include "MemoSelectView.h"
6 #include "MemoDetailsView.h"
7 #include "PasswordManager.h"
8 #include "MemoManager.h"
9
10 class TreeViewItem;
11 class VFManager;
12 class BookMark;
13 struct BookMarkItem;
14
15 class StatusBar;
16 #include "PlatformLayer.h"
17
18 ///////////////////////////////////////
19 // Main frame window
20 ///////////////////////////////////////
21
22 class MainFrame {
23 public:
24 enum LayoutType {
25 LT_Unknown = 0,
26 LT_TwoPane,
27 LT_OnePaneSelectView,
28 LT_OnePaneDetailsView
29 };
30
31 enum ViewType {
32 VT_Unknown = 0,
33 VT_SelectView,
34 VT_DetailsView
35 };
36
37 private:
38 static LPCTSTR pClassName;
39
40 HWND hMainWnd;
41 HINSTANCE hInstance;
42
43 PLATFORM_TYPE *pPlatform;
44
45 MemoSelectView msView;
46 MemoDetailsView *pDetailsView;
47
48 MemoManager mmMemoManager;
49
50 VFManager *pVFManager;
51
52 PasswordManager pmPasswordMgr;
53
54 ViewType vtFocusedView;
55 LayoutType lCurrentLayout;
56
57 RECT rWindowRect; // window size with menu/title
58
59 // pane size is changing
60 BOOL bResizePane;
61
62 WORD nSplitterSize;
63 #if (defined(PLATFORM_PKTPC) || defined(PLATFORM_WM5)) && defined(FOR_VGA)
64 WORD nSplitterSizeWidth;
65 BOOL bLandscapeMode;
66 #endif
67
68 BOOL bSearchStartFromTreeView;
69
70 // bookmarks
71 BookMark *pBookMark;
72
73 protected:
74 // hook application button for handling from TOMBO
75 BOOL EnableApplicationButton(HWND hWnd);
76
77 // move pane splitter
78 void MovePane(WORD nSplit);
79
80 void ChangeLayout(LayoutType layout);
81
82 public:
83 MainFrame(); // ctor
84 ~MainFrame(); // dtor
85
86 // register window class and create functions
87 static BOOL RegisterClass(HINSTANCE hInst);
88
89 BOOL Create(LPCTSTR pWndName, HINSTANCE hInst, int nCmdShow);
90
91 int MainLoop();
92
93 // Event handler
94 void OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam);
95 void OnPaint(HWND hWnd, WPARAM wParam, LPARAM lParam);
96 BOOL OnExit();
97 BOOL OnNotify(HWND hWnd, WPARAM wParam, LPARAM lParam);
98 void OnSettingChange(WPARAM wParam);
99 void OnSIPResize(BOOL bImeOn, RECT *pSipRect);
100 void OnCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
101 void OnProperty();
102 void OnForgetPass();
103 void OnTimer(WPARAM nTimerID);
104 void OnMutualExecute();
105 BOOL OnHotKey(WPARAM wParam, LPARAM lParam);
106 void OnResize(WPARAM wParam, LPARAM lParam);
107 void OnTooltip(WPARAM wParam, LPARAM lParam);
108 void OnVFolderDef();
109
110 ///////////////////
111 // Search/grep
112
113 void OnSearch();
114 void OnSearchNext(BOOL bForward);
115 void DoSearchTree(BOOL bFirst, BOOL bForward);
116
117 void OnGrep();
118
119 ///////////////////
120 // for move panes
121
122 void OnLButtonDown(WPARAM wParam, LPARAM lParam);
123 void OnMouseMove(WPARAM wParam, LPARAM lParam);
124 void OnLButtonUp(WPARAM wParam, LPARAM lParam);
125
126 ////////////////////
127 // menu handler
128
129 void About(); // About dialog
130 void NewMemo(); // create new notes
131 void NewFolder(TreeViewItem *pItem); // create new folder
132 void SetWrapText(BOOL bWrap); // Toggle wrapping on/off
133 void TogglePane(); // switch 1pange/2panes
134
135 void SetTopMost(); // keep top of the window
136
137 //////////////////////////
138 // open notes
139
140 void LoadMemo(const TomboURI *pURI, BOOL bAskPass);
141
142 //////////////////////////
143 // view control
144
145 void OpenDetailsView(const TomboURI *pURI, DWORD nSwitchView);
146 void LeaveDetailsView(BOOL bAskSave);
147 void PostSwitchView();
148 // void PopupEditViewDlg();
149
150 void ActivateView(ViewType vt); // change windows layout and focus
151 void SetFocus(ViewType vt = VT_Unknown);
152 // change focus only.
153 void NotifyDetailsViewFocused();
154 void SetLayout();
155
156 BOOL SelectViewActive() { return vtFocusedView == VT_SelectView; }
157
158 ////////////////////////////////
159 // Control menus & toolbars
160
161 void EnableEncrypt(BOOL bEnable);
162 void EnableDecrypt(BOOL bEnable);
163 void EnableDelete(BOOL bEnable);
164 void EnableSaveButton(BOOL bEnable);
165 void EnableRename(BOOL bEnable);
166 void EnableNew(BOOL bEnable);
167 void EnableCut(BOOL bEnable);
168 void EnableCopy(BOOL bEnable);
169 void EnablePaste(BOOL bEnable);
170 void EnableNewFolder(BOOL bEnable);
171 void EnableGrep(BOOL bEnable);
172
173 // Save/restore window size
174 void LoadWinSize(HWND hWnd);
175 void SaveWinSize();
176
177 ////////////////////////////////
178 // Control status indicator
179
180 void SetReadOnlyStatus(BOOL bReadOnly);
181 void SetNewMemoStatus(BOOL bNew);
182 void SetModifyStatus(BOOL bModify);
183
184 #if defined(PLATFORM_WIN32) || defined(PLATFORM_HPC)
185 void ToggleShowStatusBar();
186 #endif
187 #if defined(PLATFORM_WIN32)
188 void ToggleShowRebar();
189 #endif
190
191 // change window title
192 void SetWindowTitle(const TomboURI *pURI);
193
194 ////////////////////////////////
195 // bookmark related members
196 void OnBookMarkAdd(HWND hWnd, WPARAM wParam, LPARAM lParam);
197 void OnBookMarkConfig(HWND hWnd, WPARAM wParam, LPARAM lParam);
198
199 void OnBookMark(HWND hWnd, WPARAM wParam, LPARAM lParam);
200
201 void AppendBookMark(HMENU hMenu, const BookMarkItem *pItem);
202 void LoadBookMark(LPCTSTR pBookMarks);
203
204 ////////////////////////////////
205 // misc funcs
206
207 MemoManager *GetManager() { return &mmMemoManager; }
208 int MessageBox(LPCTSTR pText, LPCTSTR pCaption, UINT uType);
209 };
210
211
212 #endif

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