Bump version to 5.0-14
[LibreOffice.git] / svtools / inc / roadmap.hxx
bloba4e943166faa661f2d179cb2bad82a9481f5ce5c
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_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>
28 class Bitmap;
30 namespace svt
33 struct RoadmapTypes
35 public:
36 typedef sal_Int16 ItemId;
37 typedef sal_Int32 ItemIndex;
40 class RoadmapImpl;
41 class RoadmapItem;
43 class SVT_DLLPUBLIC ORoadmap : public Control, public RoadmapTypes
45 protected:
46 RoadmapImpl* m_pImpl;
47 // Window overridables
48 void Paint(vcl::RenderContext& rRenderContext, const Rectangle& _rRect) SAL_OVERRIDE;
49 void implInit(vcl::RenderContext& rRenderContext);
51 public:
52 ORoadmap( vcl::Window* _pParent, WinBits _nWinStyle = 0 );
53 virtual ~ORoadmap( );
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;
84 protected:
85 bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
87 protected:
88 /// called when an item has been selected by any means
89 void Select();
91 private:
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 );
110 } // namespace svt
112 #endif
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */