1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: docvor.hxx,v $
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 _SFXDOCVOR_HXX
31 #define _SFXDOCVOR_HXX
34 #ifndef _DIALOG_HXX //autogen
35 #include <vcl/dialog.hxx>
37 #include <svtools/svtreebx.hxx>
39 #include <sfx2/objsh.hxx>
42 //=========================================================================
44 class SfxDocumentTemplates
;
47 //=========================================================================
51 class SfxOrganizeDlg_Impl
;
53 class SfxOrganizeListBox_Impl
: public SvTreeListBox
55 enum BMPTYPE
{ BMPTYPE_FOLDER
, BMPTYPE_DOC
};
57 friend class SfxOrganizeDlg_Impl
;
59 Image aOpenedFolderBmp
;
60 Image aClosedFolderBmp
;
64 Image aOpenedFolderBmpHC
;
65 Image aClosedFolderBmpHC
;
66 Image aOpenedDocBmpHC
;
67 Image aClosedDocBmpHC
;
70 SfxOrganizeDlg_Impl
* pDlg
;
72 static BOOL bDropMoveOk
;
74 DECL_LINK( OnAsyncExecuteDrop
, ExecuteDropEvent
* );
77 virtual BOOL
EditingEntry( SvLBoxEntry
* pEntry
, Selection
& );
78 virtual BOOL
EditedEntry( SvLBoxEntry
* pEntry
, const String
& rNewText
);
79 virtual BOOL
NotifyMoving(SvLBoxEntry
*pSource
,
81 SvLBoxEntry
*&pNewParent
, ULONG
&);
82 virtual BOOL
NotifyCopying(SvLBoxEntry
*pSource
,
84 SvLBoxEntry
*&pNewParent
, ULONG
&);
85 virtual void RequestingChilds( SvLBoxEntry
* pParent
);
86 virtual long ExpandingHdl();
87 virtual BOOL
Select( SvLBoxEntry
* pEntry
, BOOL bSelect
=TRUE
);
89 using SvLBox::ExecuteDrop
;
91 virtual DragDropMode
NotifyStartDrag( TransferDataContainer
&, SvLBoxEntry
* );
92 virtual BOOL
NotifyAcceptDrop( SvLBoxEntry
* );
93 virtual sal_Int8
AcceptDrop( const AcceptDropEvent
& rEvt
);
94 virtual sal_Int8
ExecuteDrop( const ExecuteDropEvent
& rEvt
);
95 virtual void DragFinished( sal_Int8 nDropAction
);
98 using SvListView::Select
;
99 enum DataEnum
{ VIEW_TEMPLATES
, VIEW_FILES
} eViewType
;
101 SfxOrganizeListBox_Impl( SfxOrganizeDlg_Impl
* pDlg
, Window
* pParent
, WinBits
, DataEnum
);
103 DataEnum
GetViewType() const { return eViewType
; }
104 void SetViewType(DataEnum eType
) { eViewType
= eType
; }
106 void SetMgr(SfxOrganizeMgr
*pM
) { pMgr
= pM
; }
108 inline void SetBitmaps(
109 const Image
&rOFolderBmp
, const Image
&rCFolderBmp
, const Image
&rODocBmp
, const Image
&rCDocBmp
,
110 const Image
&rOFolderBmpHC
, const Image
&rCFolderBmpHC
, const Image
&rODocBmpHC
, const Image
&rCDocBmpHC
);
111 const Image
&GetClosedBmp(USHORT nLevel
) const;
112 const Image
&GetOpenedBmp(USHORT nLevel
) const;
114 virtual PopupMenu
* CreateContextMenu();
117 BOOL
IsStandard_Impl( SvLBoxEntry
*) const;
118 BOOL
MoveOrCopyTemplates(SvLBox
*pSourceBox
,
119 SvLBoxEntry
*pSource
,
120 SvLBoxEntry
* pTarget
,
121 SvLBoxEntry
*&pNewParent
,
124 BOOL
MoveOrCopyContents(SvLBox
*pSourceBox
,
125 SvLBoxEntry
*pSource
,
126 SvLBoxEntry
* pTarget
,
127 SvLBoxEntry
*&pNewParent
,
130 inline USHORT
GetDocLevel() const;
131 SfxObjectShellRef
GetObjectShell( const Path
& );
132 BOOL
IsUniqName_Impl( const String
&rText
,
133 SvLBoxEntry
* pParent
, SvLBoxEntry
* pEntry
= 0 ) const;
134 USHORT
GetLevelCount_Impl( SvLBoxEntry
* pParent
) const;
136 SvLBoxEntry
* InsertEntryByBmpType( const XubString
& rText
, BMPTYPE eBmpType
,
137 SvLBoxEntry
* pParent
= NULL
, BOOL bChildsOnDemand
= FALSE
,
138 ULONG nPos
= LIST_APPEND
, void* pUserData
= NULL
);
143 //=========================================================================
145 class SfxTemplateOrganizeDlg
: public ModalDialog
147 friend class SfxOrganizeListBox_Impl
;
149 class SfxOrganizeDlg_Impl
*pImp
;
151 // virtual void DataChanged( const DataChangedEvent& rDCEvt );
153 SfxTemplateOrganizeDlg(Window
* pParent
, SfxDocumentTemplates
* = 0);
154 ~SfxTemplateOrganizeDlg();
156 #define RET_EDIT_STYLE 100
158 virtual short Execute();