Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / source / ui / inc / instbdlg.hxx
blobffa2548d0a18fb733ef6a38d5cf88363c64991fd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_INSTBDLG_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_INSTBDLG_HXX
23 #include "address.hxx"
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>
32 #include <sfx2/objsh.hxx>
33 #include <vcl/field.hxx>
35 class ScViewData;
36 class ScDocument;
37 class ScDocShell;
39 namespace sfx2 { class DocumentInserter; }
40 namespace sfx2 { class FileDialogHelper; }
42 class ScInsertTableDlg : public ModalDialog
44 public:
45 ScInsertTableDlg( vcl::Window* pParent, ScViewData& rViewData, SCTAB nTabCount, bool bFromFile );
46 virtual ~ScInsertTableDlg();
47 virtual void dispose() override;
49 virtual short Execute() override; // override to set parent dialog
51 bool GetTablesFromFile() const { return m_pBtnFromFile->IsChecked(); }
52 bool GetTablesAsLink() const { return m_pBtnLink->IsChecked(); }
54 const OUString* GetFirstTable( sal_uInt16* pN = nullptr );
55 const OUString* GetNextTable( sal_uInt16* pN = nullptr );
56 ScDocShell* GetDocShellTables() { return pDocShTables; }
57 bool IsTableBefore() const { return m_pBtnBefore->IsChecked(); }
58 SCTAB GetTableCount() const { return nTableCount;}
60 private:
61 VclPtr<RadioButton> m_pBtnBefore;
62 VclPtr<RadioButton> m_pBtnBehind;
63 VclPtr<RadioButton> m_pBtnNew;
64 VclPtr<RadioButton> m_pBtnFromFile;
65 VclPtr<FixedText> m_pFtCount;
66 VclPtr<NumericField> m_pNfCount;
67 VclPtr<FixedText> m_pFtName;
68 VclPtr<Edit> m_pEdName;
69 VclPtr<ListBox> m_pLbTables;
70 VclPtr<FixedText> m_pFtPath;
71 VclPtr<PushButton> m_pBtnBrowse;
72 VclPtr<CheckBox> m_pBtnLink;
73 VclPtr<OKButton> m_pBtnOk;
75 Timer aBrowseTimer;
76 ScViewData& rViewData;
77 ScDocument& rDoc;
78 ScDocShell* pDocShTables;
79 sfx2::DocumentInserter* pDocInserter;
80 SfxObjectShellRef aDocShTablesRef;
82 bool bMustClose;
83 sal_uInt16 nSelTabIndex; // for GetFirstTable() / GetNextTable()
84 OUString aStrCurSelTable;
85 SCTAB nTableCount;
86 OUString m_sSheetDotDotDot;
88 void Init_Impl( bool bFromFile );
89 void SetNewTable_Impl();
90 void SetFromTo_Impl();
91 void FillTables_Impl( ScDocument* pSrcDoc );
92 void DoEnable_Impl();
94 DECL_LINK_TYPED( BrowseHdl_Impl, Button*, void );
95 DECL_LINK_TYPED( ChoiceHdl_Impl, Button*, void );
96 DECL_LINK_TYPED( SelectHdl_Impl, ListBox&, void );
97 DECL_LINK_TYPED( CountHdl_Impl, Edit&, void );
98 DECL_LINK_TYPED( DoEnterHdl, Button*, void );
99 DECL_LINK_TYPED( BrowseTimeoutHdl, Timer *, void );
100 DECL_LINK_TYPED( DialogClosedHdl, sfx2::FileDialogHelper*, void );
103 #endif // INCLUDED_SC_SOURCE_UI_INC_INSTBDLG_HXX
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */