1 // TortoiseSVN - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2003-2008 - TortoiseSVN
\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
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
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
22 #include "HistoryCombo.h"
\r
23 #include "Tooltip.h"
\r
24 #include "XPImageButton.h"
\r
26 class CRepositoryTree;
\r
29 * \ingroup TortoiseProc
\r
30 * Interface definition
\r
35 virtual bool ChangeToUrl(CString& url, GitRev& rev, bool bAlreadyChecked) = 0;
\r
36 virtual CString GetRepoRoot() = 0;
\r
40 * \ingroup TortoiseProc
\r
41 * Provides a CReBarCtrl which can be used as a "control center" for the
\r
42 * repository browser. To associate the repository bar with any repository
\r
43 * tree control, call AssocTree() once after both objects are created. As
\r
44 * long as they are associated, the bar and the tree form a "team" of
\r
45 * controls that work together.
\r
47 class CRepositoryBar : public CReBarCtrl
\r
49 DECLARE_DYNAMIC(CRepositoryBar)
\r
53 virtual ~CRepositoryBar();
\r
57 * Creates the repository bar. Set \a in_dialog to TRUE when the bar
\r
58 * is placed inside of a dialog. Otherwise it is assumed that the
\r
59 * bar is placed in a frame window.
\r
61 bool Create(CWnd* parent, UINT id, bool in_dialog = true);
\r
64 * Show the given \a svn_url in the URL combo and the revision button.
\r
66 void ShowUrl(const CString& url, GitRev rev);
\r
69 * Show the given \a svn_url in the URL combo and the revision button,
\r
70 * and select it in the associated repository tree. If no \a svn_url
\r
71 * is given, the current values are used (which effectively refreshes
\r
74 void GotoUrl(const CString& url = CString(), GitRev rev = GitRev(), bool bAlreadyChecked = false);
\r
77 * Returns the current URL.
\r
79 CString GetCurrentUrl() const;
\r
82 * Returns the current revision
\r
84 GitRev GetCurrentRev() const;
\r
87 * Saves the URL history of the HistoryCombo.
\r
94 void SetRevision(GitRev rev);
\r
96 void SetFocusToURL();
\r
98 void SetIRepo(IRepo * pRepo) {m_pRepo = pRepo;}
\r
100 void SetHeadRevision(const GitRev& rev) {m_headRev = rev;}
\r
101 afx_msg void OnGoUp();
\r
103 virtual BOOL PreTranslateMessage(MSG* pMsg);
\r
104 afx_msg void OnCbnSelChange();
\r
105 afx_msg void OnBnClicked();
\r
106 afx_msg void OnDestroy();
\r
108 DECLARE_MESSAGE_MAP()
\r
116 class CRepositoryCombo : public CHistoryCombo
\r
118 CRepositoryBar *m_bar;
\r
120 CRepositoryCombo(CRepositoryBar *bar) : m_bar(bar) {}
\r
121 virtual bool OnReturnKeyPressed();
\r
124 CButton m_btnRevision;
\r
125 CXPImageButton m_btnUp;
\r
128 CToolTips m_tooltips;
\r
134 * \ingroup TortoiseProc
\r
135 * Implements a visual container for a CRepositoryBar which may be added to a
\r
136 * dialog. A CRepositoryBarCnr is not needed if the CRepositoryBar is attached
\r
137 * to a frame window.
\r
139 class CRepositoryBarCnr : public CStatic
\r
141 DECLARE_DYNAMIC(CRepositoryBarCnr)
\r
144 CRepositoryBarCnr(CRepositoryBar *repository_bar);
\r
145 ~CRepositoryBarCnr();
\r
147 // Generated message map functions
\r
149 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
\r
150 afx_msg void OnSize(UINT nType, int cx, int cy);
\r
151 afx_msg UINT OnGetDlgCode();
\r
152 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
\r
154 virtual void DrawItem(LPDRAWITEMSTRUCT);
\r
156 DECLARE_MESSAGE_MAP()
\r
159 CRepositoryBar *m_pbarRepository;
\r