xref: /aoo4110/main/sfx2/inc/sfx2/docinsert.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 
24 #ifndef _SFX_DOCINSERT_HXX
25 #define _SFX_DOCINSERT_HXX
26 
27 #include <tools/errcode.hxx>
28 #include <tools/link.hxx>
29 #include <tools/string.hxx>
30 
31 #include "sfx2/dllapi.h"
32 
33 namespace sfx2 { class FileDialogHelper; }
34 class SfxMedium;
35 class SfxMediumList;
36 class SfxItemSet;
37 class SvStringsDtor;
38 
39 // ============================================================================
40 
41 namespace sfx2 {
42 
43 // ============================================================================
44 
45 // ============================================================================
46 // DocumentInserter
47 // ============================================================================
48 
49 class SFX2_DLLPUBLIC DocumentInserter
50 {
51 private:
52     String                  m_sDocFactory;
53     String                  m_sFilter;
54     Link                    m_aDialogClosedLink;
55 
56     bool                    m_bMultiSelectionEnabled;
57     sal_Int64               m_nDlgFlags;
58     ErrCode                 m_nError;
59 
60     sfx2::FileDialogHelper* m_pFileDlg;
61     SfxItemSet*             m_pItemSet;
62     SvStringsDtor*          m_pURLList;
63 
64     DECL_LINK(              DialogClosedHdl, sfx2::FileDialogHelper* );
65 
66 public:
67     DocumentInserter( sal_Int64 _nFlags, const String& _rFactory, bool _bEnableMultiSelection = false );
68     ~DocumentInserter();
69 
70     void                    StartExecuteModal( const Link& _rDialogClosedLink );
71     SfxMedium*              CreateMedium();
72     SfxMediumList*          CreateMediumList();
73 
GetError() const74     inline ErrCode          GetError() const { return m_nError; }
GetFilter() const75     inline String           GetFilter() const { return m_sFilter; }
76 };
77 
78 // ============================================================================
79 
80 } // namespace sfx2
81 
82 // ============================================================================
83 
84 #endif // _SFX_DOCINSERT_HXX
85 
86