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