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