1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_SVTOOLS_INC_ROADMAP_HXX
20 #define INCLUDED_SVTOOLS_INC_ROADMAP_HXX
22 #include <svtools/svtdllapi.h>
23 #include <vcl/ctrl.hxx>
24 #include <vcl/imgctrl.hxx>
26 #include <svtools/hyperlabel.hxx>
37 typedef sal_Int16 ItemId
;
38 typedef sal_Int32 ItemIndex
;
44 class SVT_DLLPUBLIC ORoadmap final
: public Control
, public RoadmapTypes
47 ORoadmap( vcl::Window
* _pParent
, WinBits _nWinStyle
);
48 virtual ~ORoadmap( ) override
;
49 virtual void dispose() override
;
51 void SetRoadmapBitmap( const BitmapEx
& maBitmap
);
53 void EnableRoadmapItem( ItemId _nItemId
, bool _bEnable
);
55 void ChangeRoadmapItemLabel( ItemId _nID
, const OUString
& sLabel
);
56 void ChangeRoadmapItemID( ItemId _nID
, ItemId NewID
);
58 void SetRoadmapInteractive( bool _bInteractive
);
59 bool IsRoadmapInteractive();
61 void SetRoadmapComplete( bool _bComplete
);
62 bool IsRoadmapComplete() const;
64 ItemIndex
GetItemCount() const;
65 ItemId
GetItemID( ItemIndex _nIndex
) const;
67 void InsertRoadmapItem( ItemIndex Index
, const OUString
& RoadmapItem
, ItemId _nUniqueId
, bool _bEnabled
);
68 void ReplaceRoadmapItem( ItemIndex Index
, const OUString
& RoadmapItem
, ItemId _nUniqueId
, bool _bEnabled
);
69 void DeleteRoadmapItem( ItemIndex _nIndex
);
71 ItemId
GetCurrentRoadmapItemID() const;
72 bool SelectRoadmapItemByID( ItemId _nItemID
);
74 void SetItemSelectHdl( const Link
<LinkParamNone
*,void>& _rHdl
);
75 Link
<LinkParamNone
*,void> const & GetItemSelectHdl( ) const;
76 virtual void DataChanged( const DataChangedEvent
& rDCEvt
) override
;
77 virtual void GetFocus() override
;
78 virtual void ApplySettings( vcl::RenderContext
& rRenderContext
) override
;
81 bool PreNotify( NotifyEvent
& rNEvt
) override
;
83 /// called when an item has been selected by any means
86 DECL_LINK(ImplClickHdl
, HyperLabel
*, void);
88 RoadmapItem
* GetByIndex( ItemIndex _nItemIndex
);
89 const RoadmapItem
* GetByIndex( ItemIndex _nItemIndex
) const;
91 RoadmapItem
* GetByID( ItemId _nID
);
92 const RoadmapItem
* GetByID( ItemId _nID
) const;
93 RoadmapItem
* GetPreviousHyperLabel( ItemIndex Index
);
95 void DrawHeadline(vcl::RenderContext
& rRenderContext
);
96 void DeselectOldRoadmapItems();
97 ItemId
GetNextAvailableItemId( ItemIndex NewIndex
);
98 ItemId
GetPreviousAvailableItemId( ItemIndex NewIndex
);
99 RoadmapItem
* GetByPointer(vcl::Window
const * pWindow
);
100 RoadmapItem
* InsertHyperLabel( ItemIndex Index
, const OUString
& _aStr
, ItemId RMID
, bool _bEnabled
, bool _bIncomplete
);
101 void UpdatefollowingHyperLabels( ItemIndex Index
);
103 // Window overridables
104 void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& _rRect
) override
;
105 void implInit(vcl::RenderContext
& rRenderContext
);
107 std::unique_ptr
<RoadmapImpl
> m_pImpl
;
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */