OSDN Git Service

Update Email Subject at sendmaildlg
[tortoisegit/TortoiseGitJp.git] / src / TortoiseUDiff / MainWindow.h
1 // TortoiseSVN - a Windows shell extension for easy version control\r
2 \r
3 // Copyright (C) 2007 - TortoiseUDiff\r
4 \r
5 // This program is free software; you can redistribute it and/or\r
6 // modify it under the terms of the GNU General Public License\r
7 // as published by the Free Software Foundation; either version 2\r
8 // of the License, or (at your option) any later version.\r
9 \r
10 // This program is distributed in the hope that it will be useful,\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 // GNU General Public License for more details.\r
14 \r
15 // You should have received a copy of the GNU General Public License\r
16 // along with this program; if not, write to the Free Software Foundation,\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
18 //\r
19 #pragma once\r
20 #include "BaseWindow.h"\r
21 #include "SciLexer.h"\r
22 #include "Scintilla.h"\r
23 #include "Registry.h"\r
24 #include "resource.h"\r
25 #include "FindBar.h"\r
26 #include <string>\r
27 #include <stdio.h>\r
28 \r
29 using namespace std;\r
30 \r
31 /**\r
32  * \ingroup TortoiseUDiff\r
33  * Main window of TortoiseUDiff. Handles the child windows (Scintilla control,\r
34  * CFindBar, ...).\r
35  */\r
36 class CMainWindow : public CWindow\r
37 {\r
38 public:\r
39         CMainWindow(HINSTANCE hInst, const WNDCLASSEX* wcx = NULL);\r
40         ~CMainWindow(void);\r
41 \r
42         /**\r
43         * Registers the window class and creates the window.\r
44         */\r
45         bool                            RegisterAndCreateWindow();\r
46 \r
47         LRESULT                         SendEditor(UINT Msg, WPARAM wParam = 0, LPARAM lParam = 0);\r
48         HWND                            GetHWNDEdit() { return m_hWndEdit; }\r
49         bool                            LoadFile(LPCTSTR filename);\r
50         void                            SetTitle(LPCTSTR title);\r
51 \r
52 protected:\r
53         /// the message handler for this window\r
54         LRESULT CALLBACK        WinMsgHandler(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);\r
55         /// Handles all the WM_COMMAND window messages (e.g. menu commands)\r
56         LRESULT                         DoCommand(int id);\r
57 \r
58         bool                            Initialize();\r
59 \r
60 private:\r
61         void                            SetAStyle(int style, COLORREF fore, COLORREF back=::GetSysColor(COLOR_WINDOW), \r
62                 int size=-1, const char *face=0);\r
63         bool                IsUTF8(LPVOID pBuffer, int cb);\r
64 \r
65 private:\r
66         LRESULT                         m_directFunction;\r
67         LRESULT                         m_directPointer;\r
68 \r
69         HWND                            m_hWndEdit;\r
70 \r
71         CFindBar            m_FindBar;\r
72         bool                            m_bShowFindBar;\r
73         bool                            m_bMatchCase;\r
74         wstring                         m_findtext;\r
75 };\r