update credits
[LibreOffice.git] / include / vcl / fixedhyper.hxx
blobb43e4bd7fd6eeea4b3b38912dbab5b50267d1e60
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef VCL_FIXEDHYPER_HXX
21 #define VCL_FIXEDHYPER_HXX
23 #include <vcl/dllapi.h>
24 #include <vcl/fixed.hxx>
26 //=====================================================================
27 //= FixedHyperlink
28 //=====================================================================
29 class VCL_DLLPUBLIC FixedHyperlink : public FixedText
31 private:
32 long m_nTextLen;
33 Pointer m_aOldPointer;
34 Link m_aClickHdl;
35 OUString m_sURL;
37 /** initializes the font (link color and underline).
39 Called by the Ctors.
41 void Initialize();
43 protected:
44 /** overwrites Window::MouseMove().
46 Changes the pointer only over the text.
48 virtual void MouseMove( const MouseEvent& rMEvt );
50 /** overwrites Window::MouseButtonUp().
52 Calls the set link if the mouse is over the text.
54 virtual void MouseButtonUp( const MouseEvent& rMEvt );
56 /** overwrites Window::RequestHelp().
58 Shows tooltip only if the mouse is over the text.
60 virtual void RequestHelp( const HelpEvent& rHEvt );
62 public:
63 /** ctors
65 With ResId or WinBits.
67 FixedHyperlink( Window* pParent, const ResId& rId );
68 FixedHyperlink( Window* pParent, WinBits nWinStyle = 0 );
70 /** dtor
73 virtual ~FixedHyperlink();
75 /** overwrites Window::GetFocus().
77 Changes the color of the text and shows a focus rectangle.
79 virtual void GetFocus();
81 /** overwrites Window::LoseFocus().
83 Changes the color of the text and hides the focus rectangle.
85 virtual void LoseFocus();
87 /** overwrites Window::KeyInput().
89 KEY_RETURN and KEY_SPACE calls the link handler.
91 virtual void KeyInput( const KeyEvent& rKEvt );
93 virtual bool set_property(const OString &rKey, const OString &rValue);
96 /** sets <member>m_aClickHdl</member> with <arg>rLink</arg>.
98 <member>m_aClickHdl</member> is called if the text is clicked.
100 inline void SetClickHdl( const Link& rLink ) { m_aClickHdl = rLink; }
102 /** returns <member>m_aClickHdl</member>.
104 @return
105 <member>m_aClickHdl</member>
107 inline const Link& GetClickHdl() const { return m_aClickHdl; }
109 // ::FixedHyperbaseLink
111 /** sets the URL of the hyperlink and uses it as tooltip. */
112 void SetURL(const OUString& rNewURL);
114 /** returns the URL of the hyperlink.
116 @return
117 <member>m_sURL</member>
119 OUString GetURL() const;
121 /** sets new text and recalculates the text length. */
122 virtual void SetText(const OUString& rNewDescription);
125 #endif
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */