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 .
22 #if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS)
23 #error "don't use this in new code"
26 #include <config_options.h>
27 #include <vcl/dllapi.h>
28 #include <vcl/ctrl.hxx>
29 #include <vcl/toolkit/imgctrl.hxx>
40 typedef sal_Int16 ItemId
;
41 typedef sal_Int32 ItemIndex
;
48 class UNLESS_MERGELIBS(VCL_DLLPUBLIC
) ORoadmap final
: public Control
, public RoadmapTypes
51 ORoadmap( vcl::Window
* _pParent
, WinBits _nWinStyle
);
52 virtual ~ORoadmap( ) override
;
53 virtual void dispose() override
;
55 void SetRoadmapBitmap( const BitmapEx
& maBitmap
);
57 void EnableRoadmapItem( ItemId _nItemId
, bool _bEnable
);
59 void ChangeRoadmapItemLabel( ItemId _nID
, const OUString
& sLabel
);
60 void ChangeRoadmapItemID( ItemId _nID
, ItemId NewID
);
62 void SetRoadmapInteractive( bool _bInteractive
);
63 bool IsRoadmapInteractive() const;
65 void SetRoadmapComplete( bool _bComplete
);
66 bool IsRoadmapComplete() const;
68 ItemIndex
GetItemCount() const;
69 ItemId
GetItemID( ItemIndex _nIndex
) const;
71 void InsertRoadmapItem( ItemIndex Index
, const OUString
& RoadmapItem
, ItemId _nUniqueId
, bool _bEnabled
);
72 void ReplaceRoadmapItem( ItemIndex Index
, const OUString
& RoadmapItem
, ItemId _nUniqueId
, bool _bEnabled
);
73 void DeleteRoadmapItem( ItemIndex _nIndex
);
75 ItemId
GetCurrentRoadmapItemID() const;
76 bool SelectRoadmapItemByID(ItemId nItemID
, bool bGrabFocus
= true);
78 void SetItemSelectHdl( const Link
<LinkParamNone
*,void>& _rHdl
);
79 Link
<LinkParamNone
*,void> const & GetItemSelectHdl( ) const;
80 virtual void DataChanged( const DataChangedEvent
& rDCEvt
) override
;
81 virtual void GetFocus() override
;
82 virtual void ApplySettings( vcl::RenderContext
& rRenderContext
) override
;
85 bool PreNotify( NotifyEvent
& rNEvt
) override
;
87 /// called when an item has been selected by any means
90 DECL_DLLPRIVATE_LINK(ImplClickHdl
, HyperLabel
*, void);
92 RoadmapItem
* GetByIndex( ItemIndex _nItemIndex
);
93 const RoadmapItem
* GetByIndex( ItemIndex _nItemIndex
) const;
95 RoadmapItem
* GetByID( ItemId _nID
);
96 const RoadmapItem
* GetByID( ItemId _nID
) const;
97 RoadmapItem
* GetPreviousHyperLabel( ItemIndex Index
);
99 void DrawHeadline(vcl::RenderContext
& rRenderContext
);
100 void DeselectOldRoadmapItems();
101 ItemId
GetNextAvailableItemId( ItemIndex NewIndex
);
102 ItemId
GetPreviousAvailableItemId( ItemIndex NewIndex
);
103 RoadmapItem
* GetByPointer(vcl::Window
const * pWindow
);
104 RoadmapItem
* InsertHyperLabel( ItemIndex Index
, const OUString
& _aStr
, ItemId RMID
, bool _bEnabled
, bool _bIncomplete
);
105 void UpdatefollowingHyperLabels( ItemIndex Index
);
107 // Window overridables
108 void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& _rRect
) override
;
109 void implInit(vcl::RenderContext
& rRenderContext
);
111 std::unique_ptr
<RoadmapImpl
> m_pImpl
;
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */