merge the formfield patch from ooo-build
[ooovba.git] / sd / source / ui / inc / navigatr.hxx
blobc05ed7396a62f1891506b582e2db780d81f925f8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: navigatr.hxx,v $
10 * $Revision: 1.15 $
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>
38 #endif
39 #include <sfx2/ctrlitem.hxx>
40 #include "sdtreelb.hxx"
41 #include "pres.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
62 // forward
63 namespace sd {
64 class DrawDocShell;
65 class NavigatorChildWindow;
66 class View;
68 class Menu;
69 class SdNavigatorControllerItem;
70 class SdPageNameControllerItem;
72 //------------------------------------------------------------------------
74 class NavDocInfo
76 public:
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; }
85 private:
86 friend class SdNavigatorWin;
87 BOOL bName : 1;
88 BOOL bActive : 1;
89 ::sd::DrawDocShell* mpDocShell;
92 //------------------------------------------------------------------------
94 class SdNavigatorWin
95 : public Window
97 public:
98 SdNavigatorWin(
99 ::Window* pParent,
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; }
115 protected:
116 virtual void Resize();
117 virtual long Notify(NotifyEvent& rNEvt);
120 private:
121 friend class ::sd::NavigatorChildWindow;
122 friend class SdNavigatorControllerItem;
123 friend class SdPageNameControllerItem;
125 ToolBox maToolbox;
126 SdPageObjsTLB maTlbObjects;
127 ListBox maLbDocs;
129 ::sd::NavigatorChildWindow* mpChildWinContext;
130 Size maSize;
131 Size maMinSize;
132 // Size maFltWinSize;
133 BOOL mbDocImported;
134 String maDropFileName;
135 NavigatorDragType meDragType;
136 List* mpDocList;
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
145 shown.
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 );
163 void SetDragImage();
164 void ApplyImageList();
170 /*************************************************************************
172 |* ControllerItem fuer Navigator
174 \************************************************************************/
176 class SdNavigatorControllerItem : public SfxControllerItem
178 public:
179 SdNavigatorControllerItem( USHORT, SdNavigatorWin*, SfxBindings* );
181 protected:
182 virtual void StateChanged( USHORT nSId, SfxItemState eState,
183 const SfxPoolItem* pState );
185 private:
186 SdNavigatorWin* pNavigatorWin;
191 /*************************************************************************
193 |* ControllerItem fuer Navigator zum Anzeigen der Seite in der TreeLB
195 \************************************************************************/
197 class SdPageNameControllerItem : public SfxControllerItem
199 public:
200 SdPageNameControllerItem( USHORT, SdNavigatorWin*, SfxBindings* );
202 protected:
203 virtual void StateChanged( USHORT nSId, SfxItemState eState,
204 const SfxPoolItem* pState );
206 private:
207 SdNavigatorWin* pNavigatorWin;
210 #endif