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>
34 #include <svtools/svtreebx.hxx>
36 #include <sfx2/objsh.hxx>
39 //=========================================================================
41 class SfxDocumentTemplates
;
44 //=========================================================================
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
;
61 Image aOpenedFolderBmpHC
;
62 Image aClosedFolderBmpHC
;
63 Image aOpenedDocBmpHC
;
64 Image aClosedDocBmpHC
;
67 SfxOrganizeDlg_Impl
* pDlg
;
69 static sal_Bool bDropMoveOk
;
71 DECL_LINK( OnAsyncExecuteDrop
, ExecuteDropEvent
* );
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
,
78 SvLBoxEntry
*&pNewParent
, sal_uIntPtr
&);
79 virtual sal_Bool
NotifyCopying(SvLBoxEntry
*pSource
,
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
;
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
);
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
; }
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();
114 sal_Bool
IsStandard_Impl( SvLBoxEntry
*) const;
115 sal_Bool
MoveOrCopyTemplates(SvLBox
*pSourceBox
,
116 SvLBoxEntry
*pSource
,
117 SvLBoxEntry
* pTarget
,
118 SvLBoxEntry
*&pNewParent
,
121 sal_Bool
MoveOrCopyContents(SvLBox
*pSourceBox
,
122 SvLBoxEntry
*pSource
,
123 SvLBoxEntry
* pTarget
,
124 SvLBoxEntry
*&pNewParent
,
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
);
140 //=========================================================================
142 class SfxTemplateOrganizeDlg
: public ModalDialog
144 friend class SfxOrganizeListBox_Impl
;
146 class SfxOrganizeDlg_Impl
*pImp
;
148 // virtual void DataChanged( const DataChangedEvent& rDCEvt );
150 SfxTemplateOrganizeDlg(Window
* pParent
, SfxDocumentTemplates
* = 0);
151 ~SfxTemplateOrganizeDlg();
153 #define RET_EDIT_STYLE 100
155 virtual short Execute();