loplugin:constmethod in vcl
[LibreOffice.git] / include / vcl / roadmap.hxx
blobf3811ba568127aa5cc82e90ace9c99416972b0b9
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 .
19 #ifndef INCLUDED_VCL_INC_ROADMAP_HXX
20 #define INCLUDED_VCL_INC_ROADMAP_HXX
22 #include <vcl/dllapi.h>
23 #include <vcl/ctrl.hxx>
24 #include <vcl/hyperlabel.hxx>
25 #include <vcl/imgctrl.hxx>
26 #include <memory>
28 class Bitmap;
30 namespace vcl
33 struct RoadmapTypes
35 public:
36 typedef sal_Int16 ItemId;
37 typedef sal_Int32 ItemIndex;
40 class RoadmapImpl;
41 class RoadmapItem;
43 class VCL_DLLPUBLIC ORoadmap final : public Control, public RoadmapTypes
45 public:
46 ORoadmap( vcl::Window* _pParent, WinBits _nWinStyle );
47 virtual ~ORoadmap( ) override;
48 virtual void dispose() override;
50 void SetRoadmapBitmap( const BitmapEx& maBitmap );
52 void EnableRoadmapItem( ItemId _nItemId, bool _bEnable );
54 void ChangeRoadmapItemLabel( ItemId _nID, const OUString& sLabel );
55 void ChangeRoadmapItemID( ItemId _nID, ItemId NewID );
57 void SetRoadmapInteractive( bool _bInteractive );
58 bool IsRoadmapInteractive() const;
60 void SetRoadmapComplete( bool _bComplete );
61 bool IsRoadmapComplete() const;
63 ItemIndex GetItemCount() const;
64 ItemId GetItemID( ItemIndex _nIndex ) const;
66 void InsertRoadmapItem( ItemIndex Index, const OUString& RoadmapItem, ItemId _nUniqueId, bool _bEnabled );
67 void ReplaceRoadmapItem( ItemIndex Index, const OUString& RoadmapItem, ItemId _nUniqueId, bool _bEnabled );
68 void DeleteRoadmapItem( ItemIndex _nIndex );
70 ItemId GetCurrentRoadmapItemID() const;
71 bool SelectRoadmapItemByID( ItemId _nItemID );
73 void SetItemSelectHdl( const Link<LinkParamNone*,void>& _rHdl );
74 Link<LinkParamNone*,void> const & GetItemSelectHdl( ) const;
75 virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
76 virtual void GetFocus() override;
77 virtual void ApplySettings( vcl::RenderContext& rRenderContext ) override;
79 private:
80 bool PreNotify( NotifyEvent& rNEvt ) override;
82 /// called when an item has been selected by any means
83 void Select();
85 DECL_LINK(ImplClickHdl, HyperLabel*, void);
87 RoadmapItem* GetByIndex( ItemIndex _nItemIndex );
88 const RoadmapItem* GetByIndex( ItemIndex _nItemIndex ) const;
90 RoadmapItem* GetByID( ItemId _nID );
91 const RoadmapItem* GetByID( ItemId _nID ) const;
92 RoadmapItem* GetPreviousHyperLabel( ItemIndex Index);
94 void DrawHeadline(vcl::RenderContext& rRenderContext);
95 void DeselectOldRoadmapItems();
96 ItemId GetNextAvailableItemId( ItemIndex NewIndex );
97 ItemId GetPreviousAvailableItemId( ItemIndex NewIndex );
98 RoadmapItem* GetByPointer(vcl::Window const * pWindow);
99 RoadmapItem* InsertHyperLabel( ItemIndex Index, const OUString& _aStr, ItemId RMID, bool _bEnabled, bool _bIncomplete );
100 void UpdatefollowingHyperLabels( ItemIndex Index );
102 // Window overridables
103 void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& _rRect) override;
104 void implInit(vcl::RenderContext& rRenderContext);
106 std::unique_ptr<RoadmapImpl> m_pImpl;
109 } // namespace vcl
111 #endif
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */