Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef SC_INSTBDLG_HXX
30 : : #define SC_INSTBDLG_HXX
31 : :
32 : : #include "address.hxx"
33 : :
34 : : #include <vcl/button.hxx>
35 : : #include <vcl/group.hxx>
36 : : #include <vcl/lstbox.hxx>
37 : : #include <vcl/edit.hxx>
38 : : #include <vcl/fixed.hxx>
39 : : #include <vcl/dialog.hxx>
40 : :
41 : : #include <sfx2/objsh.hxx>
42 : : #include <vcl/field.hxx>
43 : : #include "expftext.hxx"
44 : :
45 : : class ScViewData;
46 : : class ScDocument;
47 : : class ScDocShell;
48 : :
49 : : namespace sfx2 { class DocumentInserter; }
50 : : namespace sfx2 { class FileDialogHelper; }
51 : :
52 : : //------------------------------------------------------------------------
53 : :
54 : : class ScInsertTableDlg : public ModalDialog
55 : : {
56 : : public:
57 : : ScInsertTableDlg( Window* pParent, ScViewData& rViewData, SCTAB nTabCount, bool bFromFile );
58 : : ~ScInsertTableDlg();
59 : :
60 : : virtual short Execute(); // overloaded to set parent dialog
61 : :
62 : 0 : sal_Bool GetTablesFromFile() { return aBtnFromFile.IsChecked(); }
63 : 0 : sal_Bool GetTablesAsLink() { return aBtnLink.IsChecked(); }
64 : :
65 : : const String* GetFirstTable( sal_uInt16* pN = NULL );
66 : : const String* GetNextTable( sal_uInt16* pN = NULL );
67 : 0 : ScDocShell* GetDocShellTables() { return pDocShTables; }
68 : 0 : sal_Bool IsTableBefore() { return aBtnBefore.IsChecked(); }
69 : 0 : SCTAB GetTableCount() { return nTableCount;}
70 : :
71 : : private:
72 : : FixedLine aFlPos;
73 : : RadioButton aBtnBefore;
74 : : RadioButton aBtnBehind;
75 : : FixedLine aFlTable;
76 : : RadioButton aBtnNew;
77 : : RadioButton aBtnFromFile;
78 : : FixedText aFtCount;
79 : : NumericField aNfCount;
80 : : FixedText aFtName;
81 : : Edit aEdName;
82 : : MultiListBox aLbTables;
83 : : ScExpandedFixedText aFtPath;
84 : : PushButton aBtnBrowse;
85 : : CheckBox aBtnLink;
86 : : OKButton aBtnOk;
87 : : CancelButton aBtnCancel;
88 : : HelpButton aBtnHelp;
89 : :
90 : : Timer aBrowseTimer;
91 : : ScViewData& rViewData;
92 : : ScDocument& rDoc;
93 : : ScDocShell* pDocShTables;
94 : : sfx2::DocumentInserter* pDocInserter;
95 : : SfxObjectShellRef aDocShTablesRef;
96 : :
97 : : bool bMustClose;
98 : : sal_uInt16 nSelTabIndex; // for GetFirstTable() / GetNextTable()
99 : : String aStrCurSelTable;
100 : : SCTAB nTableCount;
101 : :
102 : : #ifdef SC_INSTBDLG_CXX
103 : : void Init_Impl( bool bFromFile );
104 : : void SetNewTable_Impl();
105 : : void SetFromTo_Impl();
106 : : void FillTables_Impl( ScDocument* pSrcDoc );
107 : : void DoEnable_Impl();
108 : :
109 : : DECL_LINK(BrowseHdl_Impl, void *);
110 : : DECL_LINK(ChoiceHdl_Impl, void *);
111 : : DECL_LINK(SelectHdl_Impl, void *);
112 : : DECL_LINK(CountHdl_Impl, void *);
113 : : DECL_LINK(DoEnterHdl, void *);
114 : : DECL_LINK(BrowseTimeoutHdl, void *);
115 : : DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* );
116 : : #endif
117 : : };
118 : :
119 : : #endif // SC_INSTBDLG_HXX
120 : :
121 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|