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