2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-15 17:28:16 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2019-08-03 19:32:25 +01:00
|
|
|
#ifndef INCLUDED_VCL_HYPERLABEL_HXX
|
|
|
|
#define INCLUDED_VCL_HYPERLABEL_HXX
|
2007-05-14 07:16:42 +00:00
|
|
|
|
2017-04-14 08:42:15 +10:00
|
|
|
#include <memory>
|
2007-05-14 07:16:42 +00:00
|
|
|
|
|
|
|
#include <vcl/fixed.hxx>
|
|
|
|
|
2019-08-03 19:32:25 +01:00
|
|
|
namespace vcl
|
2007-05-14 07:16:42 +00:00
|
|
|
{
|
2015-01-12 15:16:05 +02:00
|
|
|
class HyperLabelImpl;
|
2007-05-14 07:16:42 +00:00
|
|
|
|
2019-08-31 13:15:49 +01:00
|
|
|
class HyperLabel final : public FixedText
|
2007-05-14 07:16:42 +00:00
|
|
|
{
|
2016-05-26 01:37:50 +02:00
|
|
|
std::unique_ptr<HyperLabelImpl> m_pImpl;
|
2015-08-28 15:58:14 +02:00
|
|
|
Link<HyperLabel*,void> maClickHdl;
|
2007-05-14 07:16:42 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void MouseMove( const MouseEvent& rMEvt ) override;
|
|
|
|
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
|
|
|
|
virtual void GetFocus() override;
|
|
|
|
virtual void LoseFocus() override;
|
2007-05-14 07:16:42 +00:00
|
|
|
|
|
|
|
void implInit();
|
|
|
|
|
2017-10-24 08:06:22 +02:00
|
|
|
using FixedText::CalcMinimumSize;
|
|
|
|
|
2007-05-14 07:16:42 +00:00
|
|
|
public:
|
2016-11-18 07:51:48 +02:00
|
|
|
HyperLabel( vcl::Window* _pParent, WinBits _nWinStyle );
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~HyperLabel( ) override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void dispose() override;
|
2007-05-14 07:16:42 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
|
2018-08-10 19:46:59 +02:00
|
|
|
virtual void ApplySettings(vcl::RenderContext& rRenderContext) override;
|
2007-05-14 07:16:42 +00:00
|
|
|
|
2016-03-09 18:47:52 +01:00
|
|
|
void SetID( sal_Int16 ID );
|
2007-05-14 07:16:42 +00:00
|
|
|
sal_Int16 GetID() const;
|
|
|
|
|
2016-03-09 18:47:52 +01:00
|
|
|
void SetIndex( sal_Int32 Index );
|
2007-05-14 07:16:42 +00:00
|
|
|
sal_Int32 GetIndex() const;
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void SetLabel( const OUString& _rText );
|
2007-05-14 07:16:42 +00:00
|
|
|
|
|
|
|
void ToggleBackgroundColor( const Color& _rGBColor );
|
2014-03-20 14:38:38 +02:00
|
|
|
void SetInteractive( bool _bInteractive );
|
2007-05-14 07:16:42 +00:00
|
|
|
|
2015-08-28 15:58:14 +02:00
|
|
|
void SetClickHdl( const Link<HyperLabel*,void>& rLink ) { maClickHdl = rLink; }
|
2007-05-14 07:16:42 +00:00
|
|
|
|
2017-12-25 19:21:12 +02:00
|
|
|
Size const & CalcMinimumSize( long nMaxWidth ) const;
|
2007-05-14 07:16:42 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|