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 : virtual void dispose() SAL_OVERRIDE;
48 :
49 : virtual short Execute() SAL_OVERRIDE; // override to set parent dialog
50 :
51 0 : bool GetTablesFromFile() const { return m_pBtnFromFile->IsChecked(); }
52 0 : bool GetTablesAsLink() const { return m_pBtnLink->IsChecked(); }
53 :
54 : const OUString* GetFirstTable( sal_uInt16* pN = NULL );
55 : const OUString* GetNextTable( sal_uInt16* pN = NULL );
56 0 : ScDocShell* GetDocShellTables() { return pDocShTables; }
57 0 : bool IsTableBefore() const { return m_pBtnBefore->IsChecked(); }
58 0 : SCTAB GetTableCount() const { return nTableCount;}
59 :
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;
74 :
75 : Timer aBrowseTimer;
76 : ScViewData& rViewData;
77 : ScDocument& rDoc;
78 : ScDocShell* pDocShTables;
79 : sfx2::DocumentInserter* pDocInserter;
80 : SfxObjectShellRef aDocShTablesRef;
81 :
82 : bool bMustClose;
83 : sal_uInt16 nSelTabIndex; // for GetFirstTable() / GetNextTable()
84 : OUString aStrCurSelTable;
85 : SCTAB nTableCount;
86 : OUString m_sSheetDotDotDot;
87 :
88 : void Init_Impl( bool bFromFile );
89 : void SetNewTable_Impl();
90 : void SetFromTo_Impl();
91 : void FillTables_Impl( ScDocument* pSrcDoc );
92 : void DoEnable_Impl();
93 :
94 : DECL_LINK(BrowseHdl_Impl, void *);
95 : DECL_LINK(ChoiceHdl_Impl, void *);
96 : DECL_LINK(SelectHdl_Impl, void *);
97 : DECL_LINK(CountHdl_Impl, void *);
98 : DECL_LINK(DoEnterHdl, void *);
99 : DECL_LINK_TYPED(BrowseTimeoutHdl, Timer *, void);
100 : DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* );
101 : };
102 :
103 : #endif // INCLUDED_SC_SOURCE_UI_INC_INSTBDLG_HXX
104 :
105 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|