xref: /aoo42x/main/sd/source/ui/inc/navigatr.hxx (revision c45d927a)
1*c45d927aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*c45d927aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*c45d927aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*c45d927aSAndrew Rist  * distributed with this work for additional information
6*c45d927aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*c45d927aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*c45d927aSAndrew Rist  * "License"); you may not use this file except in compliance
9*c45d927aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*c45d927aSAndrew Rist  *
11*c45d927aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*c45d927aSAndrew Rist  *
13*c45d927aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*c45d927aSAndrew Rist  * software distributed under the License is distributed on an
15*c45d927aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c45d927aSAndrew Rist  * KIND, either express or implied.  See the License for the
17*c45d927aSAndrew Rist  * specific language governing permissions and limitations
18*c45d927aSAndrew Rist  * under the License.
19*c45d927aSAndrew Rist  *
20*c45d927aSAndrew Rist  *************************************************************/
21*c45d927aSAndrew Rist 
22*c45d927aSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SD_NAVIGATOR_HXX
25cdf0e10cSrcweir #define SD_NAVIGATOR_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <vcl/window.hxx>
28cdf0e10cSrcweir #include <vcl/lstbox.hxx>
29cdf0e10cSrcweir #ifndef _TOOLBOX_HXX //autogen
30cdf0e10cSrcweir #include <vcl/toolbox.hxx>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #include <sfx2/ctrlitem.hxx>
33cdf0e10cSrcweir #include "sdtreelb.hxx"
34cdf0e10cSrcweir #include "pres.hxx"
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #define NAVSTATE_NONE			0x00000000
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #define NAVBTN_PEN_ENABLED		0x00000010
39cdf0e10cSrcweir #define NAVBTN_PEN_DISABLED 	0x00000020
40cdf0e10cSrcweir #define NAVBTN_PEN_CHECKED		0x00000040
41cdf0e10cSrcweir #define NAVBTN_PEN_UNCHECKED	0x00000080
42cdf0e10cSrcweir 
43cdf0e10cSrcweir #define NAVTLB_UPDATE			0x00000100
44cdf0e10cSrcweir 
45cdf0e10cSrcweir #define NAVBTN_FIRST_ENABLED	0x00001000
46cdf0e10cSrcweir #define NAVBTN_FIRST_DISABLED	0x00002000
47cdf0e10cSrcweir #define NAVBTN_PREV_ENABLED 	0x00004000
48cdf0e10cSrcweir #define NAVBTN_PREV_DISABLED	0x00008000
49cdf0e10cSrcweir 
50cdf0e10cSrcweir #define NAVBTN_LAST_ENABLED 	0x00010000
51cdf0e10cSrcweir #define NAVBTN_LAST_DISABLED	0x00020000
52cdf0e10cSrcweir #define NAVBTN_NEXT_ENABLED 	0x00040000
53cdf0e10cSrcweir #define NAVBTN_NEXT_DISABLED	0x00080000
54cdf0e10cSrcweir 
55cdf0e10cSrcweir // forward
56cdf0e10cSrcweir namespace sd {
57cdf0e10cSrcweir class DrawDocShell;
58cdf0e10cSrcweir class NavigatorChildWindow;
59cdf0e10cSrcweir class View;
60cdf0e10cSrcweir }
61cdf0e10cSrcweir class Menu;
62cdf0e10cSrcweir class SdNavigatorControllerItem;
63cdf0e10cSrcweir class SdPageNameControllerItem;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir //------------------------------------------------------------------------
66cdf0e10cSrcweir 
67cdf0e10cSrcweir class NavDocInfo
68cdf0e10cSrcweir {
69cdf0e10cSrcweir public:
70cdf0e10cSrcweir 			NavDocInfo() { mpDocShell = NULL; }
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 	sal_Bool	HasName() { return( (sal_Bool) bName ); }
73cdf0e10cSrcweir 	sal_Bool	IsActive() { return( (sal_Bool) bActive ); }
74cdf0e10cSrcweir 
75cdf0e10cSrcweir 	void	SetName( sal_Bool bOn = sal_True ) { bName = bOn; }
76cdf0e10cSrcweir 	void	SetActive( sal_Bool bOn = sal_True ) { bActive = bOn; }
77cdf0e10cSrcweir 
78cdf0e10cSrcweir private:
79cdf0e10cSrcweir     friend class SdNavigatorWin;
80cdf0e10cSrcweir 	sal_Bool			bName	: 1;
81cdf0e10cSrcweir 	sal_Bool			bActive : 1;
82cdf0e10cSrcweir 	::sd::DrawDocShell* mpDocShell;
83cdf0e10cSrcweir };
84cdf0e10cSrcweir 
85cdf0e10cSrcweir //------------------------------------------------------------------------
86cdf0e10cSrcweir 
87cdf0e10cSrcweir class SdNavigatorWin
88cdf0e10cSrcweir     : public Window
89cdf0e10cSrcweir {
90cdf0e10cSrcweir public:
91cdf0e10cSrcweir     SdNavigatorWin(
92cdf0e10cSrcweir         ::Window* pParent,
93cdf0e10cSrcweir         ::sd::NavigatorChildWindow* pChildWinContext,
94cdf0e10cSrcweir         const SdResId& rSdResId,
95cdf0e10cSrcweir         SfxBindings* pBindings );
96cdf0e10cSrcweir     virtual ~SdNavigatorWin();
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	virtual void				KeyInput( const KeyEvent& rKEvt );
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 	void						InitTreeLB( const SdDrawDocument* pDoc );
101cdf0e10cSrcweir 	void						RefreshDocumentLB( const String* pDocName = NULL );
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 	sal_Bool						InsertFile(const String& rFileName);
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 	NavigatorDragType			GetNavigatorDragType();
106cdf0e10cSrcweir 	void						SetNavigatorDragType(NavigatorDragType eType) { meDragType = eType; }
107cdf0e10cSrcweir 
108cdf0e10cSrcweir protected:
109cdf0e10cSrcweir 	virtual void				Resize();
110cdf0e10cSrcweir 	virtual long				Notify(NotifyEvent& rNEvt);
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 
113cdf0e10cSrcweir private:
114cdf0e10cSrcweir     friend class ::sd::NavigatorChildWindow;
115cdf0e10cSrcweir     friend class SdNavigatorControllerItem;
116cdf0e10cSrcweir     friend class SdPageNameControllerItem;
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 	ToolBox						maToolbox;
119cdf0e10cSrcweir 	SdPageObjsTLB				maTlbObjects;
120cdf0e10cSrcweir 	ListBox 					maLbDocs;
121cdf0e10cSrcweir 
122cdf0e10cSrcweir 	::sd::NavigatorChildWindow*		mpChildWinContext;
123cdf0e10cSrcweir 	Size						maSize;
124cdf0e10cSrcweir 	Size						maMinSize;
125cdf0e10cSrcweir //	Size						maFltWinSize;
126cdf0e10cSrcweir 	sal_Bool						mbDocImported;
127cdf0e10cSrcweir 	String						maDropFileName;
128cdf0e10cSrcweir 	NavigatorDragType			meDragType;
129cdf0e10cSrcweir 	List*						mpDocList;
130cdf0e10cSrcweir 	SfxBindings*				mpBindings;
131cdf0e10cSrcweir 	SdNavigatorControllerItem*	mpNavigatorCtrlItem;
132cdf0e10cSrcweir 	SdPageNameControllerItem*	mpPageNameCtrlItem;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 	ImageList					maImageList;
135cdf0e10cSrcweir 	ImageList					maImageListH;
136cdf0e10cSrcweir 
137cdf0e10cSrcweir     /** This flag controls whether all shapes or only the named shapes are
138cdf0e10cSrcweir         shown.
139cdf0e10cSrcweir     */
140cdf0e10cSrcweir     bool                        mbShowAllShapes;
141cdf0e10cSrcweir 
142cdf0e10cSrcweir 	sal_uInt16						GetDragTypeSdResId( NavigatorDragType eDT, sal_Bool bImage = sal_False );
143cdf0e10cSrcweir 	NavDocInfo*					GetDocInfo();
144cdf0e10cSrcweir 
145cdf0e10cSrcweir 								DECL_LINK( GetFocusObjectsHdl, void * );
146cdf0e10cSrcweir 								DECL_LINK( SelectToolboxHdl, void * );
147cdf0e10cSrcweir 								DECL_LINK( ClickToolboxHdl, ToolBox * );
148cdf0e10cSrcweir 								DECL_LINK( DropdownClickToolBoxHdl, ToolBox * );
149cdf0e10cSrcweir 								DECL_LINK( ClickPageHdl, void * );
150cdf0e10cSrcweir 								DECL_LINK( ClickObjectHdl, void * );
151cdf0e10cSrcweir 								DECL_LINK( SelectDocumentHdl, void * );
152cdf0e10cSrcweir 								DECL_LINK( MenuSelectHdl, Menu * );
153cdf0e10cSrcweir 								DECL_LINK( ShapeFilterCallback, Menu * );
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 	virtual void				DataChanged( const DataChangedEvent& rDCEvt );
156cdf0e10cSrcweir 	void						SetDragImage();
157cdf0e10cSrcweir 	void						ApplyImageList();
158cdf0e10cSrcweir };
159cdf0e10cSrcweir 
160cdf0e10cSrcweir 
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 
163cdf0e10cSrcweir /*************************************************************************
164cdf0e10cSrcweir |*
165cdf0e10cSrcweir |* ControllerItem fuer Navigator
166cdf0e10cSrcweir |*
167cdf0e10cSrcweir \************************************************************************/
168cdf0e10cSrcweir 
169cdf0e10cSrcweir class SdNavigatorControllerItem : public SfxControllerItem
170cdf0e10cSrcweir {
171cdf0e10cSrcweir public:
172cdf0e10cSrcweir 	SdNavigatorControllerItem( sal_uInt16, SdNavigatorWin*, SfxBindings* );
173cdf0e10cSrcweir 
174cdf0e10cSrcweir protected:
175cdf0e10cSrcweir 	virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
176cdf0e10cSrcweir 								const SfxPoolItem* pState );
177cdf0e10cSrcweir 
178cdf0e10cSrcweir private:
179cdf0e10cSrcweir 	SdNavigatorWin* pNavigatorWin;
180cdf0e10cSrcweir };
181cdf0e10cSrcweir 
182cdf0e10cSrcweir 
183cdf0e10cSrcweir 
184cdf0e10cSrcweir /*************************************************************************
185cdf0e10cSrcweir |*
186cdf0e10cSrcweir |* ControllerItem fuer Navigator zum Anzeigen der Seite in der TreeLB
187cdf0e10cSrcweir |*
188cdf0e10cSrcweir \************************************************************************/
189cdf0e10cSrcweir 
190cdf0e10cSrcweir class SdPageNameControllerItem : public SfxControllerItem
191cdf0e10cSrcweir {
192cdf0e10cSrcweir public:
193cdf0e10cSrcweir 	SdPageNameControllerItem( sal_uInt16, SdNavigatorWin*, SfxBindings* );
194cdf0e10cSrcweir 
195cdf0e10cSrcweir protected:
196cdf0e10cSrcweir 	virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
197cdf0e10cSrcweir 								const SfxPoolItem* pState );
198cdf0e10cSrcweir 
199cdf0e10cSrcweir private:
200cdf0e10cSrcweir 	SdNavigatorWin* pNavigatorWin;
201cdf0e10cSrcweir };
202cdf0e10cSrcweir 
203cdf0e10cSrcweir #endif
204