Update ooo320-m1
[ooovba.git] / sfx2 / inc / orgmgr.hxx
blobac29d513cc5b28fe7aa47f82067344e01dae80d6
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: orgmgr.hxx,v $
10 * $Revision: 1.4 $
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 _SFX_ORGMGR_HXX
31 #define _SFX_ORGMGR_HXX
33 #include <svtools/svarray.hxx>
35 class SfxDocumentTemplates;
36 class SfxOrganizeListBox_Impl;
37 class SfxObjectShell;
38 struct _FileListEntry;
40 //=========================================================================
42 SV_DECL_PTRARR_SORT(_SfxObjectList, _FileListEntry*, 1, 4)
44 class SfxObjectList: public _SfxObjectList
46 public:
47 SfxObjectList();
48 ~SfxObjectList();
50 const String& GetBaseName( USHORT nId ) const;
51 const String& GetFileName( USHORT nId ) const;
54 class IntlWrapper;
55 struct SfxOrganizeMgr_Impl
57 SfxObjectList* pDocList;
58 IntlWrapper* pIntlWrapper;
60 SfxOrganizeMgr_Impl() : pDocList( NULL ), pIntlWrapper( NULL ) {}
63 //=========================================================================
65 class SfxOrganizeMgr
67 private:
68 SfxOrganizeMgr_Impl* pImpl;
69 SfxDocumentTemplates* pTemplates;
70 SfxOrganizeListBox_Impl* pLeftBox;
71 SfxOrganizeListBox_Impl* pRightBox;
72 BOOL bDeleteTemplates :1;
73 BOOL bModified :1;
75 SfxOrganizeListBox_Impl* GetOther( SfxOrganizeListBox_Impl* );
77 public:
78 SfxOrganizeMgr( SfxOrganizeListBox_Impl* pLeft,
79 SfxOrganizeListBox_Impl* pRight,
80 SfxDocumentTemplates* pTempl = NULL );
81 ~SfxOrganizeMgr();
83 BOOL Copy( USHORT nTargetRegion, USHORT nTargetIdx, USHORT nSourceRegion, USHORT nSourceIdx );
84 BOOL Move( USHORT nTargetRegion, USHORT nTargetIdx, USHORT nSourceRegion, USHORT nSourceIdx );
85 BOOL Delete( SfxOrganizeListBox_Impl* pCaller, USHORT nRegion, USHORT nIdx );
86 BOOL InsertDir( SfxOrganizeListBox_Impl* pCaller, const String& rName, USHORT nRegion );
87 BOOL SetName( const String& rName, USHORT nRegion, USHORT nIdx = USHRT_MAX );
88 BOOL CopyTo( USHORT nRegion, USHORT nIdx, const String& rName ) const;
89 BOOL CopyFrom( SfxOrganizeListBox_Impl* pCaller, USHORT nRegion, USHORT nIdx, String& rName );
91 BOOL Rescan();
92 BOOL InsertFile( SfxOrganizeListBox_Impl* pCaller, const String& rFileName );
94 BOOL IsModified() const { return bModified ? TRUE : FALSE; }
96 const SfxDocumentTemplates* GetTemplates() const { return pTemplates; }
97 SfxObjectList& GetObjectList() { return *pImpl->pDocList; }
98 const SfxObjectList& GetObjectList() const { return *pImpl->pDocList; }
100 SfxObjectShellRef CreateObjectShell( USHORT nIdx );
101 SfxObjectShellRef CreateObjectShell( USHORT nRegion, USHORT nIdx );
102 BOOL DeleteObjectShell( USHORT );
103 BOOL DeleteObjectShell( USHORT, USHORT );
104 void SaveAll( Window* pParent );
107 #endif // #ifndef _SFX_ORGMGR_HXX