merge the formfield patch from ooo-build
[ooovba.git] / sc / source / ui / inc / instbdlg.hxx
blob944b50a8f3591e6f2af7445eda6f348353189155
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: instbdlg.hxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_INSTBDLG_HXX
32 #define SC_INSTBDLG_HXX
34 #include "address.hxx"
36 #ifndef _BUTTON_HXX //autogen
37 #include <vcl/button.hxx>
38 #endif
39 #ifndef _GROUP_HXX //autogen
40 #include <vcl/group.hxx>
41 #endif
42 #ifndef _LSTBOX_HXX //autogen
43 #include <vcl/lstbox.hxx>
44 #endif
45 #ifndef _EDIT_HXX //autogen
46 #include <vcl/edit.hxx>
47 #endif
48 #ifndef _FIXED_HXX //autogen
49 #include <vcl/fixed.hxx>
50 #endif
51 #ifndef _DIALOG_HXX //autogen
52 #include <vcl/dialog.hxx>
53 #endif
55 #include <sfx2/objsh.hxx>
56 #include <vcl/field.hxx>
57 #include "expftext.hxx"
59 #include <layout/layout.hxx>
60 #include <layout/layout-pre.hxx>
62 class ScViewData;
63 class ScDocument;
64 class ScDocShell;
66 namespace sfx2 { class DocumentInserter; }
67 namespace sfx2 { class FileDialogHelper; }
69 //------------------------------------------------------------------------
71 class ScInsertTableDlg : public ModalDialog
73 public:
74 ScInsertTableDlg( Window* pParent, ScViewData& rViewData, SCTAB nTabCount, bool bFromFile );
75 ~ScInsertTableDlg();
77 virtual short Execute(); // ueberladen, um Dialog-Parent zu setzen
79 BOOL GetTablesFromFile() { return aBtnFromFile.IsChecked(); }
80 BOOL GetTablesAsLink() { return aBtnLink.IsChecked(); }
82 const String* GetFirstTable( USHORT* pN = NULL );
83 const String* GetNextTable( USHORT* pN = NULL );
84 ScDocShell* GetDocShellTables() { return pDocShTables; }
85 BOOL IsTableBefore() { return aBtnBefore.IsChecked(); }
86 SCTAB GetTableCount() { return nTableCount;}
88 private:
89 RadioButton aBtnBefore;
90 RadioButton aBtnBehind;
91 FixedLine aFlPos;
92 RadioButton aBtnNew;
93 RadioButton aBtnFromFile;
94 FixedText aFtCount;
95 NumericField aNfCount;
96 FixedText aFtName;
97 Edit aEdName;
98 MultiListBox aLbTables;
99 ScExpandedFixedText aFtPath;
100 PushButton aBtnBrowse;
101 CheckBox aBtnLink;
102 FixedLine aFlTable;
103 OKButton aBtnOk;
104 CancelButton aBtnCancel;
105 HelpButton aBtnHelp;
107 Timer aBrowseTimer;
108 ScViewData& rViewData;
109 ScDocument& rDoc;
110 ScDocShell* pDocShTables;
111 sfx2::DocumentInserter* pDocInserter;
112 SfxObjectShellRef aDocShTablesRef;
114 bool bMustClose;
115 USHORT nSelTabIndex; // fuer GetFirstTable() / GetNextTable()
116 String aStrCurSelTable;
117 SCTAB nTableCount;
119 #ifdef SC_INSTBDLG_CXX
120 void Init_Impl( bool bFromFile );
121 void SetNewTable_Impl();
122 void SetFromTo_Impl();
123 void FillTables_Impl( ScDocument* pSrcDoc );
124 void DoEnable_Impl();
126 DECL_LINK( BrowseHdl_Impl, PushButton* );
127 DECL_LINK( ChoiceHdl_Impl, RadioButton* );
128 DECL_LINK( SelectHdl_Impl, MultiListBox* );
129 DECL_LINK( CountHdl_Impl, NumericField* );
130 DECL_LINK( DoEnterHdl, PushButton* );
131 DECL_LINK( BrowseTimeoutHdl, Timer* );
132 DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* );
133 #endif
136 #include <layout/layout-post.hxx>
138 #endif // SC_INSTBDLG_HXX