Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _SVTOOLS_ROADMAP_HXX
29 : : #define _SVTOOLS_ROADMAP_HXX
30 : :
31 : : #include "svtools/svtdllapi.h"
32 : : #include <vcl/ctrl.hxx>
33 : : #include <vcl/imgctrl.hxx>
34 : :
35 : : #include "svtools/hyperlabel.hxx"
36 : :
37 : :
38 : :
39 : :
40 : : class Bitmap;
41 : : //.........................................................................
42 : : namespace svt
43 : : {
44 : : //.........................................................................
45 : :
46 : 0 : struct RoadmapTypes
47 : : {
48 : : public:
49 : : typedef sal_Int16 ItemId;
50 : : typedef sal_Int32 ItemIndex;
51 : : };
52 : :
53 : : class RoadmapImpl;
54 : : class RoadmapItem;
55 : :
56 : : //=====================================================================
57 : : //= Roadmap
58 : : //=====================================================================
59 : : class SVT_DLLPUBLIC ORoadmap : public Control, public RoadmapTypes
60 : : {
61 : : protected:
62 : : RoadmapImpl* m_pImpl;
63 : : // Window overridables
64 : : void Paint( const Rectangle& _rRect );
65 : : void implInit();
66 : :
67 : : public:
68 : : ORoadmap( Window* _pParent, WinBits _nWinStyle = 0 );
69 : : ~ORoadmap( );
70 : :
71 : : void SetRoadmapBitmap( const BitmapEx& maBitmap, sal_Bool _bInvalidate = sal_True );
72 : :
73 : : void EnableRoadmapItem( ItemId _nItemId, sal_Bool _bEnable, ItemIndex _nStartIndex = 0 );
74 : :
75 : : void ChangeRoadmapItemLabel( ItemId _nID, const ::rtl::OUString& sLabel, ItemIndex _nStartIndex = 0 );
76 : : void ChangeRoadmapItemID( ItemId _nID, ItemId _NewID, ItemIndex _nStartIndex = 0 );
77 : :
78 : : void SetRoadmapInteractive( sal_Bool _bInteractive );
79 : : sal_Bool IsRoadmapInteractive();
80 : :
81 : : void SetRoadmapComplete( sal_Bool _bComplete );
82 : : sal_Bool IsRoadmapComplete() const;
83 : :
84 : : ItemIndex GetItemCount() const;
85 : : ItemId GetItemID( ItemIndex _nIndex ) const;
86 : :
87 : : void InsertRoadmapItem( ItemIndex _Index, const ::rtl::OUString& _RoadmapItem, ItemId _nUniqueId, sal_Bool _bEnabled = sal_True );
88 : : void ReplaceRoadmapItem( ItemIndex _Index, const ::rtl::OUString& _RoadmapItem, ItemId _nUniqueId, sal_Bool _bEnabled );
89 : : void DeleteRoadmapItem( ItemIndex _nIndex );
90 : :
91 : : ItemId GetCurrentRoadmapItemID() const;
92 : : sal_Bool SelectRoadmapItemByID( ItemId _nItemID );
93 : :
94 : : void SetItemSelectHdl( const Link& _rHdl );
95 : : Link GetItemSelectHdl( ) const;
96 : : virtual void DataChanged( const DataChangedEvent& rDCEvt );
97 : : virtual void GetFocus();
98 : :
99 : :
100 : : protected:
101 : : long PreNotify( NotifyEvent& rNEvt );
102 : :
103 : : protected:
104 : : /// called when an item has been selected by any means
105 : : virtual void Select();
106 : :
107 : : private:
108 : : DECL_LINK(ImplClickHdl, HyperLabel*);
109 : :
110 : : RoadmapItem* GetByIndex( ItemIndex _nItemIndex );
111 : : const RoadmapItem* GetByIndex( ItemIndex _nItemIndex ) const;
112 : :
113 : : RoadmapItem* GetByID( ItemId _nID, ItemIndex _nStartIndex = 0 );
114 : : const RoadmapItem* GetByID( ItemId _nID, ItemIndex _nStartIndex = 0 ) const;
115 : : RoadmapItem* GetPreviousHyperLabel( ItemIndex _Index);
116 : :
117 : : void DrawHeadline();
118 : : void DeselectOldRoadmapItems();
119 : : ItemId GetNextAvailableItemId( ItemIndex _NewIndex );
120 : : ItemId GetPreviousAvailableItemId( ItemIndex _NewIndex );
121 : : RoadmapItem* GetByPointer(Window* pWindow);
122 : : RoadmapItem* InsertHyperLabel( ItemIndex _Index, const ::rtl::OUString& _aStr, ItemId _RMID, sal_Bool _bEnabled = sal_True );
123 : : void UpdatefollowingHyperLabels( ItemIndex _Index );
124 : : };
125 : :
126 : : //.........................................................................
127 : : } // namespace svt
128 : : //.........................................................................
129 : :
130 : : #endif
131 : :
132 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|