xref: /aoo41x/main/sfx2/inc/orgmgr.hxx (revision 353d8f4d)
1*353d8f4dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*353d8f4dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*353d8f4dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*353d8f4dSAndrew Rist  * distributed with this work for additional information
6*353d8f4dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*353d8f4dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*353d8f4dSAndrew Rist  * "License"); you may not use this file except in compliance
9*353d8f4dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*353d8f4dSAndrew Rist  *
11*353d8f4dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*353d8f4dSAndrew Rist  *
13*353d8f4dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*353d8f4dSAndrew Rist  * software distributed under the License is distributed on an
15*353d8f4dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*353d8f4dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*353d8f4dSAndrew Rist  * specific language governing permissions and limitations
18*353d8f4dSAndrew Rist  * under the License.
19*353d8f4dSAndrew Rist  *
20*353d8f4dSAndrew Rist  *************************************************************/
21*353d8f4dSAndrew Rist 
22*353d8f4dSAndrew Rist 
23cdf0e10cSrcweir #ifndef _SFX_ORGMGR_HXX
24cdf0e10cSrcweir #define _SFX_ORGMGR_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <svl/svarray.hxx>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir class SfxDocumentTemplates;
29cdf0e10cSrcweir class SfxOrganizeListBox_Impl;
30cdf0e10cSrcweir class SfxObjectShell;
31cdf0e10cSrcweir struct _FileListEntry;
32cdf0e10cSrcweir 
33cdf0e10cSrcweir //=========================================================================
34cdf0e10cSrcweir 
35cdf0e10cSrcweir SV_DECL_PTRARR_SORT(_SfxObjectList, _FileListEntry*, 1, 4)
36cdf0e10cSrcweir 
37cdf0e10cSrcweir class SfxObjectList: public _SfxObjectList
38cdf0e10cSrcweir {
39cdf0e10cSrcweir public:
40cdf0e10cSrcweir 	SfxObjectList();
41cdf0e10cSrcweir 	~SfxObjectList();
42cdf0e10cSrcweir 
43cdf0e10cSrcweir 	const String&	GetBaseName( sal_uInt16 nId ) const;
44cdf0e10cSrcweir 	const String&	GetFileName( sal_uInt16 nId ) const;
45cdf0e10cSrcweir };
46cdf0e10cSrcweir 
47cdf0e10cSrcweir class IntlWrapper;
48cdf0e10cSrcweir struct SfxOrganizeMgr_Impl
49cdf0e10cSrcweir {
50cdf0e10cSrcweir 	SfxObjectList*		pDocList;
51cdf0e10cSrcweir 	IntlWrapper*		pIntlWrapper;
52cdf0e10cSrcweir 
SfxOrganizeMgr_ImplSfxOrganizeMgr_Impl53cdf0e10cSrcweir 	SfxOrganizeMgr_Impl() :  pDocList( NULL ), pIntlWrapper( NULL ) {}
54cdf0e10cSrcweir };
55cdf0e10cSrcweir 
56cdf0e10cSrcweir //=========================================================================
57cdf0e10cSrcweir 
58cdf0e10cSrcweir class SfxOrganizeMgr
59cdf0e10cSrcweir {
60cdf0e10cSrcweir private:
61cdf0e10cSrcweir 	SfxOrganizeMgr_Impl*		pImpl;
62cdf0e10cSrcweir 	SfxDocumentTemplates* 		pTemplates;
63cdf0e10cSrcweir 	SfxOrganizeListBox_Impl* 	pLeftBox;
64cdf0e10cSrcweir 	SfxOrganizeListBox_Impl* 	pRightBox;
65cdf0e10cSrcweir 	sal_Bool						bDeleteTemplates	:1;
66cdf0e10cSrcweir 	sal_Bool						bModified			:1;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 	SfxOrganizeListBox_Impl*	GetOther( SfxOrganizeListBox_Impl* );
69cdf0e10cSrcweir 
70cdf0e10cSrcweir public:
71cdf0e10cSrcweir 	SfxOrganizeMgr( SfxOrganizeListBox_Impl* pLeft,
72cdf0e10cSrcweir 					SfxOrganizeListBox_Impl* pRight,
73cdf0e10cSrcweir 					SfxDocumentTemplates* pTempl = NULL );
74cdf0e10cSrcweir 	~SfxOrganizeMgr();
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 	sal_Bool	Copy( sal_uInt16 nTargetRegion, sal_uInt16 nTargetIdx, sal_uInt16 nSourceRegion, sal_uInt16 nSourceIdx );
77cdf0e10cSrcweir 	sal_Bool	Move( sal_uInt16 nTargetRegion, sal_uInt16 nTargetIdx, sal_uInt16 nSourceRegion, sal_uInt16 nSourceIdx );
78cdf0e10cSrcweir 	sal_Bool	Delete( SfxOrganizeListBox_Impl* pCaller, sal_uInt16 nRegion, sal_uInt16 nIdx );
79cdf0e10cSrcweir 	sal_Bool	InsertDir( SfxOrganizeListBox_Impl* pCaller, const String& rName, sal_uInt16 nRegion );
80cdf0e10cSrcweir 	sal_Bool	SetName( const String& rName, sal_uInt16 nRegion, sal_uInt16 nIdx = USHRT_MAX );
81cdf0e10cSrcweir 	sal_Bool	CopyTo( sal_uInt16 nRegion, sal_uInt16 nIdx, const String& rName ) const;
82cdf0e10cSrcweir 	sal_Bool	CopyFrom( SfxOrganizeListBox_Impl* pCaller, sal_uInt16 nRegion, sal_uInt16 nIdx, String& rName );
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 	sal_Bool	Rescan();
85cdf0e10cSrcweir 	sal_Bool	InsertFile( SfxOrganizeListBox_Impl* pCaller, const String& rFileName );
86cdf0e10cSrcweir 
IsModified() const87cdf0e10cSrcweir 	sal_Bool	IsModified() const { return bModified ? sal_True : sal_False; }
88cdf0e10cSrcweir 
GetTemplates() const89cdf0e10cSrcweir 	const SfxDocumentTemplates*	GetTemplates() const { return pTemplates; }
GetObjectList()90cdf0e10cSrcweir 	SfxObjectList&				GetObjectList() { return *pImpl->pDocList; }
GetObjectList() const91cdf0e10cSrcweir 	const SfxObjectList&		GetObjectList() const { return *pImpl->pDocList; }
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 	SfxObjectShellRef	CreateObjectShell( sal_uInt16 nIdx );
94cdf0e10cSrcweir 	SfxObjectShellRef	CreateObjectShell( sal_uInt16 nRegion, sal_uInt16 nIdx );
95cdf0e10cSrcweir 	sal_Bool				DeleteObjectShell( sal_uInt16 );
96cdf0e10cSrcweir 	sal_Bool				DeleteObjectShell( sal_uInt16, sal_uInt16 );
97cdf0e10cSrcweir 	void				SaveAll( Window* pParent );
98cdf0e10cSrcweir };
99cdf0e10cSrcweir 
100cdf0e10cSrcweir #endif // #ifndef _SFX_ORGMGR_HXX
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 
103