xref: /trunk/main/sc/source/ui/inc/instbdlg.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_INSTBDLG_HXX
25 #define SC_INSTBDLG_HXX
26 
27 #include "address.hxx"
28 
29 #ifndef _BUTTON_HXX //autogen
30 #include <vcl/button.hxx>
31 #endif
32 #ifndef _GROUP_HXX //autogen
33 #include <vcl/group.hxx>
34 #endif
35 #ifndef _LSTBOX_HXX //autogen
36 #include <vcl/lstbox.hxx>
37 #endif
38 #ifndef _EDIT_HXX //autogen
39 #include <vcl/edit.hxx>
40 #endif
41 #ifndef _FIXED_HXX //autogen
42 #include <vcl/fixed.hxx>
43 #endif
44 #ifndef _DIALOG_HXX //autogen
45 #include <vcl/dialog.hxx>
46 #endif
47 
48 #include <sfx2/objsh.hxx>
49 #include <vcl/field.hxx>
50 #include "expftext.hxx"
51 
52 #include <layout/layout.hxx>
53 #include <layout/layout-pre.hxx>
54 
55 class ScViewData;
56 class ScDocument;
57 class ScDocShell;
58 
59 namespace sfx2 { class DocumentInserter; }
60 namespace sfx2 { class FileDialogHelper; }
61 
62 //------------------------------------------------------------------------
63 
64 class ScInsertTableDlg : public ModalDialog
65 {
66 public:
67             ScInsertTableDlg( Window* pParent, ScViewData& rViewData, SCTAB nTabCount, bool bFromFile );
68 			~ScInsertTableDlg();
69 
70 	virtual short	Execute();		// ueberladen, um Dialog-Parent zu setzen
71 
GetTablesFromFile()72 	sal_Bool			GetTablesFromFile()	{ return aBtnFromFile.IsChecked(); }
GetTablesAsLink()73 	sal_Bool			GetTablesAsLink()	{ return aBtnLink.IsChecked(); }
74 
75 	const String*	GetFirstTable( sal_uInt16* pN = NULL );
76 	const String*	GetNextTable( sal_uInt16* pN = NULL );
GetDocShellTables()77 	ScDocShell*		GetDocShellTables()	{ return pDocShTables; }
IsTableBefore()78 	sal_Bool			IsTableBefore() { return aBtnBefore.IsChecked(); }
GetTableCount()79 	SCTAB			GetTableCount() { return nTableCount;}
80 
81 private:
82 	FixedLine				aFlPos;
83 	RadioButton				aBtnBefore;
84 	RadioButton				aBtnBehind;
85 	FixedLine				aFlTable;
86 	RadioButton				aBtnNew;
87 	RadioButton				aBtnFromFile;
88 	FixedText				aFtCount;
89 	NumericField			aNfCount;
90 	FixedText				aFtName;
91 	Edit					aEdName;
92 	MultiListBox			aLbTables;
93 	ScExpandedFixedText		aFtPath;
94 	PushButton				aBtnBrowse;
95 	CheckBox				aBtnLink;
96 	OKButton				aBtnOk;
97 	CancelButton			aBtnCancel;
98 	HelpButton				aBtnHelp;
99 
100     Timer                   aBrowseTimer;
101     ScViewData&             rViewData;
102     ScDocument&             rDoc;
103     ScDocShell*             pDocShTables;
104     sfx2::DocumentInserter* pDocInserter;
105     SfxObjectShellRef       aDocShTablesRef;
106 
107     bool                bMustClose;
108 	sal_uInt16				nSelTabIndex;	// fuer GetFirstTable() / GetNextTable()
109 	String				aStrCurSelTable;
110 	SCTAB				nTableCount;
111 
112 #ifdef SC_INSTBDLG_CXX
113     void    Init_Impl( bool bFromFile );
114 	void	SetNewTable_Impl();
115 	void	SetFromTo_Impl();
116 	void	FillTables_Impl( ScDocument* pSrcDoc );
117 	void	DoEnable_Impl();
118 
119 	DECL_LINK( BrowseHdl_Impl, PushButton* );
120 	DECL_LINK( ChoiceHdl_Impl, RadioButton* );
121 	DECL_LINK( SelectHdl_Impl, MultiListBox* );
122 	DECL_LINK( CountHdl_Impl, NumericField* );
123 	DECL_LINK( DoEnterHdl, PushButton* );
124     DECL_LINK( BrowseTimeoutHdl, Timer* );
125     DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* );
126 #endif
127 };
128 
129 #include <layout/layout-post.hxx>
130 
131 #endif // SC_INSTBDLG_HXX
132 
133