xref: /trunk/main/svx/source/inc/fmexpl.hxx (revision 0bd9e355e13b620bef19e582b9cfda5857deb292)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef _SVX_FMEXPL_HXX
23 #define _SVX_FMEXPL_HXX
24 
25 #include <svl/lstner.hxx>
26 #include <svl/brdcst.hxx>
27 #include <vcl/window.hxx>
28 #include <sfx2/childwin.hxx>
29 #include <svl/poolitem.hxx>
30 #include <sfx2/bindings.hxx>
31 #include <sfx2/dockwin.hxx>
32 #include <sfx2/ctrlitem.hxx>
33 #include <vcl/image.hxx>
34 
35 /** === begin UNO includes === **/
36 #include <com/sun/star/container/XNameContainer.hpp>
37 #include <com/sun/star/form/XForm.hpp>
38 #include <com/sun/star/form/XFormComponent.hpp>
39 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
40 #include <com/sun/star/container/XContainerListener.hpp>
41 #include <com/sun/star/container/XContainer.hpp>
42 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
43 #include <com/sun/star/container/XIndexContainer.hpp>
44 /** === end UNO includes === **/
45 
46 #include <svtools/svtreebx.hxx>
47 
48 #include <vcl/dialog.hxx>
49 #include <vcl/group.hxx>
50 #include <vcl/button.hxx>
51 #include <vcl/fixed.hxx>
52 #include <vcl/edit.hxx>
53 #include <vcl/dockwin.hxx>
54 #include <svx/fmview.hxx>
55 
56 #include "fmexch.hxx"
57 
58 class SdrObjListIter;
59 class FmFormShell;
60 class SdrObject;
61 class FmFormModel;
62 class FmFormView;
63 class SdrMarkList;
64 
65 //========================================================================
66 class FmEntryData;
67 class FmNavInsertedHint : public SfxHint
68 {
69     FmEntryData* pEntryData;
70     sal_uInt32 nPos;
71 
72 public:
73     TYPEINFO();
74     FmNavInsertedHint( FmEntryData* pInsertedEntryData, sal_uInt32 nRelPos );
75     virtual ~FmNavInsertedHint();
76 
GetEntryData() const77     FmEntryData* GetEntryData() const { return pEntryData; }
GetRelPos() const78     sal_uInt32 GetRelPos() const { return nPos; }
79 };
80 
81 //========================================================================
82 class FmNavModelReplacedHint : public SfxHint
83 {
84     FmEntryData* pEntryData; // die Daten des Eintrages, der ein neues Model bekommen hat
85 
86 public:
87     TYPEINFO();
88     FmNavModelReplacedHint( FmEntryData* pAffectedEntryData );
89     virtual ~FmNavModelReplacedHint();
90 
GetEntryData() const91     FmEntryData* GetEntryData() const { return pEntryData; }
92 };
93 
94 //========================================================================
95 class FmNavRemovedHint : public SfxHint
96 {
97     FmEntryData* pEntryData;
98 
99 public:
100     TYPEINFO();
101     FmNavRemovedHint( FmEntryData* pInsertedEntryData );
102     virtual ~FmNavRemovedHint();
103 
GetEntryData() const104     FmEntryData* GetEntryData() const { return pEntryData; }
105 };
106 
107 //========================================================================
108 class FmNavNameChangedHint : public SfxHint
109 {
110     FmEntryData*    pEntryData;
111     ::rtl::OUString          aNewName;
112 
113 public:
114     TYPEINFO();
115     FmNavNameChangedHint( FmEntryData* pData, const ::rtl::OUString& rNewName );
116     virtual ~FmNavNameChangedHint();
117 
GetEntryData() const118     FmEntryData*    GetEntryData() const { return pEntryData; }
GetNewName() const119     ::rtl::OUString          GetNewName() const { return aNewName; }
120 };
121 
122 //========================================================================
123 class FmNavClearedHint : public SfxHint
124 {
125 public:
126     TYPEINFO();
127     FmNavClearedHint();
128     virtual ~FmNavClearedHint();
129 };
130 
131 //========================================================================
132 class FmNavViewMarksChanged : public SfxHint
133 {
134     FmFormView* pView;
135 public:
136     TYPEINFO();
FmNavViewMarksChanged(FmFormView * pWhichView)137     FmNavViewMarksChanged(FmFormView* pWhichView) { pView = pWhichView; }
~FmNavViewMarksChanged()138     virtual ~FmNavViewMarksChanged() {}
139 
GetAffectedView()140     FmFormView* GetAffectedView() { return pView; }
141 };
142 
143 //========================================================================
144 class FmEntryDataList;
145 class FmEntryData
146 {
147 private:
148     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >       m_xNormalizedIFace;
149     ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >   m_xProperties;
150     ::com::sun::star::uno::Reference< ::com::sun::star::container::XChild >     m_xChild;
151 
152 protected:
153     Image               m_aNormalImage;
154     Image               m_aHCImage;
155     ::rtl::OUString     aText;
156 
157     FmEntryDataList*    pChildList;
158     FmEntryData*        pParent;
159 
160 protected:
161     void    newObject( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxIFace );
162 
163 public:
164     TYPEINFO();
165 
166     FmEntryData( FmEntryData* pParentData, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rIFace );
167     FmEntryData( const FmEntryData& rEntryData );
168     virtual ~FmEntryData();
169 
170     void    Clear();
SetText(const::rtl::OUString & rText)171     void    SetText( const ::rtl::OUString& rText ){ aText = rText; }
SetParent(FmEntryData * pParentData)172     void    SetParent( FmEntryData* pParentData ){ pParent = pParentData; }
173 
GetNormalImage() const174     const Image&    GetNormalImage() const { return m_aNormalImage; }
GetHCImage() const175     const Image&    GetHCImage() const { return m_aHCImage; }
176 
GetText() const177     ::rtl::OUString          GetText() const { return aText; }
GetParent() const178     FmEntryData*    GetParent() const { return pParent; }
GetChildList() const179     FmEntryDataList* GetChildList() const { return pChildList; }
180 
181     virtual sal_Bool IsEqualWithoutChilds( FmEntryData* pEntryData );
182     virtual FmEntryData* Clone() = 0;
183 
184     // note that the interface returned is normalized, i.e. querying the given XInterface of the object
185     // for XInterface must return the interface itself.
GetElement() const186     const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& GetElement() const
187     {
188         return m_xNormalizedIFace;
189     }
190 
GetPropertySet() const191     const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& GetPropertySet() const
192     {
193         return m_xProperties;
194     }
195 
GetChildIFace() const196     const ::com::sun::star::uno::Reference< ::com::sun::star::container::XChild >& GetChildIFace() const
197     {
198         return m_xChild;
199     }
200 };
201 
202 //========================================================================
203 DECLARE_LIST( FmEntryDataBaseList, FmEntryData* )
204 
205 class FmEntryDataList : public FmEntryDataBaseList
206 {
207 public:
208     FmEntryDataList();
209     virtual ~FmEntryDataList();
210 };
211 
212 //========================================================================
213 // FmNavRequestSelectHint - jemand teilt dem NavigatorTree mit, dass er bestimmte Einträge selektieren soll
214 
215 typedef FmEntryData* FmEntryDataPtr;
216 SV_DECL_PTRARR_SORT( FmEntryDataArray, FmEntryDataPtr, 16, 16 )
217 
218 class FmNavRequestSelectHint : public SfxHint
219 {
220     FmEntryDataArray    m_arredToSelect;
221     sal_Bool                m_bMixedSelection;
222 public:
223     TYPEINFO();
FmNavRequestSelectHint()224     FmNavRequestSelectHint() { }
~FmNavRequestSelectHint()225     virtual ~FmNavRequestSelectHint() {}
226 
SetMixedSelection(sal_Bool bMixedSelection)227     void SetMixedSelection(sal_Bool bMixedSelection) { m_bMixedSelection = bMixedSelection; }
IsMixedSelection()228     sal_Bool IsMixedSelection() { return m_bMixedSelection; }
AddItem(FmEntryData * pEntry)229     void AddItem(FmEntryData* pEntry) { m_arredToSelect.Insert(pEntry); }
ClearItems()230     void ClearItems() { m_arredToSelect.Remove(sal_uInt16(0), m_arredToSelect.Count()); }
GetItems()231     FmEntryDataArray& GetItems() { return m_arredToSelect; }
232 };
233 
234 //========================================================================
235 class FmFormData : public FmEntryData
236 {
237     ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >           m_xForm;
238     ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainer > m_xContainer;
239 
240 public:
241     TYPEINFO();
242 
243     FmFormData(
244         const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm,
245         const ImageList& _rNormalImages,
246         const ImageList& _rHCImages,
247         FmFormData* _pParent = NULL
248     );
249 
250     FmFormData( const FmFormData& rFormData );
251     virtual ~FmFormData();
252 
SetForm(const::com::sun::star::uno::Reference<::com::sun::star::form::XForm> & xForm)253     void SetForm( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& xForm )
254     {
255         m_xForm = xForm;
256         m_xContainer = m_xContainer.query( m_xForm );
257         newObject( m_xForm );
258     }
259 
GetFormIface() const260     const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& GetFormIface() const { return m_xForm; }
GetContainer() const261     const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainer >& GetContainer() const { return m_xContainer; }
262 
263     virtual sal_Bool IsEqualWithoutChilds( FmEntryData* pEntryData );
264     virtual FmEntryData* Clone();
265 };
266 
267 //========================================================================
268 class FmControlData : public FmEntryData
269 {
270     ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >  m_xFormComponent;
271 
272     Image GetImage(const ImageList& ilNavigatorImages) const;
273 
274 public:
275     TYPEINFO();
276 
277     FmControlData(
278         const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& _rxComponent,
279         const ImageList& _rNormalImages,
280         const ImageList& _rHCImages,
281         FmFormData* _pParent
282     );
283     FmControlData( const FmControlData& rControlData );
284     virtual ~FmControlData();
285 
GetFormComponent() const286     const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& GetFormComponent() const { return m_xFormComponent; }
287     virtual sal_Bool IsEqualWithoutChilds( FmEntryData* pEntryData );
288     virtual FmEntryData* Clone();
289 
290     void ModelReplaced(
291         const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& _rxNew,
292         const ImageList& _rNormalImages,
293         const ImageList& _rHCImages
294     );
295 };
296 
297 //========================================================================
298 //............................................................................
299 namespace svxform
300 {
301 //............................................................................
302 
303     class NavigatorTreeModel;
304     //========================================================================
305     // class OFormComponentObserver
306     //========================================================================
307     class OFormComponentObserver
308         :public ::cppu::WeakImplHelper2 <   ::com::sun::star::beans::XPropertyChangeListener
309                                         ,   ::com::sun::star::container::XContainerListener
310                                         >
311     {
312         ::svxform::NavigatorTreeModel*  m_pNavModel;
313         sal_uInt32 m_nLocks;
314         sal_Bool   m_bCanUndo;
315 
316     public:
317         OFormComponentObserver( ::svxform::NavigatorTreeModel* pModel );
318 
319     // XEventListenerListener
320         virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
321 
322     // ::com::sun::star::beans::XPropertyChangeListener
323         virtual void SAL_CALL propertyChange(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
324 
325     // ::com::sun::star::container::XContainerListener
326 
327         virtual void SAL_CALL elementInserted(const  ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
328         virtual void SAL_CALL elementReplaced(const  ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
329         virtual void SAL_CALL elementRemoved(const  ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
330 
Lock()331         void Lock() { m_nLocks++; }
UnLock()332         void UnLock() { m_nLocks--; }
IsLocked() const333         sal_Bool IsLocked() const { return m_nLocks != 0; }
CanUndo() const334         sal_Bool CanUndo() const { return m_bCanUndo; }
ReleaseModel()335         void ReleaseModel() { m_pNavModel = NULL; }
336     protected:
337         void Insert(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xIface, sal_Int32 nIndex);
338         void Remove( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxElement );
339     };
340 
341     //========================================================================
342     //= NavigatorTreeModel
343     //========================================================================
344     class NavigatorTreeModel : public SfxBroadcaster
345                            ,public SfxListener
346     {
347         friend class NavigatorTree;
348         friend class OFormComponentObserver;
349 
350         FmEntryDataList*            m_pRootList;
351         FmFormShell*                m_pFormShell;
352         FmFormPage*                 m_pFormPage;
353         FmFormModel*                m_pFormModel;
354         OFormComponentObserver*     m_pPropChangeList;
355 
356         ImageList                   m_aNormalImages;
357         ImageList                   m_aHCImages;
358 
359         void UpdateContent( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xForms );
360         FmControlData* CreateControlData( ::com::sun::star::form::XFormComponent* pFormComponent );
361 
362         void InsertForm(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& xForm, sal_uInt32 nRelPos);
363         void RemoveForm(FmFormData* pFormData);
364 
365         void InsertFormComponent(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& xComp, sal_uInt32 nRelPos);
366         void RemoveFormComponent(FmControlData* pControlData);
367         void InsertSdrObj(const SdrObject* pSdrObj);
368         void RemoveSdrObj(const SdrObject* pSdrObj);
369 
370         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);
371 
372         void BroadcastMarkedObjects(const SdrMarkList& mlMarked);
373             // einen RequestSelectHint mit den aktuell markierten Objekten broadcasten
374         sal_Bool InsertFormComponent(FmNavRequestSelectHint& rHint, SdrObject* pObject);
375             // ist ein Helper für vorherige, managet das Absteigen in SdrObjGroups
376             // Rückgabe sal_True, wenn das Objekt eine FormComponent ist (oder rekursiv nur aus solchen besteht)
377 
378     public:
379         NavigatorTreeModel( const ImageList& _rNormalImages, const ImageList& _rHCImages );
380         virtual ~NavigatorTreeModel();
381 
382         void FillBranch( FmFormData* pParentData );
383         void ClearBranch( FmFormData* pParentData );
384         void UpdateContent( FmFormShell* pNewShell );
385 
386         void Insert( FmEntryData* pEntryData, sal_uLong nRelPos = LIST_APPEND,
387                                               sal_Bool bAlterModel = sal_False );
388         void Remove( FmEntryData* pEntryData, sal_Bool bAlterModel = sal_False );
389 
390         sal_Bool Rename( FmEntryData* pEntryData, const ::rtl::OUString& rNewText );
391         sal_Bool IsNameAlreadyDefined( const ::rtl::OUString& rName, FmFormData* pParentData );
392         void Clear();
393         sal_Bool CheckEntry( FmEntryData* pEntryData );
394         void SetModified( sal_Bool bMod=sal_True );
395 
396         ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >    GetForms() const;
GetFormShell() const397         FmFormShell*        GetFormShell() const { return m_pFormShell; }
GetFormPage() const398         FmFormPage*         GetFormPage() const { return m_pFormPage; }
399         FmEntryData*        FindData( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xElement, FmEntryDataList* pDataList, sal_Bool bRecurs=sal_True );
400         FmEntryData*        FindData( const ::rtl::OUString& rText, FmFormData* pParentData, sal_Bool bRecurs=sal_True );
GetRootList() const401         FmEntryDataList*    GetRootList() const { return m_pRootList; }
402         ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >   GetFormComponents( FmFormData* pParentFormData );
403         SdrObject*          GetSdrObj( FmControlData* pControlData );
404         SdrObject*          Search(SdrObjListIter& rIter, const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& xComp);
405 
406         virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
407     };
408 
409     //========================================================================
410     typedef SvLBoxEntry* SvLBoxEntryPtr;
411     SV_DECL_PTRARR_SORT( SvLBoxEntrySortedArray, SvLBoxEntryPtr, 16, 16 )
412 
413     class NavigatorTree : public SvTreeListBox, public SfxListener
414     {
415         enum DROP_ACTION        { DA_SCROLLUP, DA_SCROLLDOWN, DA_EXPANDNODE };
416         enum SELDATA_ITEMS      { SDI_DIRTY, SDI_ALL, SDI_NORMALIZED, SDI_NORMALIZED_FORMARK };
417 
418         // beim Droppen will ich scrollen und Folder aufklappen können, dafür :
419         AutoTimer           m_aDropActionTimer;
420         Timer               m_aSynchronizeTimer;
421         // die Meta-Daten über meine aktuelle Selektion
422         SvLBoxEntrySortedArray  m_arrCurrentSelection;
423         // the entries which, in the view, are currently marked as "cut" (painted semi-transparent)
424         ListBoxEntrySet         m_aCutEntries;
425         // die Images, die ich brauche (und an FormDatas und EntryDatas weiterreiche)
426         ImageList           m_aNavigatorImages;
427         ImageList           m_aNavigatorImagesHC;
428 
429         ::svxform::OControlExchangeHelper   m_aControlExchange;
430 
431         ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >    m_xORB;
432         NavigatorTreeModel* m_pNavModel;
433         SvLBoxEntry*        m_pRootEntry;
434         SvLBoxEntry*        m_pEditEntry;
435 
436         sal_uLong               nEditEvent;
437 
438         SELDATA_ITEMS       m_sdiState;
439         Point               m_aTimerTriggered; // die Position, an der der DropTimer angeschaltet wurde
440         DROP_ACTION         m_aDropActionType;
441 
442         sal_uInt16          m_nSelectLock;
443         sal_uInt16          m_nFormsSelected;
444         sal_uInt16          m_nControlsSelected;
445         sal_uInt16          m_nHiddenControls; // (die Zahl geht in m_nControlsSelected mit ein)
446 
447         unsigned short      m_aTimerCounter;
448 
449         sal_Bool            m_bDragDataDirty        : 1; // dito
450         sal_Bool            m_bPrevSelectionMixed   : 1;
451         sal_Bool            m_bMarkingObjects       : 1; // wenn das sal_True ist, brauche ich auf die RequestSelectHints nicht reagieren
452         sal_Bool            m_bRootSelected         : 1;
453         sal_Bool            m_bInitialUpdate        : 1; // bin ich das erste Mal im UpdateContent ?
454         sal_Bool            m_bKeyboardCut          : 1;
455 
456         void            UpdateContent();
457         sal_Bool        IsDeleteAllowed();
458         FmControlData*  NewControl( const ::rtl::OUString& rServiceName, SvLBoxEntry* pParentEntry, sal_Bool bEditName = sal_True );
459         void            NewForm( SvLBoxEntry* pParentEntry );
460         SvLBoxEntry*    Insert( FmEntryData* pEntryData, sal_uLong nRelPos=LIST_APPEND );
461         void            Remove( FmEntryData* pEntryData );
462 
463         void CollectSelectionData(SELDATA_ITEMS sdiHow);
464             // sammelt in m_arrCurrentSelection die aktuell selektierten Einträge, normalisiert die Liste wenn verlangt
465             // SDI_NORMALIZED bedeutet einfach, dass alle Einträge, die schon einen selektierten Vorfahren haben, nicht mit gesammelt
466             // werden.
467             // SDI_NORMALIZED_FORMARK bedeutet, dass wie bei SDI_NORMALIZED verfahren wird, aber Einträge, deren direktes Elter nicht
468             // selektiert ist, aufgenommen werden (unabhängig vom Status weiterer Vorfahren), desgleichen Formulare, die selektiert sind,
469             // unabhängig vom Status irgendwelcher Vorfahren
470             // Bei beiden Normalized-Modi enthalten die m_nFormsSelected, ... die richtige Anzahl, auch wenn nicht alle dieser Einträge
471             // in m_arrCurrentSelection landen.
472             // SDI_DIRTY ist natürlich nicht erlaubt als Parameter
473 
474         // ein einziges Interface für alle selektierten Einträge zusammensetzen
475         void    ShowSelectionProperties(sal_Bool bForce = sal_False);
476         // alle selektierten Elemente löschen
477         void    DeleteSelection();
478 
479         void SynchronizeSelection(FmEntryDataArray& arredToSelect);
480             // nach dem Aufruf dieser Methode sind genau die Einträge selektiert, die in dem Array bezeichnet sind
481         void SynchronizeSelection();
482             // macht das selbe, nimmt die MarkList der ::com::sun::star::sdbcx::View
483         void SynchronizeMarkList();
484             // umgekehrte Richtung von SynchronizeMarkList : markiert in der ::com::sun::star::sdbcx::View alle der aktuellen Selektion entsprechenden Controls
485 
486         void CollectObjects(FmFormData* pFormData, sal_Bool bDeep, ::std::set< ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent > >& _rObjects);
487 
488         // im Select aktualisiere ich normalerweise die Marklist der zugehörigen ::com::sun::star::sdbcx::View, mit folgenden Funktionen
489         // kann ich das Locking dieses Verhaltens steuern
LockSelectionHandling()490         void LockSelectionHandling() { ++m_nSelectLock; }
UnlockSelectionHandling()491         void UnlockSelectionHandling() { --m_nSelectLock; }
IsSelectionHandlingLocked() const492         sal_Bool IsSelectionHandlingLocked() const { return m_nSelectLock>0; }
493 
494         sal_Bool IsHiddenControl(FmEntryData* pEntryData);
495 
496         DECL_LINK( OnEdit, void* );
497         DECL_LINK( OnDropActionTimer, void* );
498 
499         DECL_LINK(OnEntrySelDesel, NavigatorTree*);
500         DECL_LINK(OnSynchronizeTimer, void*);
501 
502         DECL_LINK( OnClipboardAction, void* );
503 
504     protected:
505         virtual void    Command( const CommandEvent& rEvt );
506 
507         virtual sal_Int8    AcceptDrop( const AcceptDropEvent& rEvt );
508         virtual sal_Int8    ExecuteDrop( const ExecuteDropEvent& rEvt );
509         virtual void        StartDrag( sal_Int8 nAction, const Point& rPosPixel );
510 
511     public:
512         NavigatorTree(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&   _xORB, Window* pParent );
513         virtual ~NavigatorTree();
514 
515         void Clear();
516         void UpdateContent( FmFormShell* pFormShell );
517         void MarkViewObj( FmFormData* pFormData, sal_Bool bMark, sal_Bool bDeep = sal_False );
518         void MarkViewObj( FmControlData* pControlData, sal_Bool bMarkHandles, sal_Bool bMark );
519         void UnmarkAllViewObj();
520 
521         sal_Bool IsFormEntry( SvLBoxEntry* pEntry );
522         sal_Bool IsFormComponentEntry( SvLBoxEntry* pEntry );
523 
524         ::rtl::OUString GenerateName( FmEntryData* pEntryData );
525 
GetNavModel() const526         NavigatorTreeModel*    GetNavModel() const { return m_pNavModel; }
527         SvLBoxEntry*        FindEntry( FmEntryData* pEntryData );
528 
529         virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
530         virtual sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True );
531         virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& );
532         virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
533         virtual void KeyInput( const KeyEvent& rKEvt );
534 
535         virtual void ModelHasRemoved( SvListEntry* _pEntry );
536 
537         using SvTreeListBox::Insert;
538         using SvTreeListBox::ExecuteDrop;
539         using SvTreeListBox::Select;
540         using SvTreeListBox::Notify;
541 
542     private:
543         sal_Int8    implAcceptDataTransfer( const DataFlavorExVector& _rFlavors, sal_Int8 _nAction, const Point& _rDropPos, sal_Bool _bDnD );
544         sal_Int8    implAcceptDataTransfer( const DataFlavorExVector& _rFlavors, sal_Int8 _nAction, SvLBoxEntry* _pTargetEntry, sal_Bool _bDnD );
545 
546         sal_Int8    implExecuteDataTransfer( const OControlTransferData& _rData, sal_Int8 _nAction, const Point& _rDropPos, sal_Bool _bDnD );
547         sal_Int8    implExecuteDataTransfer( const OControlTransferData& _rData, sal_Int8 _nAction, SvLBoxEntry* _pTargetEntry, sal_Bool _bDnD );
548 
549         // check if a cut, copy, or drag operation can be started in the current situation
550         sal_Bool    implAllowExchange( sal_Int8 _nAction, sal_Bool* _pHasNonHidden = NULL );
551         // check if a paste with the current clipboard content can be accepted
552         sal_Bool    implAcceptPaste( );
553 
554         // fills m_aControlExchange in preparation of a DnD or clipboard operation
555         sal_Bool    implPrepareExchange( sal_Int8 _nAction );
556 
557         void        doPaste();
558         void        doCopy();
559         void        doCut();
560 
doingKeyboardCut() const561         sal_Bool    doingKeyboardCut( ) const { return m_bKeyboardCut; }
562     };
563 
564     //========================================================================
565     class NavigatorFrame : public SfxDockingWindow, public SfxControllerItem
566     {
567     private:
568         ::svxform::NavigatorTree* m_pNavigatorTree;
569 
570     protected:
571         virtual void Resize();
572         virtual sal_Bool Close();
573         virtual void GetFocus();
574         virtual Size CalcDockingSize( SfxChildAlignment );
575         virtual SfxChildAlignment CheckAlignment( SfxChildAlignment, SfxChildAlignment );
576 
577         using SfxDockingWindow::StateChanged;
578 
579     public:
580         NavigatorFrame( SfxBindings *pBindings, SfxChildWindow *pMgr,
581                        Window* pParent );
582         virtual ~NavigatorFrame();
583 
584         void UpdateContent( FmFormShell* pFormShell );
585         void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
586         void FillInfo( SfxChildWinInfo& rInfo ) const;
587     };
588 
589     //========================================================================
590     class SVX_DLLPUBLIC NavigatorFrameManager : public SfxChildWindow
591     {
592     public:
593         SVX_DLLPRIVATE NavigatorFrameManager( Window *pParent, sal_uInt16 nId, SfxBindings *pBindings,
594                           SfxChildWinInfo *pInfo );
595         SFX_DECL_CHILDWINDOW( NavigatorFrameManager );
596     };
597 
598 //............................................................................
599 }   // namespace svxform
600 //............................................................................
601 
602 #endif // _SVX_FMEXPL_HXX
603 
604 /* vim: set noet sw=4 ts=4: */
605