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