1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dbinsdlg.hxx,v $
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 ************************************************************************/
35 #ifndef _BUTTON_HXX //autogen
36 #include <vcl/button.hxx>
38 #ifndef _GROUP_HXX //autogen
39 #include <vcl/group.hxx>
41 #ifndef _FIXED_HXX //autogen
42 #include <vcl/fixed.hxx>
44 #ifndef _EDIT_HXX //autogen
45 #include <vcl/edit.hxx>
47 #include <vcl/lstbox.hxx>
48 #include <svtools/svmedit.hxx>
49 #include <sfx2/basedlgs.hxx>
50 #include <svtools/svarray.hxx>
51 #include <unotools/configitem.hxx>
52 #include <numfmtlb.hxx>
53 #include <swdbdata.hxx>
54 #include <com/sun/star/uno/Reference.h>
55 #include <com/sun/star/uno/Sequence.h>
56 namespace com
{namespace sun
{namespace star
{
58 class XColumnsSupplier
;
75 rtl::OUString sColumn
, sUsrNumFmt
;
77 sal_uInt32 nUsrNumFmt
;
78 LanguageType eUsrNumFmtLng
;
83 SwInsDBColumn( const String
& rStr
, USHORT nColumn
)
87 eUsrNumFmtLng( LANGUAGE_SYSTEM
),
93 int operator==( const SwInsDBColumn
& rCmp
) const
94 { return sColumn
== rCmp
.sColumn
; }
95 int operator<( const SwInsDBColumn
& rCmp
) const;
98 typedef SwInsDBColumn
* SwInsDBColumnPtr
;
99 SV_DECL_PTRARR_SORT_DEL( SwInsDBColumns
, SwInsDBColumnPtr
, 32, 32 )
102 class SwInsertDBColAutoPilot
: public SfxModalDialog
, public utl::ConfigItem
104 FixedText aFtInsertData
;
105 RadioButton aRbAsTable
;
106 RadioButton aRbAsField
;
107 RadioButton aRbAsText
;
110 FixedText aFtDbColumn
;
112 ListBox aLbTblDbColumn
;
113 ListBox aLbTxtDbColumn
;
116 RadioButton aRbDbFmtFromDb
;
117 RadioButton aRbDbFmtFromUsr
;
118 NumFormatListBox aLbDbFmtFromUsr
;
120 /* ----- Page Text/Field ------- */
121 ImageButton aIbDbcolToEdit
;
122 MultiLineEdit aEdDbText
;
123 FixedText aFtDbParaColl
;
124 ListBox aLbDbParaColl
;
126 /* ----- Page Table ------------ */
127 ImageButton aIbDbcolAllTo
;
128 ImageButton aIbDbcolOneTo
;
129 ImageButton aIbDbcolOneFrom
;
130 ImageButton aIbDbcolAllFrom
;
131 FixedText aFtTableCol
;
133 CheckBox aCbTableHeadon
;
134 RadioButton aRbHeadlColnms
;
135 RadioButton aRbHeadlEmpty
;
136 PushButton aPbTblFormat
;
137 PushButton aPbTblAutofmt
;
140 CancelButton aBtCancel
;
145 SwInsDBColumns aDBColumns
;
146 const SwDBData aDBData
;
152 SwTableAutoFmt
* pTAutoFmt
;
158 DECL_LINK( PageHdl
, Button
* );
159 DECL_LINK( AutoFmtHdl
, PushButton
* );
160 DECL_LINK( TblFmtHdl
, PushButton
* );
161 DECL_LINK( DBFormatHdl
, Button
* );
162 DECL_LINK( TblToFromHdl
, Button
* );
163 DECL_LINK( SelectHdl
, ListBox
* );
164 DECL_LINK( DblClickHdl
, ListBox
* );
165 DECL_LINK( HeaderHdl
, Button
* );
167 BOOL
SplitTextToColArr( const String
& rTxt
, _DB_Columns
& rColArr
, BOOL bInsField
);
170 virtual void Commit();
173 // setze die Tabellen - Eigenschaften
177 SwInsertDBColAutoPilot( SwView
& rView
,
178 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XDataSource
> rxSource
,
179 com::sun::star::uno::Reference
<com::sun::star::sdbcx::XColumnsSupplier
>,
180 const SwDBData
& rData
);
182 virtual ~SwInsertDBColAutoPilot();
184 void DataToDoc( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& rSelection
,
185 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XDataSource
> rxSource
,
186 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
> xConnection
,
187 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSet
> xResultSet
);