1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        wx/gtk/hyperlink.h
3 // Purpose:     Hyperlink control
4 // Author:      Francesco Montorsi
5 // Modified by:
6 // Created:     14/2/2007
7 // Copyright:   (c) 2007 Francesco Montorsi
8 // Licence:     wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10 
11 #ifndef _WX_GTKHYPERLINKCTRL_H_
12 #define _WX_GTKHYPERLINKCTRL_H_
13 
14 #include "wx/generic/hyperlink.h"
15 
16 // ----------------------------------------------------------------------------
17 // wxHyperlinkCtrl
18 // ----------------------------------------------------------------------------
19 
20 class WXDLLIMPEXP_ADV wxHyperlinkCtrl : public wxGenericHyperlinkCtrl
21 {
22     typedef wxGenericHyperlinkCtrl base_type;
23 public:
24     // Default constructor (for two-step construction).
wxHyperlinkCtrl()25     wxHyperlinkCtrl() { }
26 
27     // Constructor.
28     wxHyperlinkCtrl(wxWindow *parent,
29                     wxWindowID id,
30                     const wxString& label, const wxString& url,
31                     const wxPoint& pos = wxDefaultPosition,
32                     const wxSize& size = wxDefaultSize,
33                     long style = wxHL_DEFAULT_STYLE,
34                     const wxString& name = wxHyperlinkCtrlNameStr)
35     {
36         (void)Create(parent, id, label, url, pos, size, style, name);
37     }
38 
39     ~wxHyperlinkCtrl();
40 
41     // Creation function (for two-step construction).
42     bool Create(wxWindow *parent,
43                 wxWindowID id,
44                 const wxString& label, const wxString& url,
45                 const wxPoint& pos = wxDefaultPosition,
46                 const wxSize& size = wxDefaultSize,
47                 long style = wxHL_DEFAULT_STYLE,
48                 const wxString& name = wxHyperlinkCtrlNameStr);
49 
50 
51     // get/set
52     virtual wxColour GetHoverColour() const;
53     virtual void SetHoverColour(const wxColour &colour);
54 
55     virtual wxColour GetNormalColour() const;
56     virtual void SetNormalColour(const wxColour &colour);
57 
58     virtual wxColour GetVisitedColour() const;
59     virtual void SetVisitedColour(const wxColour &colour);
60 
61     virtual wxString GetURL() const;
62     virtual void SetURL(const wxString &url);
63 
64     virtual void SetVisited(bool visited = true);
65     virtual bool GetVisited() const;
66 
67     virtual void SetLabel(const wxString &label);
68 
69 protected:
70     virtual wxSize DoGetBestSize() const;
71     virtual wxSize DoGetBestClientSize() const;
72 
73     virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
74 
75     DECLARE_DYNAMIC_CLASS(wxHyperlinkCtrl)
76 };
77 
78 #endif // _WX_GTKHYPERLINKCTRL_H_
79