xref: /trunk/main/svtools/inc/svtools/roadmap.hxx (revision 01aa44aa)
1*01aa44aaSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*01aa44aaSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*01aa44aaSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*01aa44aaSAndrew Rist  * distributed with this work for additional information
6*01aa44aaSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*01aa44aaSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*01aa44aaSAndrew Rist  * "License"); you may not use this file except in compliance
9*01aa44aaSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*01aa44aaSAndrew Rist  *
11*01aa44aaSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*01aa44aaSAndrew Rist  *
13*01aa44aaSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*01aa44aaSAndrew Rist  * software distributed under the License is distributed on an
15*01aa44aaSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*01aa44aaSAndrew Rist  * KIND, either express or implied.  See the License for the
17*01aa44aaSAndrew Rist  * specific language governing permissions and limitations
18*01aa44aaSAndrew Rist  * under the License.
19*01aa44aaSAndrew Rist  *
20*01aa44aaSAndrew Rist  *************************************************************/
21*01aa44aaSAndrew Rist 
22*01aa44aaSAndrew Rist 
23cdf0e10cSrcweir #ifndef _SVTOOLS_ROADMAP_HXX
24cdf0e10cSrcweir #define _SVTOOLS_ROADMAP_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "svtools/svtdllapi.h"
27cdf0e10cSrcweir #include <vcl/ctrl.hxx>
28cdf0e10cSrcweir #include <vcl/imgctrl.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #ifndef _SVTOOLS_HYPERLABEL_HXX
31cdf0e10cSrcweir #include "svtools/hyperlabel.hxx"
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir 
34cdf0e10cSrcweir 
35cdf0e10cSrcweir 
36cdf0e10cSrcweir 
37cdf0e10cSrcweir class Bitmap;
38cdf0e10cSrcweir //.........................................................................
39cdf0e10cSrcweir namespace svt
40cdf0e10cSrcweir {
41cdf0e10cSrcweir //.........................................................................
42cdf0e10cSrcweir 
43cdf0e10cSrcweir     struct RoadmapTypes
44cdf0e10cSrcweir     {
45cdf0e10cSrcweir     public:
46cdf0e10cSrcweir         typedef sal_Int16 ItemId;
47cdf0e10cSrcweir         typedef sal_Int32 ItemIndex;
48cdf0e10cSrcweir     };
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 	class RoadmapImpl;
51cdf0e10cSrcweir     class RoadmapItem;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 	//=====================================================================
54cdf0e10cSrcweir 	//= Roadmap
55cdf0e10cSrcweir 	//=====================================================================
56cdf0e10cSrcweir 	class SVT_DLLPUBLIC ORoadmap : public Control, public RoadmapTypes
57cdf0e10cSrcweir 	{
58cdf0e10cSrcweir 	protected:
59cdf0e10cSrcweir 		RoadmapImpl*	m_pImpl;
60cdf0e10cSrcweir 		// Window overridables
61cdf0e10cSrcweir 		void			Paint( const Rectangle& _rRect );
62cdf0e10cSrcweir         void            implInit();
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	public:
65cdf0e10cSrcweir 		ORoadmap( Window* _pParent, const ResId& _rId );
66cdf0e10cSrcweir 		ORoadmap( Window* _pParent, WinBits _nWinStyle = 0 );
67cdf0e10cSrcweir 		~ORoadmap( );
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 		void			SetRoadmapBitmap( const BitmapEx& maBitmap, sal_Bool _bInvalidate = sal_True );
70cdf0e10cSrcweir         const BitmapEx&	GetRoadmapBitmap( ) const;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir         void            EnableRoadmapItem( ItemId _nItemId, sal_Bool _bEnable, ItemIndex _nStartIndex = 0  );
73cdf0e10cSrcweir         sal_Bool        IsRoadmapItemEnabled( ItemId _nItemId, ItemIndex _nStartIndex = 0 ) const;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir         void            ChangeRoadmapItemLabel( ItemId _nID, const ::rtl::OUString& sLabel, ItemIndex _nStartIndex = 0 );
76cdf0e10cSrcweir         ::rtl::OUString GetRoadmapItemLabel( ItemId _nID, ItemIndex _nStartIndex = 0 );
77cdf0e10cSrcweir         void            ChangeRoadmapItemID( ItemId _nID, ItemId _NewID, ItemIndex _nStartIndex = 0  );
78cdf0e10cSrcweir 
79cdf0e10cSrcweir         void            SetRoadmapInteractive( sal_Bool _bInteractive );
80cdf0e10cSrcweir         sal_Bool        IsRoadmapInteractive();
81cdf0e10cSrcweir 
82cdf0e10cSrcweir         void            SetRoadmapComplete( sal_Bool _bComplete );
83cdf0e10cSrcweir         sal_Bool        IsRoadmapComplete() const;
84cdf0e10cSrcweir 
85cdf0e10cSrcweir         ItemIndex       GetItemCount() const;
86cdf0e10cSrcweir         ItemId          GetItemID( ItemIndex _nIndex ) const;
87cdf0e10cSrcweir         ItemIndex       GetItemIndex( ItemId _nID ) const;
88cdf0e10cSrcweir 
89cdf0e10cSrcweir         void            InsertRoadmapItem( ItemIndex _Index, const ::rtl::OUString& _RoadmapItem, ItemId _nUniqueId, sal_Bool _bEnabled = sal_True );
90cdf0e10cSrcweir         void            ReplaceRoadmapItem( ItemIndex _Index, const ::rtl::OUString& _RoadmapItem, ItemId _nUniqueId, sal_Bool _bEnabled );
91cdf0e10cSrcweir         void            DeleteRoadmapItem( ItemIndex _nIndex );
92cdf0e10cSrcweir 
93cdf0e10cSrcweir         ItemId          GetCurrentRoadmapItemID() const;
94cdf0e10cSrcweir         sal_Bool        SelectRoadmapItemByID( ItemId _nItemID );
95cdf0e10cSrcweir 
96cdf0e10cSrcweir         void            SetItemSelectHdl( const Link& _rHdl );
97cdf0e10cSrcweir         Link            GetItemSelectHdl( ) const;
98cdf0e10cSrcweir 		virtual void	DataChanged( const DataChangedEvent& rDCEvt );
99cdf0e10cSrcweir         virtual void    GetFocus();
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 
102cdf0e10cSrcweir     protected:
103cdf0e10cSrcweir         long       		PreNotify( NotifyEvent& rNEvt );
104cdf0e10cSrcweir 
105cdf0e10cSrcweir     protected:
106cdf0e10cSrcweir         /// called when an item has been selected by any means
107cdf0e10cSrcweir         virtual void    Select();
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 	private:
110cdf0e10cSrcweir         DECL_LINK(ImplClickHdl, HyperLabel*);
111cdf0e10cSrcweir 
112cdf0e10cSrcweir         RoadmapItem*         GetByIndex( ItemIndex _nItemIndex );
113cdf0e10cSrcweir         const RoadmapItem*   GetByIndex( ItemIndex _nItemIndex ) const;
114cdf0e10cSrcweir 
115cdf0e10cSrcweir         RoadmapItem*         GetByID( ItemId _nID, ItemIndex _nStartIndex = 0  );
116cdf0e10cSrcweir         const RoadmapItem*   GetByID( ItemId _nID, ItemIndex _nStartIndex = 0  ) const;
117cdf0e10cSrcweir 		RoadmapItem*			GetPreviousHyperLabel( ItemIndex _Index);
118cdf0e10cSrcweir 
119cdf0e10cSrcweir         void						DrawHeadline();
120cdf0e10cSrcweir         void						DeselectOldRoadmapItems();
121cdf0e10cSrcweir         ItemId						GetNextAvailableItemId( ItemIndex _NewIndex );
122cdf0e10cSrcweir         ItemId						GetPreviousAvailableItemId( ItemIndex _NewIndex );
123cdf0e10cSrcweir         RoadmapItem*                GetByPointer(Window* pWindow);
124cdf0e10cSrcweir         RoadmapItem*                InsertHyperLabel( ItemIndex _Index, const ::rtl::OUString& _aStr, ItemId _RMID, sal_Bool _bEnabled = sal_True  );
125cdf0e10cSrcweir         void						UpdatefollowingHyperLabels( ItemIndex _Index );
126cdf0e10cSrcweir 	};
127cdf0e10cSrcweir 
128cdf0e10cSrcweir //.........................................................................
129cdf0e10cSrcweir }	// namespace svt
130cdf0e10cSrcweir //.........................................................................
131cdf0e10cSrcweir 
132cdf0e10cSrcweir #endif
133cdf0e10cSrcweir 
134