LibreOffice Module vcl (master)  1
roadmap.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_VCL_INC_ROADMAP_HXX
20 #define INCLUDED_VCL_INC_ROADMAP_HXX
21 
22 #if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION)
23 #error "don't use this in new code"
24 #endif
25 
26 #include <vcl/dllapi.h>
27 #include <vcl/ctrl.hxx>
28 #include <vcl/toolkit/imgctrl.hxx>
29 #include <memory>
30 
31 class Bitmap;
32 
33 namespace vcl
34 {
35 
37 {
38 public:
39  typedef sal_Int16 ItemId;
40  typedef sal_Int32 ItemIndex;
41 };
42 
43 class HyperLabel;
44 class RoadmapImpl;
45 class RoadmapItem;
46 
47 class VCL_DLLPUBLIC ORoadmap final : public Control, public RoadmapTypes
48 {
49 public:
50  ORoadmap( vcl::Window* _pParent, WinBits _nWinStyle );
51  virtual ~ORoadmap( ) override;
52  virtual void dispose() override;
53 
54  void SetRoadmapBitmap( const BitmapEx& maBitmap );
55 
56  void EnableRoadmapItem( ItemId _nItemId, bool _bEnable );
57 
58  void ChangeRoadmapItemLabel( ItemId _nID, const OUString& sLabel );
59  void ChangeRoadmapItemID( ItemId _nID, ItemId NewID );
60 
61  void SetRoadmapInteractive( bool _bInteractive );
62  bool IsRoadmapInteractive() const;
63 
64  void SetRoadmapComplete( bool _bComplete );
65  bool IsRoadmapComplete() const;
66 
67  ItemIndex GetItemCount() const;
68  ItemId GetItemID( ItemIndex _nIndex ) const;
69 
70  void InsertRoadmapItem( ItemIndex Index, const OUString& RoadmapItem, ItemId _nUniqueId, bool _bEnabled );
71  void ReplaceRoadmapItem( ItemIndex Index, const OUString& RoadmapItem, ItemId _nUniqueId, bool _bEnabled );
72  void DeleteRoadmapItem( ItemIndex _nIndex );
73 
74  ItemId GetCurrentRoadmapItemID() const;
75  bool SelectRoadmapItemByID( ItemId _nItemID );
76 
77  void SetItemSelectHdl( const Link<LinkParamNone*,void>& _rHdl );
78  Link<LinkParamNone*,void> const & GetItemSelectHdl( ) const;
79  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
80  virtual void GetFocus() override;
81  virtual void ApplySettings( vcl::RenderContext& rRenderContext ) override;
82 
83 private:
84  bool PreNotify( NotifyEvent& rNEvt ) override;
85 
87  void Select();
88 
89  DECL_LINK(ImplClickHdl, HyperLabel*, void);
90 
91  RoadmapItem* GetByIndex( ItemIndex _nItemIndex );
92  const RoadmapItem* GetByIndex( ItemIndex _nItemIndex ) const;
93 
94  RoadmapItem* GetByID( ItemId _nID );
95  const RoadmapItem* GetByID( ItemId _nID ) const;
96  RoadmapItem* GetPreviousHyperLabel( ItemIndex Index);
97 
98  void DrawHeadline(vcl::RenderContext& rRenderContext);
99  void DeselectOldRoadmapItems();
100  ItemId GetNextAvailableItemId( ItemIndex NewIndex );
101  ItemId GetPreviousAvailableItemId( ItemIndex NewIndex );
102  RoadmapItem* GetByPointer(vcl::Window const * pWindow);
103  RoadmapItem* InsertHyperLabel( ItemIndex Index, const OUString& _aStr, ItemId RMID, bool _bEnabled, bool _bIncomplete );
104  void UpdatefollowingHyperLabels( ItemIndex Index );
105 
106  // Window overridables
107  void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& _rRect) override;
108  void implInit(vcl::RenderContext& rRenderContext);
109 
110  std::unique_ptr<RoadmapImpl> m_pImpl;
111 };
112 
113 } // namespace vcl
114 
115 #endif
116 
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 ItemIndex
Definition: roadmap.hxx:40
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
sal_Int64 WinBits
std::unique_ptr< RoadmapImpl > m_pImpl
Definition: roadmap.hxx:110
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:304
sal_Int16 ItemId
Definition: roadmap.hxx:39
Definition: ctrl.hxx:33
void dispose()