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 _SFX_ORGMGR_HXX
20 : : #define _SFX_ORGMGR_HXX
21 : :
22 : : #include <o3tl/sorted_vector.hxx>
23 : :
24 : : class SfxDocumentTemplates;
25 : : class SfxOrganizeListBox_Impl;
26 : : struct _FileListEntry;
27 : :
28 : : //=========================================================================
29 : :
30 : : class SfxObjectList : public o3tl::sorted_vector<_FileListEntry*, o3tl::less_ptr_to<_FileListEntry> >
31 : : {
32 : : public:
33 : : SfxObjectList();
34 : : ~SfxObjectList();
35 : :
36 : : const String& GetBaseName( const _FileListEntry* p ) const;
37 : : };
38 : :
39 : : class IntlWrapper;
40 : : struct SfxOrganizeMgr_Impl
41 : : {
42 : : SfxObjectList* pDocList;
43 : : IntlWrapper* pIntlWrapper;
44 : :
45 : 0 : SfxOrganizeMgr_Impl() : pDocList( NULL ), pIntlWrapper( NULL ) {}
46 : : };
47 : :
48 : : //=========================================================================
49 : :
50 : : class SfxOrganizeMgr
51 : : {
52 : : private:
53 : : SfxOrganizeMgr_Impl* pImpl;
54 : : SfxDocumentTemplates* pTemplates;
55 : : SfxOrganizeListBox_Impl* pLeftBox;
56 : : SfxOrganizeListBox_Impl* pRightBox;
57 : : sal_Bool bDeleteTemplates :1;
58 : : sal_Bool bModified :1;
59 : :
60 : : SfxOrganizeListBox_Impl* GetOther( SfxOrganizeListBox_Impl* );
61 : :
62 : : public:
63 : : SfxOrganizeMgr( SfxOrganizeListBox_Impl* pLeft,
64 : : SfxOrganizeListBox_Impl* pRight,
65 : : SfxDocumentTemplates* pTempl = NULL );
66 : : ~SfxOrganizeMgr();
67 : :
68 : : sal_Bool Copy( sal_uInt16 nTargetRegion, sal_uInt16 nTargetIdx, sal_uInt16 nSourceRegion, sal_uInt16 nSourceIdx );
69 : : sal_Bool Move( sal_uInt16 nTargetRegion, sal_uInt16 nTargetIdx, sal_uInt16 nSourceRegion, sal_uInt16 nSourceIdx );
70 : : sal_Bool Delete( SfxOrganizeListBox_Impl* pCaller, sal_uInt16 nRegion, sal_uInt16 nIdx );
71 : : sal_Bool InsertDir( SfxOrganizeListBox_Impl* pCaller, const String& rName, sal_uInt16 nRegion );
72 : : sal_Bool SetName( const String& rName, sal_uInt16 nRegion, sal_uInt16 nIdx = USHRT_MAX );
73 : : sal_Bool CopyTo( sal_uInt16 nRegion, sal_uInt16 nIdx, const String& rName ) const;
74 : : sal_Bool CopyFrom( SfxOrganizeListBox_Impl* pCaller, sal_uInt16 nRegion, sal_uInt16 nIdx, String& rName );
75 : :
76 : : sal_Bool Rescan();
77 : : sal_Bool InsertFile( SfxOrganizeListBox_Impl* pCaller, const String& rFileName );
78 : :
79 : : sal_Bool IsModified() const { return bModified ? sal_True : sal_False; }
80 : :
81 : 0 : const SfxDocumentTemplates* GetTemplates() const { return pTemplates; }
82 : 0 : SfxObjectList& GetObjectList() { return *pImpl->pDocList; }
83 : : const SfxObjectList& GetObjectList() const { return *pImpl->pDocList; }
84 : :
85 : : SfxObjectShellRef CreateObjectShell( sal_uInt16 nIdx );
86 : : SfxObjectShellRef CreateObjectShell( sal_uInt16 nRegion, sal_uInt16 nIdx );
87 : : sal_Bool DeleteObjectShell( sal_uInt16 );
88 : : sal_Bool DeleteObjectShell( sal_uInt16, sal_uInt16 );
89 : : void SaveAll( Window* pParent );
90 : : };
91 : :
92 : : #endif // #ifndef _SFX_ORGMGR_HXX
93 : :
94 : :
95 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|