Line data Source code
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_SVTOOLS_INC_ROADMAP_HXX
20 : #define INCLUDED_SVTOOLS_INC_ROADMAP_HXX
21 :
22 : #include <svtools/svtdllapi.h>
23 : #include <vcl/ctrl.hxx>
24 : #include <vcl/imgctrl.hxx>
25 :
26 : #include <svtools/hyperlabel.hxx>
27 :
28 : class Bitmap;
29 :
30 : namespace svt
31 : {
32 :
33 0 : struct RoadmapTypes
34 : {
35 : public:
36 : typedef sal_Int16 ItemId;
37 : typedef sal_Int32 ItemIndex;
38 : };
39 :
40 : class RoadmapImpl;
41 : class RoadmapItem;
42 :
43 : class SVT_DLLPUBLIC ORoadmap : public Control, public RoadmapTypes
44 : {
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);
50 :
51 : public:
52 : ORoadmap( vcl::Window* _pParent, WinBits _nWinStyle = 0 );
53 : virtual ~ORoadmap( );
54 : virtual void dispose() SAL_OVERRIDE;
55 :
56 : void SetRoadmapBitmap( const BitmapEx& maBitmap, bool _bInvalidate = true );
57 :
58 : void EnableRoadmapItem( ItemId _nItemId, bool _bEnable, ItemIndex _nStartIndex = 0 );
59 :
60 : void ChangeRoadmapItemLabel( ItemId _nID, const OUString& sLabel, ItemIndex _nStartIndex = 0 );
61 : void ChangeRoadmapItemID( ItemId _nID, ItemId _NewID, ItemIndex _nStartIndex = 0 );
62 :
63 : void SetRoadmapInteractive( bool _bInteractive );
64 : bool IsRoadmapInteractive();
65 :
66 : void SetRoadmapComplete( bool _bComplete );
67 : bool IsRoadmapComplete() const;
68 :
69 : ItemIndex GetItemCount() const;
70 : ItemId GetItemID( ItemIndex _nIndex ) const;
71 :
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 );
75 :
76 : ItemId GetCurrentRoadmapItemID() const;
77 : bool SelectRoadmapItemByID( ItemId _nItemID );
78 :
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;
83 :
84 : protected:
85 : bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
86 :
87 : protected:
88 : /// called when an item has been selected by any means
89 : void Select();
90 :
91 : private:
92 : DECL_LINK(ImplClickHdl, HyperLabel*);
93 :
94 : RoadmapItem* GetByIndex( ItemIndex _nItemIndex );
95 : const RoadmapItem* GetByIndex( ItemIndex _nItemIndex ) const;
96 :
97 : RoadmapItem* GetByID( ItemId _nID, ItemIndex _nStartIndex = 0 );
98 : const RoadmapItem* GetByID( ItemId _nID, ItemIndex _nStartIndex = 0 ) const;
99 : RoadmapItem* GetPreviousHyperLabel( ItemIndex _Index);
100 :
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 );
108 : };
109 :
110 : } // namespace svt
111 :
112 : #endif
113 :
114 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|