1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir
28*cdf0e10cSrcweir#ifndef __com_sun_star_sdb_application_XCopyTableWizard_idl__
29*cdf0e10cSrcweir#define __com_sun_star_sdb_application_XCopyTableWizard_idl__
30*cdf0e10cSrcweir
31*cdf0e10cSrcweir#ifndef __com_sun_star_ui_dialogs_XExecutableDialog_idl__
32*cdf0e10cSrcweir#include <com/sun/star/ui/dialogs/XExecutableDialog.idl>
33*cdf0e10cSrcweir#endif
34*cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
35*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
36*cdf0e10cSrcweir#endif
37*cdf0e10cSrcweir#ifndef __com_sun_star_beans_Optional_idl__
38*cdf0e10cSrcweir#include <com/sun/star/beans/Optional.idl>
39*cdf0e10cSrcweir#endif
40*cdf0e10cSrcweir
41*cdf0e10cSrcweir//=============================================================================
42*cdf0e10cSrcweir
43*cdf0e10cSrcweirmodule com { module sun { module star { module sdb { module application {
44*cdf0e10cSrcweir
45*cdf0e10cSrcweirinterface XCopyTableListener;
46*cdf0e10cSrcweir
47*cdf0e10cSrcweir//=============================================================================
48*cdf0e10cSrcweir
49*cdf0e10cSrcweir/** describes a wizard which can be used to copy table like data from one
50*cdf0e10cSrcweir    database to another.
51*cdf0e10cSrcweir
52*cdf0e10cSrcweir    <p>Copying table data between databases can be a complex task. Especially when
53*cdf0e10cSrcweir    it comes to matching field types in the source and in the target database,
54*cdf0e10cSrcweir    some heuristics, and sometimes support from the user doing the operation,
55*cdf0e10cSrcweir    are required.</p>
56*cdf0e10cSrcweir
57*cdf0e10cSrcweir    <p>The <code>copy table wizard</code> described by this interfaces cares for those,
58*cdf0e10cSrcweir    and other, settings.</p>
59*cdf0e10cSrcweir
60*cdf0e10cSrcweir    @since OOo 2.4
61*cdf0e10cSrcweir */
62*cdf0e10cSrcweirinterface XCopyTableWizard : ::com::sun::star::ui::dialogs::XExecutableDialog
63*cdf0e10cSrcweir{
64*cdf0e10cSrcweir    /** specifies the basic operation for the wizard to execute.
65*cdf0e10cSrcweir
66*cdf0e10cSrcweir        <p>This must be one of the <type>CopyTableOperation</type> constants.</p>
67*cdf0e10cSrcweir
68*cdf0e10cSrcweir        <p>At initialization time, you can use this attribute to control the
69*cdf0e10cSrcweir        initial operation in the wizard.</p>
70*cdf0e10cSrcweir
71*cdf0e10cSrcweir        <p>After the wizard has finished, you can use this attribute to determine
72*cdf0e10cSrcweir        what operation was actually executed.</p>
73*cdf0e10cSrcweir
74*cdf0e10cSrcweir        <p>Changing this attribute while the dialog is running is not supported, the
75*cdf0e10cSrcweir        result of such an attempt is undefined.</p>
76*cdf0e10cSrcweir
77*cdf0e10cSrcweir        @throws IllegalArgumentException
78*cdf0e10cSrcweir            if you attempt to set an invalid operation, or if the given operation is
79*cdf0e10cSrcweir            not supported by the target database type, e.g. if you specified
80*cdf0e10cSrcweir            <member>CopyTableOperation::CreateAsView</member> where the database
81*cdf0e10cSrcweir            does not support views.
82*cdf0e10cSrcweir    */
83*cdf0e10cSrcweir    [attribute] short Operation
84*cdf0e10cSrcweir    {
85*cdf0e10cSrcweir        set raises ( ::com::sun::star::lang::IllegalArgumentException );
86*cdf0e10cSrcweir    };
87*cdf0e10cSrcweir
88*cdf0e10cSrcweir    /** specfies the name of the table in the destination database.
89*cdf0e10cSrcweir
90*cdf0e10cSrcweir        <p>At initialization time, you can use this attribute to control the
91*cdf0e10cSrcweir        initial table name as suggested to the user.</p>
92*cdf0e10cSrcweir
93*cdf0e10cSrcweir        <p>After the wizard has finished, you can use this attribute to determine
94*cdf0e10cSrcweir        what table was actually created resp. to which existing table the source
95*cdf0e10cSrcweir        table's data was appended.</p>
96*cdf0e10cSrcweir
97*cdf0e10cSrcweir        <p>Changing this attribute while the dialog is running is not supported, the
98*cdf0e10cSrcweir        result of such an attempt is undefined.</p>
99*cdf0e10cSrcweir    */
100*cdf0e10cSrcweir    [attribute] string  DestinationTableName;
101*cdf0e10cSrcweir
102*cdf0e10cSrcweir    /** specifies that a new primary key is to be created in the target database
103*cdf0e10cSrcweir
104*cdf0e10cSrcweir        <p>At initialization time, you can specify the initial settings for the primary
105*cdf0e10cSrcweir        key in the UI.</p>
106*cdf0e10cSrcweir
107*cdf0e10cSrcweir        <p>You cannot use this attribute to determine the primary key, possibly created
108*cdf0e10cSrcweir        by the wizard, after it finished. The reason is that during the wizard run, the
109*cdf0e10cSrcweir        user can define an arbitrarily complex primary key, e.g. including multiple columns,
110*cdf0e10cSrcweir        which cannot be represented in this simple attribute anymore.</p>
111*cdf0e10cSrcweir
112*cdf0e10cSrcweir        <p>This attribute is ignored if <member>Operation</member> is
113*cdf0e10cSrcweir        <member>CopyTableOperation::AppendData</member>.</p>
114*cdf0e10cSrcweir
115*cdf0e10cSrcweir        <p>Changing this attribute while the dialog is running is not supported, the
116*cdf0e10cSrcweir        result of such an attempt is undefined.</p>
117*cdf0e10cSrcweir
118*cdf0e10cSrcweir        <p>When a primary key is to be created by the wizard, it will be be an auto-increment
119*cdf0e10cSrcweir        column, if possible.</p>
120*cdf0e10cSrcweir
121*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IllegalArgumentException
122*cdf0e10cSrcweir            if the target database does not support primary keys
123*cdf0e10cSrcweir    */
124*cdf0e10cSrcweir    [attribute] ::com::sun::star::beans::Optional< string >
125*cdf0e10cSrcweir                        CreatePrimaryKey
126*cdf0e10cSrcweir    {
127*cdf0e10cSrcweir        set raises ( ::com::sun::star::lang::IllegalArgumentException );
128*cdf0e10cSrcweir    };
129*cdf0e10cSrcweir
130*cdf0e10cSrcweir    /** specifies that the first row should be used to identify column names.
131*cdf0e10cSrcweir
132*cdf0e10cSrcweir        <p>This attribute is ignored when the source defines the column names which isn't the case when only a part of a table should be copied
133*cdf0e10cSrcweir        e.g. in the RTF format or in the HTML format.
134*cdf0e10cSrcweir        </p>
135*cdf0e10cSrcweir    */
136*cdf0e10cSrcweir    [attribute] boolean UseHeaderLineAsColumnNames;
137*cdf0e10cSrcweir
138*cdf0e10cSrcweir    /** adds a listener which is to be notified of progress in the copy operation
139*cdf0e10cSrcweir    */
140*cdf0e10cSrcweir    void    addCopyTableListener( [in] XCopyTableListener Listener );
141*cdf0e10cSrcweir
142*cdf0e10cSrcweir    /** removes a listener
143*cdf0e10cSrcweir    */
144*cdf0e10cSrcweir    void    removeCopyTableListener( [in] XCopyTableListener Listener );
145*cdf0e10cSrcweir};
146*cdf0e10cSrcweir
147*cdf0e10cSrcweir//=============================================================================
148*cdf0e10cSrcweir
149*cdf0e10cSrcweir}; }; }; }; };
150*cdf0e10cSrcweir
151*cdf0e10cSrcweir//=============================================================================
152*cdf0e10cSrcweir
153*cdf0e10cSrcweir#endif
154