1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: navigatr.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SD_NAVIGATOR_HXX
32 #define SD_NAVIGATOR_HXX
34 #include <vcl/window.hxx>
35 #include <vcl/lstbox.hxx>
36 #ifndef _TOOLBOX_HXX //autogen
37 #include <vcl/toolbox.hxx>
39 #include <sfx2/ctrlitem.hxx>
40 #include "sdtreelb.hxx"
43 #define NAVSTATE_NONE 0x00000000
45 #define NAVBTN_PEN_ENABLED 0x00000010
46 #define NAVBTN_PEN_DISABLED 0x00000020
47 #define NAVBTN_PEN_CHECKED 0x00000040
48 #define NAVBTN_PEN_UNCHECKED 0x00000080
50 #define NAVTLB_UPDATE 0x00000100
52 #define NAVBTN_FIRST_ENABLED 0x00001000
53 #define NAVBTN_FIRST_DISABLED 0x00002000
54 #define NAVBTN_PREV_ENABLED 0x00004000
55 #define NAVBTN_PREV_DISABLED 0x00008000
57 #define NAVBTN_LAST_ENABLED 0x00010000
58 #define NAVBTN_LAST_DISABLED 0x00020000
59 #define NAVBTN_NEXT_ENABLED 0x00040000
60 #define NAVBTN_NEXT_DISABLED 0x00080000
65 class NavigatorChildWindow
;
69 class SdNavigatorControllerItem
;
70 class SdPageNameControllerItem
;
72 //------------------------------------------------------------------------
77 NavDocInfo() { mpDocShell
= NULL
; }
79 BOOL
HasName() { return( (BOOL
) bName
); }
80 BOOL
IsActive() { return( (BOOL
) bActive
); }
82 void SetName( BOOL bOn
= TRUE
) { bName
= bOn
; }
83 void SetActive( BOOL bOn
= TRUE
) { bActive
= bOn
; }
86 friend class SdNavigatorWin
;
89 ::sd::DrawDocShell
* mpDocShell
;
92 //------------------------------------------------------------------------
100 ::sd::NavigatorChildWindow
* pChildWinContext
,
101 const SdResId
& rSdResId
,
102 SfxBindings
* pBindings
);
103 virtual ~SdNavigatorWin();
105 virtual void KeyInput( const KeyEvent
& rKEvt
);
107 void InitTreeLB( const SdDrawDocument
* pDoc
);
108 void RefreshDocumentLB( const String
* pDocName
= NULL
);
110 BOOL
InsertFile(const String
& rFileName
);
112 NavigatorDragType
GetNavigatorDragType();
113 void SetNavigatorDragType(NavigatorDragType eType
) { meDragType
= eType
; }
116 virtual void Resize();
117 virtual long Notify(NotifyEvent
& rNEvt
);
121 friend class ::sd::NavigatorChildWindow
;
122 friend class SdNavigatorControllerItem
;
123 friend class SdPageNameControllerItem
;
126 SdPageObjsTLB maTlbObjects
;
129 ::sd::NavigatorChildWindow
* mpChildWinContext
;
132 // Size maFltWinSize;
134 String maDropFileName
;
135 NavigatorDragType meDragType
;
137 SfxBindings
* mpBindings
;
138 SdNavigatorControllerItem
* mpNavigatorCtrlItem
;
139 SdPageNameControllerItem
* mpPageNameCtrlItem
;
141 ImageList maImageList
;
142 ImageList maImageListH
;
144 /** This flag controls whether all shapes or only the named shapes are
147 bool mbShowAllShapes
;
149 USHORT
GetDragTypeSdResId( NavigatorDragType eDT
, BOOL bImage
= FALSE
);
150 NavDocInfo
* GetDocInfo();
152 DECL_LINK( GetFocusObjectsHdl
, void * );
153 DECL_LINK( SelectToolboxHdl
, void * );
154 DECL_LINK( ClickToolboxHdl
, ToolBox
* );
155 DECL_LINK( DropdownClickToolBoxHdl
, ToolBox
* );
156 DECL_LINK( ClickPageHdl
, void * );
157 DECL_LINK( ClickObjectHdl
, void * );
158 DECL_LINK( SelectDocumentHdl
, void * );
159 DECL_LINK( MenuSelectHdl
, Menu
* );
160 DECL_LINK( ShapeFilterCallback
, Menu
* );
162 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
164 void ApplyImageList();
170 /*************************************************************************
172 |* ControllerItem fuer Navigator
174 \************************************************************************/
176 class SdNavigatorControllerItem
: public SfxControllerItem
179 SdNavigatorControllerItem( USHORT
, SdNavigatorWin
*, SfxBindings
* );
182 virtual void StateChanged( USHORT nSId
, SfxItemState eState
,
183 const SfxPoolItem
* pState
);
186 SdNavigatorWin
* pNavigatorWin
;
191 /*************************************************************************
193 |* ControllerItem fuer Navigator zum Anzeigen der Seite in der TreeLB
195 \************************************************************************/
197 class SdPageNameControllerItem
: public SfxControllerItem
200 SdPageNameControllerItem( USHORT
, SdNavigatorWin
*, SfxBindings
* );
203 virtual void StateChanged( USHORT nSId
, SfxItemState eState
,
204 const SfxPoolItem
* pState
);
207 SdNavigatorWin
* pNavigatorWin
;