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 _SFX_ORGMGR_HXX
28 #define _SFX_ORGMGR_HXX
30 #include <svl/svarray.hxx>
32 class SfxDocumentTemplates
;
33 class SfxOrganizeListBox_Impl
;
35 struct _FileListEntry
;
37 //=========================================================================
39 SV_DECL_PTRARR_SORT(_SfxObjectList
, _FileListEntry
*, 1, 4)
41 class SfxObjectList
: public _SfxObjectList
47 const String
& GetBaseName( sal_uInt16 nId
) const;
48 const String
& GetFileName( sal_uInt16 nId
) const;
52 struct SfxOrganizeMgr_Impl
54 SfxObjectList
* pDocList
;
55 IntlWrapper
* pIntlWrapper
;
57 SfxOrganizeMgr_Impl() : pDocList( NULL
), pIntlWrapper( NULL
) {}
60 //=========================================================================
65 SfxOrganizeMgr_Impl
* pImpl
;
66 SfxDocumentTemplates
* pTemplates
;
67 SfxOrganizeListBox_Impl
* pLeftBox
;
68 SfxOrganizeListBox_Impl
* pRightBox
;
69 sal_Bool bDeleteTemplates
:1;
70 sal_Bool bModified
:1;
72 SfxOrganizeListBox_Impl
* GetOther( SfxOrganizeListBox_Impl
* );
75 SfxOrganizeMgr( SfxOrganizeListBox_Impl
* pLeft
,
76 SfxOrganizeListBox_Impl
* pRight
,
77 SfxDocumentTemplates
* pTempl
= NULL
);
80 sal_Bool
Copy( sal_uInt16 nTargetRegion
, sal_uInt16 nTargetIdx
, sal_uInt16 nSourceRegion
, sal_uInt16 nSourceIdx
);
81 sal_Bool
Move( sal_uInt16 nTargetRegion
, sal_uInt16 nTargetIdx
, sal_uInt16 nSourceRegion
, sal_uInt16 nSourceIdx
);
82 sal_Bool
Delete( SfxOrganizeListBox_Impl
* pCaller
, sal_uInt16 nRegion
, sal_uInt16 nIdx
);
83 sal_Bool
InsertDir( SfxOrganizeListBox_Impl
* pCaller
, const String
& rName
, sal_uInt16 nRegion
);
84 sal_Bool
SetName( const String
& rName
, sal_uInt16 nRegion
, sal_uInt16 nIdx
= USHRT_MAX
);
85 sal_Bool
CopyTo( sal_uInt16 nRegion
, sal_uInt16 nIdx
, const String
& rName
) const;
86 sal_Bool
CopyFrom( SfxOrganizeListBox_Impl
* pCaller
, sal_uInt16 nRegion
, sal_uInt16 nIdx
, String
& rName
);
89 sal_Bool
InsertFile( SfxOrganizeListBox_Impl
* pCaller
, const String
& rFileName
);
91 sal_Bool
IsModified() const { return bModified
? sal_True
: sal_False
; }
93 const SfxDocumentTemplates
* GetTemplates() const { return pTemplates
; }
94 SfxObjectList
& GetObjectList() { return *pImpl
->pDocList
; }
95 const SfxObjectList
& GetObjectList() const { return *pImpl
->pDocList
; }
97 SfxObjectShellRef
CreateObjectShell( sal_uInt16 nIdx
);
98 SfxObjectShellRef
CreateObjectShell( sal_uInt16 nRegion
, sal_uInt16 nIdx
);
99 sal_Bool
DeleteObjectShell( sal_uInt16
);
100 sal_Bool
DeleteObjectShell( sal_uInt16
, sal_uInt16
);
101 void SaveAll( Window
* pParent
);
104 #endif // #ifndef _SFX_ORGMGR_HXX