Update ooo320-m1
[ooovba.git] / svx / source / inc / fmexpl.hxx
blobbb008a0727e7d0e4210d0f83c3ed6c958306c4ed
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: fmexpl.hxx,v $
10 * $Revision: 1.18 $
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 ************************************************************************/
30 #ifndef _SVX_FMEXPL_HXX
31 #define _SVX_FMEXPL_HXX
33 #include <svtools/lstner.hxx>
34 #include <svtools/brdcst.hxx>
35 #include <vcl/window.hxx>
36 #include <sfx2/childwin.hxx>
37 #include <svtools/poolitem.hxx>
38 #include <sfx2/bindings.hxx>
39 #include <sfx2/dockwin.hxx>
40 #include <sfx2/ctrlitem.hxx>
41 #include <vcl/image.hxx>
42 #include <com/sun/star/container/XNameContainer.hpp>
43 #include <com/sun/star/form/XForm.hpp>
44 #include <com/sun/star/form/XFormComponent.hpp>
45 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
46 #include <com/sun/star/container/XContainerListener.hpp>
47 #include <com/sun/star/container/XContainer.hpp>
49 #include <svtools/svtreebx.hxx>
51 #include <vcl/dialog.hxx>
52 #include <vcl/group.hxx>
53 #include <vcl/button.hxx>
54 #include <vcl/fixed.hxx>
55 #include <vcl/edit.hxx>
56 #include <vcl/dockwin.hxx>
57 #include <svx/fmview.hxx>
59 #include "fmexch.hxx"
60 #include "fmtools.hxx"
62 class SdrObjListIter;
63 class FmFormShell;
64 class SdrObject;
65 class FmFormModel;
66 class FmFormView;
67 class SdrMarkList;
69 //========================================================================
70 class FmEntryData;
71 class FmNavInsertedHint : public SfxHint
73 FmEntryData* pEntryData;
74 sal_uInt32 nPos;
76 public:
77 TYPEINFO();
78 FmNavInsertedHint( FmEntryData* pInsertedEntryData, sal_uInt32 nRelPos );
79 virtual ~FmNavInsertedHint();
81 FmEntryData* GetEntryData() const { return pEntryData; }
82 sal_uInt32 GetRelPos() const { return nPos; }
85 //========================================================================
86 class FmNavModelReplacedHint : public SfxHint
88 FmEntryData* pEntryData; // die Daten des Eintrages, der ein neues Model bekommen hat
90 public:
91 TYPEINFO();
92 FmNavModelReplacedHint( FmEntryData* pAffectedEntryData );
93 virtual ~FmNavModelReplacedHint();
95 FmEntryData* GetEntryData() const { return pEntryData; }
98 //========================================================================
99 class FmNavRemovedHint : public SfxHint
101 FmEntryData* pEntryData;
103 public:
104 TYPEINFO();
105 FmNavRemovedHint( FmEntryData* pInsertedEntryData );
106 virtual ~FmNavRemovedHint();
108 FmEntryData* GetEntryData() const { return pEntryData; }
111 //========================================================================
112 class FmNavNameChangedHint : public SfxHint
114 FmEntryData* pEntryData;
115 ::rtl::OUString aNewName;
117 public:
118 TYPEINFO();
119 FmNavNameChangedHint( FmEntryData* pData, const ::rtl::OUString& rNewName );
120 virtual ~FmNavNameChangedHint();
122 FmEntryData* GetEntryData() const { return pEntryData; }
123 ::rtl::OUString GetNewName() const { return aNewName; }
126 //========================================================================
127 class FmNavClearedHint : public SfxHint
129 public:
130 TYPEINFO();
131 FmNavClearedHint();
132 virtual ~FmNavClearedHint();
135 //========================================================================
136 class FmNavViewMarksChanged : public SfxHint
138 FmFormView* pView;
139 public:
140 TYPEINFO();
141 FmNavViewMarksChanged(FmFormView* pWhichView) { pView = pWhichView; }
142 virtual ~FmNavViewMarksChanged() {}
144 FmFormView* GetAffectedView() { return pView; }
147 //========================================================================
148 class FmEntryDataList;
149 class FmEntryData
151 private:
152 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xNormalizedIFace;
153 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xProperties;
154 ::com::sun::star::uno::Reference< ::com::sun::star::container::XChild > m_xChild;
156 protected:
157 Image m_aNormalImage;
158 Image m_aHCImage;
159 ::rtl::OUString aText;
161 FmEntryDataList* pChildList;
162 FmEntryData* pParent;
164 protected:
165 void newObject( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxIFace );
167 public:
168 TYPEINFO();
170 FmEntryData( FmEntryData* pParentData, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rIFace );
171 FmEntryData( const FmEntryData& rEntryData );
172 virtual ~FmEntryData();
174 void Clear();
175 void SetText( const ::rtl::OUString& rText ){ aText = rText; }
176 void SetParent( FmEntryData* pParentData ){ pParent = pParentData; }
178 const Image& GetNormalImage() const { return m_aNormalImage; }
179 const Image& GetHCImage() const { return m_aHCImage; }
181 ::rtl::OUString GetText() const { return aText; }
182 FmEntryData* GetParent() const { return pParent; }
183 FmEntryDataList* GetChildList() const { return pChildList; }
185 virtual sal_Bool IsEqualWithoutChilds( FmEntryData* pEntryData );
186 virtual FmEntryData* Clone() = 0;
188 // note that the interface returned is normalized, i.e. querying the given XInterface of the object
189 // for XInterface must return the interface itself.
190 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& GetElement() const
192 return m_xNormalizedIFace;
195 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& GetPropertySet() const
197 return m_xProperties;
200 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XChild >& GetChildIFace() const
202 return m_xChild;
206 //========================================================================
207 DECLARE_LIST( FmEntryDataBaseList, FmEntryData* )
209 class FmEntryDataList : public FmEntryDataBaseList
211 public:
212 FmEntryDataList();
213 virtual ~FmEntryDataList();
216 //========================================================================
217 // FmNavRequestSelectHint - jemand teilt dem NavigatorTree mit, dass er bestimmte Eintraege selektieren soll
219 typedef FmEntryData* FmEntryDataPtr;
220 SV_DECL_PTRARR_SORT( FmEntryDataArray, FmEntryDataPtr, 16, 16 )
222 class FmNavRequestSelectHint : public SfxHint
224 FmEntryDataArray m_arredToSelect;
225 sal_Bool m_bMixedSelection;
226 public:
227 TYPEINFO();
228 FmNavRequestSelectHint() { }
229 virtual ~FmNavRequestSelectHint() {}
231 void SetMixedSelection(sal_Bool bMixedSelection) { m_bMixedSelection = bMixedSelection; }
232 sal_Bool IsMixedSelection() { return m_bMixedSelection; }
233 void AddItem(FmEntryData* pEntry) { m_arredToSelect.Insert(pEntry); }
234 void ClearItems() { m_arredToSelect.Remove(sal_uInt16(0), m_arredToSelect.Count()); }
235 FmEntryDataArray& GetItems() { return m_arredToSelect; }
238 //========================================================================
239 class FmFormData : public FmEntryData
241 ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm > m_xForm;
242 ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainer > m_xContainer;
244 public:
245 TYPEINFO();
247 FmFormData(
248 const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm,
249 const ImageList& _rNormalImages,
250 const ImageList& _rHCImages,
251 FmFormData* _pParent = NULL
254 FmFormData( const FmFormData& rFormData );
255 virtual ~FmFormData();
257 void SetForm( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& xForm )
259 m_xForm = xForm;
260 m_xContainer = m_xContainer.query( m_xForm );
261 newObject( m_xForm );
264 const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& GetFormIface() const { return m_xForm; }
265 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainer >& GetContainer() const { return m_xContainer; }
267 virtual sal_Bool IsEqualWithoutChilds( FmEntryData* pEntryData );
268 virtual FmEntryData* Clone();
272 //========================================================================
273 class FmControlData : public FmEntryData
275 ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent > m_xFormComponent;
277 Image GetImage(const ImageList& ilNavigatorImages) const;
279 public:
280 TYPEINFO();
282 FmControlData(
283 const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& _rxComponent,
284 const ImageList& _rNormalImages,
285 const ImageList& _rHCImages,
286 FmFormData* _pParent
288 FmControlData( const FmControlData& rControlData );
289 virtual ~FmControlData();
291 const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& GetFormComponent() const { return m_xFormComponent; }
292 virtual sal_Bool IsEqualWithoutChilds( FmEntryData* pEntryData );
293 virtual FmEntryData* Clone();
295 void ModelReplaced(
296 const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& _rxNew,
297 const ImageList& _rNormalImages,
298 const ImageList& _rHCImages
303 //========================================================================
304 //............................................................................
305 namespace svxform
307 //............................................................................
309 class NavigatorTreeModel;
310 //========================================================================
311 // class OFormComponentObserver
312 //========================================================================
313 class OFormComponentObserver
314 :public ::cppu::WeakImplHelper2 < ::com::sun::star::beans::XPropertyChangeListener
315 , ::com::sun::star::container::XContainerListener
318 ::svxform::NavigatorTreeModel* m_pNavModel;
319 sal_uInt32 m_nLocks;
320 sal_Bool m_bCanUndo;
322 public:
323 OFormComponentObserver( ::svxform::NavigatorTreeModel* pModel );
325 // XEventListenerListener
326 virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
328 // ::com::sun::star::beans::XPropertyChangeListener
329 virtual void SAL_CALL propertyChange(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
331 // ::com::sun::star::container::XContainerListener
333 virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
334 virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
335 virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
337 void Lock() { m_nLocks++; }
338 void UnLock() { m_nLocks--; }
339 sal_Bool IsLocked() const { return m_nLocks != 0; }
340 sal_Bool CanUndo() const { return m_bCanUndo; }
341 void ReleaseModel() { m_pNavModel = NULL; }
342 protected:
343 void Insert(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xIface, sal_Int32 nIndex);
344 void Remove( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxElement );
347 //========================================================================
348 //= NavigatorTreeModel
349 //========================================================================
350 class NavigatorTreeModel : public SfxBroadcaster
351 ,public SfxListener
353 friend class NavigatorTree;
354 friend class OFormComponentObserver;
356 FmEntryDataList* m_pRootList;
357 FmFormShell* m_pFormShell;
358 FmFormPage* m_pFormPage;
359 FmFormModel* m_pFormModel;
360 OFormComponentObserver* m_pPropChangeList;
362 ImageList m_aNormalImages;
363 ImageList m_aHCImages;
365 void UpdateContent( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xForms );
366 FmControlData* CreateControlData( ::com::sun::star::form::XFormComponent* pFormComponent );
368 void InsertForm(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& xForm, sal_uInt32 nRelPos);
369 void RemoveForm(FmFormData* pFormData);
371 void InsertFormComponent(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& xComp, sal_uInt32 nRelPos);
372 void RemoveFormComponent(FmControlData* pControlData);
373 void InsertSdrObj(const SdrObject* pSdrObj);
374 void RemoveSdrObj(const SdrObject* pSdrObj);
376 void ReplaceFormComponent(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& xOld, const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& xNew);
378 void BroadcastMarkedObjects(const SdrMarkList& mlMarked);
379 // einen RequestSelectHint mit den aktuell markierten Objekten broadcasten
380 sal_Bool InsertFormComponent(FmNavRequestSelectHint& rHint, SdrObject* pObject);
381 // ist ein Helper fuer vorherige, managet das Abteigen in SdrObjGroups
382 // Rueckgabe sal_True, wenn das Objekt eine FormComponent ist (oder rekursiv nur aus solchen besteht)
384 public:
385 NavigatorTreeModel( const ImageList& _rNormalImages, const ImageList& _rHCImages );
386 virtual ~NavigatorTreeModel();
388 void FillBranch( FmFormData* pParentData );
389 void ClearBranch( FmFormData* pParentData );
390 void UpdateContent( FmFormShell* pNewShell );
392 void Insert( FmEntryData* pEntryData, ULONG nRelPos = LIST_APPEND,
393 sal_Bool bAlterModel = sal_False );
394 void Remove( FmEntryData* pEntryData, sal_Bool bAlterModel = sal_False );
396 sal_Bool Rename( FmEntryData* pEntryData, const ::rtl::OUString& rNewText );
397 sal_Bool IsNameAlreadyDefined( const ::rtl::OUString& rName, FmFormData* pParentData );
398 void Clear();
399 sal_Bool CheckEntry( FmEntryData* pEntryData );
400 void SetModified( sal_Bool bMod=sal_True );
402 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > GetForms() const;
403 FmFormShell* GetFormShell() const { return m_pFormShell; }
404 FmFormPage* GetFormPage() const { return m_pFormPage; }
405 FmEntryData* FindData( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xElement, FmEntryDataList* pDataList, sal_Bool bRecurs=sal_True );
406 FmEntryData* FindData( const ::rtl::OUString& rText, FmFormData* pParentData, sal_Bool bRecurs=sal_True );
407 FmEntryDataList* GetRootList() const { return m_pRootList; }
408 ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > GetFormComponents( FmFormData* pParentFormData );
409 SdrObject* GetSdrObj( FmControlData* pControlData );
410 SdrObject* Search(SdrObjListIter& rIter, const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& xComp);
412 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
415 //========================================================================
416 typedef SvLBoxEntry* SvLBoxEntryPtr;
417 SV_DECL_PTRARR_SORT( SvLBoxEntrySortedArray, SvLBoxEntryPtr, 16, 16 )
419 class NavigatorTree : public SvTreeListBox, public SfxListener
421 enum DROP_ACTION { DA_SCROLLUP, DA_SCROLLDOWN, DA_EXPANDNODE };
422 enum SELDATA_ITEMS { SDI_DIRTY, SDI_ALL, SDI_NORMALIZED, SDI_NORMALIZED_FORMARK };
424 // beim Droppen will ich scrollen und Folder aufklappen koennen, dafuer :
425 AutoTimer m_aDropActionTimer;
426 Timer m_aSynchronizeTimer;
427 // die Meta-Daten ueber meine aktuelle Selektion
428 SvLBoxEntrySortedArray m_arrCurrentSelection;
429 // the entries which, in the view, are currently marked as "cut" (painted semi-transparent)
430 ListBoxEntrySet m_aCutEntries;
431 // die Images, die ich brauche (und an FormDatas und EntryDatas weiterreiche)
432 ImageList m_aNavigatorImages;
433 ImageList m_aNavigatorImagesHC;
435 ::svxform::OControlExchangeHelper m_aControlExchange;
437 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB;
438 NavigatorTreeModel* m_pNavModel;
439 SvLBoxEntry* m_pRootEntry;
440 SvLBoxEntry* m_pEditEntry;
442 ULONG nEditEvent;
444 SELDATA_ITEMS m_sdiState;
445 Point m_aTimerTriggered; // die Position, an der der DropTimer angeschaltet wurde
446 DROP_ACTION m_aDropActionType;
448 sal_uInt16 m_nSelectLock;
449 sal_uInt16 m_nFormsSelected;
450 sal_uInt16 m_nControlsSelected;
451 sal_uInt16 m_nHiddenControls; // (die Zahl geht in m_nControlsSelected mit ein)
453 unsigned short m_aTimerCounter;
455 sal_Bool m_bDragDataDirty : 1; // dito
456 sal_Bool m_bPrevSelectionMixed : 1;
457 sal_Bool m_bMarkingObjects : 1; // wenn das sal_True ist, brauche ich auf die RequestSelectHints nicht reagieren
458 sal_Bool m_bRootSelected : 1;
459 sal_Bool m_bInitialUpdate : 1; // bin ich das erste Mal im UpdateContent ?
460 sal_Bool m_bKeyboardCut : 1;
463 void UpdateContent();
464 sal_Bool IsDeleteAllowed();
465 FmControlData* NewControl( const ::rtl::OUString& rServiceName, SvLBoxEntry* pParentEntry, sal_Bool bEditName = sal_True );
466 void NewForm( SvLBoxEntry* pParentEntry );
467 SvLBoxEntry* Insert( FmEntryData* pEntryData, ULONG nRelPos=LIST_APPEND );
468 void Remove( FmEntryData* pEntryData );
471 void CollectSelectionData(SELDATA_ITEMS sdiHow);
472 // sammelt in m_arrCurrentSelection die aktuell selektierten Eintraege, normalisiert die Liste wenn verlangt
473 // SDI_NORMALIZED bedeutet einfach, dass alle Eintraege, die schon einen selektierten Vorfahren haben, nicht mit gesammelt
474 // werden.
475 // SDI_NORMALIZED_FORMARK bedeutet, dass wie bei SDI_NORMALIZED verfahren wird, aber Eintraege, deren direktes Elter nicht
476 // selektiert ist, aufgenommen werden (unabhaengig vom Status weiterer Vorfahren), desgleichen Formulare, die selektiert sind,
477 // unabhaengig vom Status irgendwelcher Vorfahren
478 // Bei beiden Normalized-Modi enthalten die m_nFormsSelected, ... die richtige Anzahl, auch wenn nicht alle dieser Eintraege
479 // in m_arrCurrentSelection landen.
480 // SDI_DIRTY ist natuerlich nicht erlaubt als Parameter
482 // ein einziges Interface fuer alle selektierten Eintraege zusammensetzen
483 void ShowSelectionProperties(sal_Bool bForce = sal_False);
484 // alle selektierten Elemnte loeschen
485 void DeleteSelection();
487 void SynchronizeSelection(FmEntryDataArray& arredToSelect);
488 // nach dem Aufruf dieser Methode sind genau die Eintraege selektiert, die in dem Array bezeichnet sind
489 void SynchronizeSelection();
490 // macht das selbe, nimmt die MarkList der ::com::sun::star::sdbcx::View
491 void SynchronizeMarkList();
492 // umgekehrte Richtung von SynchronizeMarkList : markiert in der ::com::sun::star::sdbcx::View alle der aktuellen Selektion entsprechenden Controls
494 void CollectObjects(FmFormData* pFormData, sal_Bool bDeep, ::std::set< ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent > >& _rObjects);
496 // im Select aktualisiere ich normalerweise die Marklist der zugehoerigen ::com::sun::star::sdbcx::View, mit folgenden Funktionen
497 // kann ich das Locking dieses Verhaltens steuern
498 void LockSelectionHandling() { ++m_nSelectLock; }
499 void UnlockSelectionHandling() { --m_nSelectLock; }
500 sal_Bool IsSelectionHandlingLocked() const { return m_nSelectLock>0; }
502 sal_Bool IsHiddenControl(FmEntryData* pEntryData);
504 DECL_LINK( OnEdit, void* );
505 DECL_LINK( OnDropActionTimer, void* );
507 DECL_LINK(OnEntrySelDesel, NavigatorTree*);
508 DECL_LINK(OnSynchronizeTimer, void*);
510 DECL_LINK( OnClipboardAction, void* );
512 protected:
513 virtual void Command( const CommandEvent& rEvt );
515 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
516 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
517 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
519 public:
520 NavigatorTree(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB, Window* pParent );
521 virtual ~NavigatorTree();
523 void Clear();
524 void UpdateContent( FmFormShell* pFormShell );
525 void MarkViewObj( FmFormData* pFormData, sal_Bool bMark, sal_Bool bDeep = sal_False );
526 void MarkViewObj( FmControlData* pControlData, sal_Bool bMarkHandles, sal_Bool bMark );
527 void UnmarkAllViewObj();
529 sal_Bool IsFormEntry( SvLBoxEntry* pEntry );
530 sal_Bool IsFormComponentEntry( SvLBoxEntry* pEntry );
532 ::rtl::OUString GenerateName( FmEntryData* pEntryData );
534 NavigatorTreeModel* GetNavModel() const { return m_pNavModel; }
535 SvLBoxEntry* FindEntry( FmEntryData* pEntryData );
537 virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
538 virtual sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True );
539 virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& );
540 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
541 virtual void KeyInput( const KeyEvent& rKEvt );
543 virtual void ModelHasRemoved( SvListEntry* _pEntry );
545 using SvTreeListBox::Insert;
546 using SvTreeListBox::ExecuteDrop;
547 using SvTreeListBox::Select;
548 using SvTreeListBox::Notify;
550 private:
551 sal_Int8 implAcceptDataTransfer( const DataFlavorExVector& _rFlavors, sal_Int8 _nAction, const Point& _rDropPos, sal_Bool _bDnD );
552 sal_Int8 implAcceptDataTransfer( const DataFlavorExVector& _rFlavors, sal_Int8 _nAction, SvLBoxEntry* _pTargetEntry, sal_Bool _bDnD );
554 sal_Int8 implExecuteDataTransfer( const OControlTransferData& _rData, sal_Int8 _nAction, const Point& _rDropPos, sal_Bool _bDnD );
555 sal_Int8 implExecuteDataTransfer( const OControlTransferData& _rData, sal_Int8 _nAction, SvLBoxEntry* _pTargetEntry, sal_Bool _bDnD );
557 // check if a cut, copy, or drag operation can be started in the current situation
558 sal_Bool implAllowExchange( sal_Int8 _nAction, sal_Bool* _pHasNonHidden = NULL );
559 // check if a paste with the current clipboard content can be accepted
560 sal_Bool implAcceptPaste( );
562 // fills m_aControlExchange in preparation of a DnD or clipboard operation
563 sal_Bool implPrepareExchange( sal_Int8 _nAction );
565 void doPaste();
566 void doCopy();
567 void doCut();
569 sal_Bool doingKeyboardCut( ) const { return m_bKeyboardCut; }
572 //========================================================================
573 class NavigatorFrame : public SfxDockingWindow, public SfxControllerItem
575 private:
576 ::svxform::NavigatorTree* m_pNavigatorTree;
578 protected:
579 virtual void Resize();
580 virtual sal_Bool Close();
581 virtual void GetFocus();
582 virtual Size CalcDockingSize( SfxChildAlignment );
583 virtual SfxChildAlignment CheckAlignment( SfxChildAlignment, SfxChildAlignment );
585 using SfxDockingWindow::StateChanged;
587 public:
588 NavigatorFrame( SfxBindings *pBindings, SfxChildWindow *pMgr,
589 Window* pParent );
590 virtual ~NavigatorFrame();
592 void UpdateContent( FmFormShell* pFormShell );
593 void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
594 void FillInfo( SfxChildWinInfo& rInfo ) const;
597 //========================================================================
598 class SVX_DLLPUBLIC NavigatorFrameManager : public SfxChildWindow
600 public:
601 SVX_DLLPRIVATE NavigatorFrameManager( Window *pParent, sal_uInt16 nId, SfxBindings *pBindings,
602 SfxChildWinInfo *pInfo );
603 SFX_DECL_CHILDWINDOW( NavigatorFrameManager );
606 //............................................................................
607 } // namespace svxform
608 //............................................................................
610 #endif // _SVX_FMEXPL_HXX