OSDN Git Service

Add TortoiseProc
[tortoisegit/TortoiseGitJp.git] / Utils / MiscUI / HyperLink.h
1 // TortoiseSVN - a Windows shell extension for easy version control\r
2 \r
3 // Copyright (C) 2003-2007,2008 - TortoiseSVN\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 \r
21 /**\r
22  * \ingroup Utils\r
23  * Hyperlink control\r
24  */\r
25 class CHyperLink : public CStatic\r
26 {\r
27 public:\r
28     CHyperLink();\r
29     virtual ~CHyperLink();\r
30 \r
31 public:\r
32     enum UnderLineOptions \r
33         { \r
34                 ulHover = -1, \r
35                 ulNone = 0, \r
36                 ulAlways = 1\r
37         };\r
38 \r
39 public:\r
40     void                SetURL(CString strURL);\r
41     CString             GetURL() const;\r
42 \r
43     void                SetColors(COLORREF crLinkColor, COLORREF crHoverColor = -1);\r
44     COLORREF    GetLinkColor() const;\r
45     COLORREF    GetHoverColor() const;\r
46 \r
47     void                SetUnderline(int nUnderline = ulHover);\r
48     int                 GetUnderline() const;\r
49 \r
50 public:\r
51     virtual BOOL PreTranslateMessage(MSG* pMsg);\r
52         virtual BOOL DestroyWindow();\r
53 protected:\r
54     virtual void PreSubclassWindow();\r
55 \r
56 protected:\r
57     HINSTANCE   GotoURL(LPCTSTR url);\r
58     void                SetDefaultCursor();\r
59 \r
60 protected:\r
61     COLORREF    m_crLinkColor;                  ///< Hyperlink color\r
62     COLORREF    m_crHoverColor;                 ///< Hover color\r
63     BOOL                m_bOverControl;                 ///< cursor over control?\r
64     int                 m_nUnderline;                   ///< underline hyperlink?\r
65     CString             m_strURL;                               ///< hyperlink URL\r
66     CFont               m_UnderlineFont;                ///< Font for underline display\r
67     CFont               m_StdFont;                              ///< Standard font\r
68     HCURSOR             m_hLinkCursor;                  ///< Cursor for hyperlink\r
69     CToolTipCtrl m_ToolTip;                             ///< The tooltip\r
70     UINT                m_nTimerID;\r
71 \r
72 protected:\r
73     afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);\r
74     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);\r
75     afx_msg void OnMouseMove(UINT nFlags, CPoint point);\r
76         afx_msg void OnTimer(UINT_PTR nIDEvent);\r
77         afx_msg BOOL OnEraseBkgnd(CDC* pDC);\r
78     afx_msg void OnClicked();\r
79     DECLARE_MESSAGE_MAP()\r
80 };\r