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>
36 typedef sal_Int16 ItemId
;
37 typedef sal_Int32 ItemIndex
;
43 class SVT_DLLPUBLIC ORoadmap
: public Control
, public RoadmapTypes
47 // Window overridables
48 void Paint(vcl::RenderContext
& rRenderContext
, const Rectangle
& _rRect
) SAL_OVERRIDE
;
49 void implInit(vcl::RenderContext
& rRenderContext
);
52 ORoadmap( vcl::Window
* _pParent
, WinBits _nWinStyle
= 0 );
54 virtual void dispose() SAL_OVERRIDE
;
56 void SetRoadmapBitmap( const BitmapEx
& maBitmap
, bool _bInvalidate
= true );
58 void EnableRoadmapItem( ItemId _nItemId
, bool _bEnable
, ItemIndex _nStartIndex
= 0 );
60 void ChangeRoadmapItemLabel( ItemId _nID
, const OUString
& sLabel
, ItemIndex _nStartIndex
= 0 );
61 void ChangeRoadmapItemID( ItemId _nID
, ItemId _NewID
, ItemIndex _nStartIndex
= 0 );
63 void SetRoadmapInteractive( bool _bInteractive
);
64 bool IsRoadmapInteractive();
66 void SetRoadmapComplete( bool _bComplete
);
67 bool IsRoadmapComplete() const;
69 ItemIndex
GetItemCount() const;
70 ItemId
GetItemID( ItemIndex _nIndex
) const;
72 void InsertRoadmapItem( ItemIndex _Index
, const OUString
& _RoadmapItem
, ItemId _nUniqueId
, bool _bEnabled
= true );
73 void ReplaceRoadmapItem( ItemIndex _Index
, const OUString
& _RoadmapItem
, ItemId _nUniqueId
, bool _bEnabled
);
74 void DeleteRoadmapItem( ItemIndex _nIndex
);
76 ItemId
GetCurrentRoadmapItemID() const;
77 bool SelectRoadmapItemByID( ItemId _nItemID
);
79 void SetItemSelectHdl( const Link
<>& _rHdl
);
80 Link
<> GetItemSelectHdl( ) const;
81 virtual void DataChanged( const DataChangedEvent
& rDCEvt
) SAL_OVERRIDE
;
82 virtual void GetFocus() SAL_OVERRIDE
;
85 bool PreNotify( NotifyEvent
& rNEvt
) SAL_OVERRIDE
;
88 /// called when an item has been selected by any means
92 DECL_LINK(ImplClickHdl
, HyperLabel
*);
94 RoadmapItem
* GetByIndex( ItemIndex _nItemIndex
);
95 const RoadmapItem
* GetByIndex( ItemIndex _nItemIndex
) const;
97 RoadmapItem
* GetByID( ItemId _nID
, ItemIndex _nStartIndex
= 0 );
98 const RoadmapItem
* GetByID( ItemId _nID
, ItemIndex _nStartIndex
= 0 ) const;
99 RoadmapItem
* GetPreviousHyperLabel( ItemIndex _Index
);
101 void DrawHeadline(vcl::RenderContext
& rRenderContext
);
102 void DeselectOldRoadmapItems();
103 ItemId
GetNextAvailableItemId( ItemIndex _NewIndex
);
104 ItemId
GetPreviousAvailableItemId( ItemIndex _NewIndex
);
105 RoadmapItem
* GetByPointer(vcl::Window
* pWindow
);
106 RoadmapItem
* InsertHyperLabel( ItemIndex _Index
, const OUString
& _aStr
, ItemId _RMID
, bool _bEnabled
, bool _bIncomplete
);
107 void UpdatefollowingHyperLabels( ItemIndex _Index
);
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */