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 :
20 : #ifndef INCLUDED_SC_SOURCE_UI_INC_INSTBDLG_HXX
21 : #define INCLUDED_SC_SOURCE_UI_INC_INSTBDLG_HXX
22 :
23 : #include "address.hxx"
24 :
25 : #include <vcl/button.hxx>
26 : #include <vcl/group.hxx>
27 : #include <vcl/lstbox.hxx>
28 : #include <vcl/edit.hxx>
29 : #include <vcl/fixed.hxx>
30 : #include <vcl/dialog.hxx>
31 :
32 : #include <sfx2/objsh.hxx>
33 : #include <vcl/field.hxx>
34 :
35 : class ScViewData;
36 : class ScDocument;
37 : class ScDocShell;
38 :
39 : namespace sfx2 { class DocumentInserter; }
40 : namespace sfx2 { class FileDialogHelper; }
41 :
42 : class ScInsertTableDlg : public ModalDialog
43 : {
44 : public:
45 : ScInsertTableDlg( vcl::Window* pParent, ScViewData& rViewData, SCTAB nTabCount, bool bFromFile );
46 : virtual ~ScInsertTableDlg();
47 :
48 : virtual short Execute() SAL_OVERRIDE; // overloaded to set parent dialog
49 :
50 0 : bool GetTablesFromFile() const { return m_pBtnFromFile->IsChecked(); }
51 0 : bool GetTablesAsLink() const { return m_pBtnLink->IsChecked(); }
52 :
53 : const OUString* GetFirstTable( sal_uInt16* pN = NULL );
54 : const OUString* GetNextTable( sal_uInt16* pN = NULL );
55 0 : ScDocShell* GetDocShellTables() { return pDocShTables; }
56 0 : bool IsTableBefore() const { return m_pBtnBefore->IsChecked(); }
57 0 : SCTAB GetTableCount() const { return nTableCount;}
58 :
59 : private:
60 : RadioButton* m_pBtnBefore;
61 : RadioButton* m_pBtnBehind;
62 : RadioButton* m_pBtnNew;
63 : RadioButton* m_pBtnFromFile;
64 : FixedText* m_pFtCount;
65 : NumericField* m_pNfCount;
66 : FixedText* m_pFtName;
67 : Edit* m_pEdName;
68 : ListBox* m_pLbTables;
69 : FixedText* m_pFtPath;
70 : PushButton* m_pBtnBrowse;
71 : CheckBox* m_pBtnLink;
72 : OKButton* m_pBtnOk;
73 :
74 : Timer aBrowseTimer;
75 : ScViewData& rViewData;
76 : ScDocument& rDoc;
77 : ScDocShell* pDocShTables;
78 : sfx2::DocumentInserter* pDocInserter;
79 : SfxObjectShellRef aDocShTablesRef;
80 :
81 : bool bMustClose;
82 : sal_uInt16 nSelTabIndex; // for GetFirstTable() / GetNextTable()
83 : OUString aStrCurSelTable;
84 : SCTAB nTableCount;
85 : OUString m_sSheetDotDotDot;
86 :
87 : void Init_Impl( bool bFromFile );
88 : void SetNewTable_Impl();
89 : void SetFromTo_Impl();
90 : void FillTables_Impl( ScDocument* pSrcDoc );
91 : void DoEnable_Impl();
92 :
93 : DECL_LINK(BrowseHdl_Impl, void *);
94 : DECL_LINK(ChoiceHdl_Impl, void *);
95 : DECL_LINK(SelectHdl_Impl, void *);
96 : DECL_LINK(CountHdl_Impl, void *);
97 : DECL_LINK(DoEnterHdl, void *);
98 : DECL_LINK(BrowseTimeoutHdl, void *);
99 : DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* );
100 : };
101 :
102 : #endif // INCLUDED_SC_SOURCE_UI_INC_INSTBDLG_HXX
103 :
104 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|