/////////////////////////////////////////////////////////////////////////////
// Name:        wxHyperLink.h
// Purpose:     wxHyperLink
// Author:      Hans Van Leemputten
// Modified by:
// Created:     03/11/2001
// RCS-ID:      $Id: wxHyperLink.h,v 1.1 2001/03/24 22:48:02 hansvl Exp $
// Copyright:   (c) Hans Van Leemputten
// Licence:     wxWindows license
/////////////////////////////////////////////////////////////////////////////

#ifndef _WXHYPERLINK_H
#define _WXHYPERLINK_H

#ifdef __GNUG__
    #pragma interface "wxHyperLink.h"
#endif

// wxHyperLink.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// wxHyperLink window

class WXDLLEXPORT wxHyperLink : public wxStaticText
{
	DECLARE_DYNAMIC_CLASS(wxHyperLink)
// Construction
public:
	wxHyperLink() { }

	wxHyperLink(wxWindow *parent, wxWindowID id, 
			const wxString &url,
			const wxString &label = wxT(""),
			const wxColour &normal = (*wxBLUE),
			const wxColour &active = wxNullColour,
			const wxPoint &pos = wxDefaultPosition, 
			const wxSize &size = wxDefaultSize, 
			long style = 0, 
			const wxString &name = wxT("HyperLink"));		

	virtual ~wxHyperLink();

	bool Create(wxWindow *parent, wxWindowID id,
			const wxString &url,
			const wxString &label = wxT(""),
			const wxColour &normal = (*wxBLUE),
			const wxColour &active = wxNullColour,
			const wxPoint &pos = wxDefaultPosition, 
			const wxSize &size = wxDefaultSize, 
			long style = 0, 
			const wxString &name = wxT("HyperLinkt"));

	// Re-define this to allow to set 2 colours in with one base colour
	virtual bool SetForegroundColour(const wxColour &colour);
	// Set Normal and Active colour of the Text.
	bool SetColour(const wxColour &colourNormal, const wxColour &colourActive);
	// Set a new URL and/or lable. 
	// If no lable is set, url will be used as label.
	void SetURL(const wxString &url, const wxString &label = wxT(""));
	// Set the text displayed with a line under it or not.
	void SetUnderline(bool bUnderline, bool bAlways = true);

	// Get URL and label
	void GetURL(wxString &url, wxString &label);
	// Get if there is currently a line?
	bool GetUnderline();

	// Load the default browser or email client...
	bool LoadLink();

protected:
	unsigned char CallcColour(unsigned char colour);

private: // All Events...
	void OnActivate(wxMouseEvent& event);
	void OnDeActivate(wxMouseEvent& event);
	void OnClick(wxMouseEvent& event);

private: // All Private members
	// Normal color, used when text is not Active.
	wxColour m_ColourNormal;
	// Active color, used when text is Active.
	wxColour m_ColourActive;
	// The URL we will try to feed to the standard browser.
	wxString m_strURL;
	// bools to know when to display a line under the text...
	bool m_bUnderline;
	bool m_bUndelineAlways;
	// Are we active?
	bool m_bActive;

protected:
	DECLARE_EVENT_TABLE()
};

#endif // !defined(_WXHYPERLINK_H)
