Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : : #ifndef _SFXDOCVOR_HXX
20 : : #define _SFXDOCVOR_HXX
21 : :
22 : :
23 : : #include <vcl/dialog.hxx>
24 : : #include <svtools/svtreebx.hxx>
25 : :
26 : : #include <sfx2/objsh.hxx>
27 : : #include "orgmgr.hxx"
28 : :
29 : : //=========================================================================
30 : :
31 : : class SfxDocumentTemplates;
32 : : class Path;
33 : :
34 : : //=========================================================================
35 : :
36 : : #ifndef _SFX_HXX
37 : :
38 : : class SfxOrganizeDlg_Impl;
39 : :
40 [ # # ][ # # ]: 0 : class SfxOrganizeListBox_Impl : public SvTreeListBox
[ # # ][ # # ]
[ # # ]
41 : : {
42 : : enum BMPTYPE { BMPTYPE_FOLDER, BMPTYPE_DOC };
43 : :
44 : : friend class SfxOrganizeDlg_Impl;
45 : :
46 : : Image aOpenedFolderBmp;
47 : : Image aClosedFolderBmp;
48 : : Image aOpenedDocBmp;
49 : : Image aClosedDocBmp;
50 : :
51 : : SfxOrganizeMgr* pMgr;
52 : : SfxOrganizeDlg_Impl* pDlg;
53 : :
54 : : static sal_Bool bDropMoveOk;
55 : :
56 : : DECL_LINK( OnAsyncExecuteDrop, ExecuteDropEvent* );
57 : :
58 : : protected:
59 : : virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection & );
60 : : virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const rtl::OUString& rNewText );
61 : : virtual sal_Bool NotifyMoving(SvLBoxEntry *pSource,
62 : : SvLBoxEntry* pTarget,
63 : : SvLBoxEntry *&pNewParent, sal_uIntPtr &);
64 : : virtual sal_Bool NotifyCopying(SvLBoxEntry *pSource,
65 : : SvLBoxEntry* pTarget,
66 : : SvLBoxEntry *&pNewParent, sal_uIntPtr &);
67 : : virtual void RequestingChildren( SvLBoxEntry* pParent );
68 : : virtual long ExpandingHdl();
69 : : virtual sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True );
70 : :
71 : : using SvLBox::ExecuteDrop;
72 : : // new d&d
73 : : virtual DragDropMode NotifyStartDrag( TransferDataContainer&, SvLBoxEntry* );
74 : : virtual sal_Bool NotifyAcceptDrop( SvLBoxEntry* );
75 : : virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
76 : : virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
77 : : virtual void DragFinished( sal_Int8 nDropAction );
78 : :
79 : : public:
80 : : using SvListView::Select;
81 : : enum DataEnum { VIEW_TEMPLATES, VIEW_FILES } eViewType;
82 : :
83 : : SfxOrganizeListBox_Impl( SfxOrganizeDlg_Impl* pDlg, Window* pParent, WinBits, DataEnum );
84 : :
85 : 0 : DataEnum GetViewType() const { return eViewType; }
86 : 0 : void SetViewType(DataEnum eType) { eViewType = eType; }
87 : :
88 : 0 : void SetMgr(SfxOrganizeMgr *pM) { pMgr = pM; }
89 : : void Reset();
90 : : inline void SetBitmaps(
91 : : const Image &rOFolderBmp, const Image &rCFolderBmp, const Image &rODocBmp, const Image &rCDocBmp
92 : : );
93 : : const Image &GetClosedBmp(sal_uInt16 nLevel) const;
94 : : const Image &GetOpenedBmp(sal_uInt16 nLevel) const;
95 : :
96 : : virtual PopupMenu* CreateContextMenu();
97 : :
98 : : private:
99 : : sal_Bool IsStandard_Impl( SvLBoxEntry *) const;
100 : : sal_Bool MoveOrCopyTemplates(SvLBox *pSourceBox,
101 : : SvLBoxEntry *pSource,
102 : : SvLBoxEntry* pTarget,
103 : : SvLBoxEntry *&pNewParent,
104 : : sal_uIntPtr &rIdx,
105 : : sal_Bool bCopy);
106 : : sal_Bool MoveOrCopyContents(SvLBox *pSourceBox,
107 : : SvLBoxEntry *pSource,
108 : : SvLBoxEntry* pTarget,
109 : : SvLBoxEntry *&pNewParent,
110 : : sal_uIntPtr &rIdx,
111 : : sal_Bool bCopy);
112 : : inline sal_uInt16 GetDocLevel() const;
113 : : SfxObjectShellRef GetObjectShell( const Path& );
114 : : sal_Bool IsUniqName_Impl( const String &rText,
115 : : SvLBoxEntry* pParent, SvLBoxEntry* pEntry = 0 ) const;
116 : : sal_uInt16 GetLevelCount_Impl( SvLBoxEntry* pParent ) const;
117 : :
118 : : SvLBoxEntry* InsertEntryByBmpType( const XubString& rText, BMPTYPE eBmpType,
119 : : SvLBoxEntry* pParent = NULL, sal_Bool bChildrenOnDemand = sal_False,
120 : : sal_uIntPtr nPos = LIST_APPEND, void* pUserData = NULL );
121 : : };
122 : :
123 : : #endif // _SFX_HXX
124 : :
125 : : //=========================================================================
126 : :
127 : : class SfxTemplateOrganizeDlg : public ModalDialog
128 : : {
129 : : friend class SfxOrganizeListBox_Impl;
130 : :
131 : : class SfxOrganizeDlg_Impl *pImp;
132 : :
133 : : public:
134 : : SfxTemplateOrganizeDlg(Window * pParent, SfxDocumentTemplates* = 0);
135 : : ~SfxTemplateOrganizeDlg();
136 : :
137 : : #define RET_EDIT_STYLE 100
138 : :
139 : : virtual short Execute();
140 : : };
141 : :
142 : : #endif
143 : :
144 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|