merged tag ooo/DEV300_m102
[LibreOffice.git] / sfx2 / inc / docvor.hxx
blob9e252123348b66f13af84b4a4c00ebc631477e07
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef _SFXDOCVOR_HXX
28 #define _SFXDOCVOR_HXX
31 #ifndef _DIALOG_HXX //autogen
32 #include <vcl/dialog.hxx>
33 #endif
34 #include <svtools/svtreebx.hxx>
36 #include <sfx2/objsh.hxx>
37 #include "orgmgr.hxx"
39 //=========================================================================
41 class SfxDocumentTemplates;
42 class Path;
44 //=========================================================================
46 #ifndef _SFX_HXX
48 class SfxOrganizeDlg_Impl;
50 class SfxOrganizeListBox_Impl : public SvTreeListBox
52 enum BMPTYPE { BMPTYPE_FOLDER, BMPTYPE_DOC };
54 friend class SfxOrganizeDlg_Impl;
56 Image aOpenedFolderBmp;
57 Image aClosedFolderBmp;
58 Image aOpenedDocBmp;
59 Image aClosedDocBmp;
61 Image aOpenedFolderBmpHC;
62 Image aClosedFolderBmpHC;
63 Image aOpenedDocBmpHC;
64 Image aClosedDocBmpHC;
66 SfxOrganizeMgr* pMgr;
67 SfxOrganizeDlg_Impl* pDlg;
69 static sal_Bool bDropMoveOk;
71 DECL_LINK( OnAsyncExecuteDrop, ExecuteDropEvent* );
73 protected:
74 virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection & );
75 virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const String& rNewText );
76 virtual sal_Bool NotifyMoving(SvLBoxEntry *pSource,
77 SvLBoxEntry* pTarget,
78 SvLBoxEntry *&pNewParent, sal_uIntPtr &);
79 virtual sal_Bool NotifyCopying(SvLBoxEntry *pSource,
80 SvLBoxEntry* pTarget,
81 SvLBoxEntry *&pNewParent, sal_uIntPtr &);
82 virtual void RequestingChilds( SvLBoxEntry* pParent );
83 virtual long ExpandingHdl();
84 virtual sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True );
86 using SvLBox::ExecuteDrop;
87 // new d&d
88 virtual DragDropMode NotifyStartDrag( TransferDataContainer&, SvLBoxEntry* );
89 virtual sal_Bool NotifyAcceptDrop( SvLBoxEntry* );
90 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
91 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
92 virtual void DragFinished( sal_Int8 nDropAction );
94 public:
95 using SvListView::Select;
96 enum DataEnum { VIEW_TEMPLATES, VIEW_FILES } eViewType;
98 SfxOrganizeListBox_Impl( SfxOrganizeDlg_Impl* pDlg, Window* pParent, WinBits, DataEnum );
100 DataEnum GetViewType() const { return eViewType; }
101 void SetViewType(DataEnum eType) { eViewType = eType; }
103 void SetMgr(SfxOrganizeMgr *pM) { pMgr = pM; }
104 void Reset();
105 inline void SetBitmaps(
106 const Image &rOFolderBmp, const Image &rCFolderBmp, const Image &rODocBmp, const Image &rCDocBmp,
107 const Image &rOFolderBmpHC, const Image &rCFolderBmpHC, const Image &rODocBmpHC, const Image &rCDocBmpHC );
108 const Image &GetClosedBmp(sal_uInt16 nLevel) const;
109 const Image &GetOpenedBmp(sal_uInt16 nLevel) const;
111 virtual PopupMenu* CreateContextMenu();
113 private:
114 sal_Bool IsStandard_Impl( SvLBoxEntry *) const;
115 sal_Bool MoveOrCopyTemplates(SvLBox *pSourceBox,
116 SvLBoxEntry *pSource,
117 SvLBoxEntry* pTarget,
118 SvLBoxEntry *&pNewParent,
119 sal_uIntPtr &rIdx,
120 sal_Bool bCopy);
121 sal_Bool MoveOrCopyContents(SvLBox *pSourceBox,
122 SvLBoxEntry *pSource,
123 SvLBoxEntry* pTarget,
124 SvLBoxEntry *&pNewParent,
125 sal_uIntPtr &rIdx,
126 sal_Bool bCopy);
127 inline sal_uInt16 GetDocLevel() const;
128 SfxObjectShellRef GetObjectShell( const Path& );
129 sal_Bool IsUniqName_Impl( const String &rText,
130 SvLBoxEntry* pParent, SvLBoxEntry* pEntry = 0 ) const;
131 sal_uInt16 GetLevelCount_Impl( SvLBoxEntry* pParent ) const;
133 SvLBoxEntry* InsertEntryByBmpType( const XubString& rText, BMPTYPE eBmpType,
134 SvLBoxEntry* pParent = NULL, sal_Bool bChildsOnDemand = sal_False,
135 sal_uIntPtr nPos = LIST_APPEND, void* pUserData = NULL );
138 #endif // _SFX_HXX
140 //=========================================================================
142 class SfxTemplateOrganizeDlg : public ModalDialog
144 friend class SfxOrganizeListBox_Impl;
146 class SfxOrganizeDlg_Impl *pImp;
148 // virtual void DataChanged( const DataChangedEvent& rDCEvt );
149 public:
150 SfxTemplateOrganizeDlg(Window * pParent, SfxDocumentTemplates* = 0);
151 ~SfxTemplateOrganizeDlg();
153 #define RET_EDIT_STYLE 100
155 virtual short Execute();
158 #endif