diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:54:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:54:39 +0000 |
commit | 267c6f2ac71f92999e969232431ba04678e7437e (patch) | |
tree | 358c9467650e1d0a1d7227a21dac2e3d08b622b2 /offapi/com/sun/star/sdb/application | |
parent | Initial commit. (diff) | |
download | libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip |
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'offapi/com/sun/star/sdb/application')
12 files changed, 1280 insertions, 0 deletions
diff --git a/offapi/com/sun/star/sdb/application/CopyTableContinuation.idl b/offapi/com/sun/star/sdb/application/CopyTableContinuation.idl new file mode 100644 index 0000000000..5a504a24b0 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/CopyTableContinuation.idl @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module sdb { module application { + + +/** specifies the possible continuations when copying a table row via a + CopyTableWizard failed. + */ +constants CopyTableContinuation +{ + /** indicates the error should be ignored, and copying should be continued. + */ + const short Proceed = 0; + + /** is used to indicate the next registered XCopyTableListener should be + called. + */ + const short CallNextHandler = 1; + + /** cancels the whole copying process + */ + const short Cancel = 2; + + /** asks the user how the handle the error. + + <p>The user can choose between ignoring the error and canceling the copy + operation.</p> + */ + const short AskUser = 3; +}; + + +}; }; }; }; }; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/application/CopyTableOperation.idl b/offapi/com/sun/star/sdb/application/CopyTableOperation.idl new file mode 100644 index 0000000000..0188bb0b91 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/CopyTableOperation.idl @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module sdb { module application { + + +/** specifies the different basic operations a CopyTableWizard + can do. + + @since OOo 2.4 +*/ +constants CopyTableOperation +{ + /** specifies that the wizard should copy the source table to the target database, + by creating a new table and copying all data. + */ + const short CopyDefinitionAndData = 0; + + /** specifies that the wizard should copy the source table to the target database, + by only creating a new table with the same structure as the source table. + */ + const short CopyDefinitionOnly = 1; + + /** specifies the wizard should create the source table as view + + <p>This option is not available if the target database does not support views.</p> + */ + const short CreateAsView = 2; + + /** specifies the wizard should append the source table's data to an existing + table in the target database. + */ + const short AppendData = 3; +}; + + +}; }; }; }; }; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/application/CopyTableRowEvent.idl b/offapi/com/sun/star/sdb/application/CopyTableRowEvent.idl new file mode 100644 index 0000000000..d8c84b1580 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/CopyTableRowEvent.idl @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module sdb { module application { + + +/** specifies an event happening while copying table data between databases. + + <p>Whenever this event is fired to an XCopyTableListener, + com::sun::star::lang::EventObject::Source contains the + wizard instance which actually does the copying.</p> + + @see CopyTableWizard + */ +struct CopyTableRowEvent : ::com::sun::star::lang::EventObject +{ + /** contains the result set which is being copied by the wizard currently. + */ + ::com::sun::star::sdbc::XResultSet SourceData; + + /** denotes the error which happened while copying the data. + + <p>Usually, this contains an instance of com::sun::star::sdbc::SQLException.</p> + */ + any Error; +}; + + +}; }; }; }; }; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/application/CopyTableWizard.idl b/offapi/com/sun/star/sdb/application/CopyTableWizard.idl new file mode 100644 index 0000000000..3857262c8a --- /dev/null +++ b/offapi/com/sun/star/sdb/application/CopyTableWizard.idl @@ -0,0 +1,207 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module sdb { module application { + + +/** describes a wizard which can be used to copy table like data from one + database to another. + + <dl> + <dt><b><a name="interaction"></a>Interactions</b></dt> + <dd> + <p>There are various cases where the wizard needs to interact with the user (except of + course the obvious case to display and operate the wizard dialog itself). For those cases, + an interaction handler is needed, which is used for + <ul> + <li>fulfilling parameter requests. This might become necessary if the copy source + describes a parametrized query.</li> + <li>user interaction in case copying a row fails. If no copy table listener is + registered at the wizard, or none of the registered listener handles an error during + copying a row, or a registered listeners explicitly tells the wizard to ask the user + how to handle the error, then the interaction handler is used together with the + error (an <code>SQLException</code>, usually) that happened.</li> + <li>displaying other errors which happen during copying, in particular errors in + creating the target table or view.</li> + </ul></p> + + <p>When you do not specify an interaction handler by using the + createWithInteractionHandler() constructor, the wizard will use the interaction + handler associated with the copy target, i.e. the interaction handler specified when loading + the document which the copy target refers to. If the copy target cannot be associated with + a database document (e.g. because it is a mere <code>ConnectionResource</code>, or a connection + not obtained from a data source), or if the copy target's database document cannot provide + an interaction handler, a newly-created instance of an interaction handler is used.</p> + + <p>There's one exception to the above, however: Upon creating the copy table wizard, + the copy source and the copy target descriptors are used to create a Connection. For any + interaction during this phase - including, for instance, necessary authentication -, the + interaction handler of the respective data source is used, no matter what you specified + in createWithInteractionHandler(). Only if there is no such interaction + handler, the processing described above, to find another handler, is applied.</p> + </dd> + </dl> + + @see ::com::sun::star::sdb::ParametersRequest + @see XCopyTableWizard::addCopyTableListener + @see CopyTableContinuation + @see ::com::sun::star::document::MediaDescriptor::InteractionHandler + @see ::com::sun::star::sdb::DatabaseDocument + @see ::com::sun::star::sdb::DataSource + @see ::com::sun::star::sdb::DataAccessDescriptor::ConnectionResource + @see ::com::sun::star::sdb::InteractionHandler + + @since OOo 2.4 + */ +service CopyTableWizard : XCopyTableWizard +{ + /** creates an executable wizard dialog, which is to guide the user through copying + a table from one database to another. + + <p>At creation time, an attempt will be made to obtain the connections described + by Source resp. Dest. Failing to do so will result in an + exception.</p> + + <p>If the connection has been newly created by the wizard (e.g. because the + data access descriptor specified a <code>DataSource</code> instead of an <code>ActiveConnection</code>), + then this connection will be disposed upon disposal of the wizard.</p> + + @param Source + the com::sun::star::sdb::DataAccessDescriptor describing the + data to copy. + + <p>The following members of the <code>DataAccessDescriptor</code> are supported, and evaluated + in the given order: + <ol><li><code>ActiveConnection</code></li> + <li><code>DataSourceName</code></li> + <li><code>DatabaseLocation</code></li> + <li><code>ConnectionResource</code></li> + <li><code>ConnectionInfo</code></li> + <li><code>Command</code></li> + <li><code>CommandType</code></li> + </ol> + The first 5 items are used to obtain the connection, the last two to determine which + of the connection's objects is to be copied. Note that <code>Command</code> and <code>CommandType</code> + are required.</p> + + <p>Additionally to the obvious restrictions (such as that creating a view is not possible + if the copy source and the copy destination denote different databases), the following restrictions + apply to the settings, and possible combinations: + <ul><li>Only com::sun::star::sdb::CommandType::TABLE and + com::sun::star::sdb::CommandType::QUERY are supported.</li> + + <li>If you specify a <code>ConnectionResource</code>, or an + <code>ActiveConnection</code> which implements a com::sun::star::sdbc::Connection only + (as opposed to a com::sun::star::sdb::Connection), then the resulting connection is + not able to provide queries, thus a command type <code>QUERY</code> will be rejected.</li> + + <li><code>Filter</code>, <code>Order</code>, <code>HavingClause</code> and <code>GroupBy</code> + are unsupported at the moment.</li> + </ul> + Violating any of the above restrictions will result in an error at creation time.</p> + + @param Destination + the com::sun::star::sdb::DataAccessDescriptor describing the + target for the copy operation. + + <p>Only <code>DataSourceName</code>, <code>DatabaseLocation</code>, <code>ActiveConnection</code> + are supported, effectively describing the target connection to copy the data to. They're evaluated + in the order mentioned here, so if multiple of the are present, only the first one is evaluated.</p> + + <p>Also, at the moment the connection which is implied by either of the settings above + must support the com::sun::star::sdb::Connection service. In particular, + it is not sufficient to pass an SDBC-level connection.</p> + + <p>Note that creating a view (see CopyTableOperation::CreateAsView) is + not supported if the target connection is an SDBC-level connection only.</p> + + @throws ::com::sun::star::lang::IllegalArgumentException + if + <ul><li>either <code>Source</code> or <code>Destination</code> is `NULL`</li> + <li>either <code>Source</code> or <code>Destination</code> are not sufficient + to describe a database connection.</li> + <li><code>Source</code> is not sufficient to describe the to-be-copied data</li> + <li>either <code>Source</code> or <code>Destination</code> contain unsupported settings.</li> + </ul> + + @throws ::com::sun::star::sdbc::SQLException + if an error occurs during obtaining the source or destination connection. Those errors + are passed unchanged to the creator of the wizard. + + @throws ::com::sun::star::lang::WrappedTargetException + if an error other than the ones mentioned above occurs while extracting the necessary + information from any of the data access descriptors. For instance, this might + be a com::sun::star::sdbc::SQLException thrown upon connecting + to a data source described by the descriptor's <code>DataSourceName</code> member. + + @see ::com::sun::star::sdb::DataAccessDescriptor + */ + create( + [in] ::com::sun::star::beans::XPropertySet Source, + [in] ::com::sun::star::beans::XPropertySet Destination + ) + raises ( ::com::sun::star::lang::IllegalArgumentException + , ::com::sun::star::sdbc::SQLException + , ::com::sun::star::lang::WrappedTargetException + ); + + /** creates an executable wizard dialog, which is to guide the user through copying + a table from one database to another. + + <p>The only difference to the create() constructor is that + <code>createWithInteractionHandler</code> takes an additional argument, which + can be used to intercept interactions (such as error messages) during the wizard + run.</p> + + @param Source + the com::sun::star::sdb::DataAccessDescriptor describing the + source for the copy operation. + + @param Destination + the com::sun::star::sdb::DataAccessDescriptor describing the + target for the copy operation. + + @param InteractionHandler + specifies an interaction handler to use when user input is required. + + <p>When specifying this parameter, you should use an implementation + supporting the com::sun::star::sdb::InteractionHandler, since + the general-purpose com::sun::star::task::InteractionHandler cannot + handle all requests described <a href="#interaction">above</a>.</p> + + @see ::com::sun::star::sdb::InteractionHandler + */ + createWithInteractionHandler( + [in] ::com::sun::star::beans::XPropertySet Source, + [in] ::com::sun::star::beans::XPropertySet Destination, + [in] ::com::sun::star::task::XInteractionHandler InteractionHandler + ) + raises ( ::com::sun::star::lang::IllegalArgumentException + , ::com::sun::star::sdbc::SQLException + , ::com::sun::star::lang::WrappedTargetException + ); + +}; + + +}; }; }; }; }; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/application/DatabaseObject.idl b/offapi/com/sun/star/sdb/application/DatabaseObject.idl new file mode 100644 index 0000000000..d4c5d051b7 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/DatabaseObject.idl @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module sdb { module application { + + +/** denotes different objects within a database document + + @since OOo 2.2 + + @see DatabaseObjectContainer + */ +constants DatabaseObject +{ + /** denotes a table in a database + + <p>Note that <em>table</em> here is a more general term. In OpenOffice.org Base, + views are also represented as tables, since to the user, the behave pretty much + as tables do.</p> + */ + const long TABLE = com::sun::star::sdb::CommandType::TABLE; + + /** denotes a query in a database document + */ + const long QUERY = com::sun::star::sdb::CommandType::QUERY; + + /** denotes a form in a database document + */ + const long FORM = 2; + + /** denotes a report in a database document + */ + const long REPORT = 3; +}; + + +}; }; }; }; }; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/application/DatabaseObjectContainer.idl b/offapi/com/sun/star/sdb/application/DatabaseObjectContainer.idl new file mode 100644 index 0000000000..acd61864fb --- /dev/null +++ b/offapi/com/sun/star/sdb/application/DatabaseObjectContainer.idl @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module sdb { module application { + + +/** denotes different types of (maybe virtual) containers of database objects + + <p>In the database application of OpenOffice.org, database objects (such as + tables, queries, forms, reports) can be organized in folders. This hierarchy can + be imposed externally, or internally. + + <p>For example, when you connect to a database which supports catalogs and/or schemas, + then those impose a natural order on the tables, in that a catalog or a schema + is a folder of tables.</p> + + <p>On the other hand, for forms and reports, OpenOffice.org Base itself allows the + user to create folders to organize the documents - in this case, the hierarchy is + defined in the database document itself.</p> + + @see DatabaseObject + + @since OOo 3.0 + */ +constants DatabaseObjectContainer +{ + /** denotes the virtual folder containing all tables of a database, in a context where such a + folder is displayed to the user. + */ + const long TABLES = 1000; + + /** denotes the virtual folder containing all queries of a database, in a context where such a + folder is displayed to the user. + */ + const long QUERIES = 1001; + + /** denotes the virtual folder containing all forms of a database document, in a context where such a + folder is displayed to the user. + */ + const long FORMS = 1002; + + /** denotes the virtual folder containing all reports of a database, in a context where such a + folder is displayed to the user. + */ + const long REPORTS = 1003; + + /** denotes the data source itself, which effectively is the root container for all other + kind of database objects, including other container types. + */ + const long DATA_SOURCE = 1004; + + /** denotes a catalog in a database which supports catalogs + */ + const long CATALOG = 1005; + + /** denotes a schema in a database which supports schemas + */ + const long SCHEMA = 1006; + + /** denotes a folder which is used to organize forms in a database document + */ + const long FORMS_FOLDER = 1007; + + /** denotes a folder which is used to organize reports in a database document + */ + const long REPORTS_FOLDER = 1008; +}; + + +}; }; }; }; }; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/application/DefaultViewController.idl b/offapi/com/sun/star/sdb/application/DefaultViewController.idl new file mode 100644 index 0000000000..72495b45ad --- /dev/null +++ b/offapi/com/sun/star/sdb/application/DefaultViewController.idl @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module sdb { module application { + + +/** is the default controller implementation for OpenOffice.org's database application. + */ +service DefaultViewController +{ + /** defines basic controller functionality + */ + service ::com::sun::star::frame::Controller; + + /** allows intercepting context menu requests done by the user + + <p>The ::com::sun::star::ui::ContextMenuExecuteEvent::Selection member + of the event passed to an interceptor will <em>not</em> be the controller itself + (though the controller also supports the <a href="#XSelectionSupplier"><code>XSelectionSupplier</code></a> + interface), but a component which describes the current selection of the very window where the context + menu was requested.</p> + + <p>In OpenOffice.org's database application, database objects such as tables, queries, forms, + reports are displayed in a tree-like fashion. Currently, only context menu requests on this tree view + can be intercepted using the <code>XContextMenuInterception</code> interface. Context menu requests + in other places cannot be intercepted.</p> + + <p>For the aforementioned tree view, the selection supplied by the <code>ContextMenuEvent::Selection</code> + component is an array of NamedDatabaseObject instances.</p> + */ + interface ::com::sun::star::ui::XContextMenuInterception; + + /** allows intercepting user input done by the user + */ + interface ::com::sun::star::awt::XUserInputInterception; + + /** <a name="XSelectionSupplier"></a> + provides access to the current selection inside the application window, and allows to change it + programmatically + + <p>The selection is an array of NamedDatabaseObject instances.</p> + */ + interface ::com::sun::star::view::XSelectionSupplier; + + /** allows to retrieve and set the title which of the component + */ + interface ::com::sun::star::frame::XTitle; + + /** allows being notified about changes in the component's title + */ + interface ::com::sun::star::frame::XTitleChangeBroadcaster; + + /** allows programmatic access to aspects of the application's user interface. + */ + interface XDatabaseDocumentUI; +}; + + +}; }; }; }; }; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/application/NamedDatabaseObject.idl b/offapi/com/sun/star/sdb/application/NamedDatabaseObject.idl new file mode 100644 index 0000000000..df8f6e7547 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/NamedDatabaseObject.idl @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module sdb { module application { + + +/** denotes a named database object, or a named folder of database objects + + @since OOo 3.0 +*/ +struct NamedDatabaseObject +{ + /** denotes the type of the object. + + <p>This member is one of the DatabaseObject or DatabaseObjectContainer constants.</p> + */ + long Type; + + /** denotes the name of the object + + <p>In case of forms, reports, form folders and report folders, this is the hierarchical + path to the object, where the path elements are separated by a slash (<code>/</code>).</p> + + <p>In case of tables, this is the fully qualified name of the table, as required + by the database's table name composition rules.</p> + + <p>In case of queries, this is the name of the query.</p> + + <p>In case of virtual folders denoted by DatabaseObjectContainer::CATALOG and + DatabaseObjectContainer::SCHEMA, it is + <ul><li><code><schema></code>, if the database supports schemas only</li> + <li><code><catalog></code>, if the database supports catalogs only</li> + <li><code><catalog>.<schema></code>, if the database supports both + catalogs and schemas, and catalogs are to appear at the beginning of an identifier.</li> + <li><code><schema>.<catalog></code>, if the database supports both + catalogs and schemas, and catalogs are to appear at the end of an identifier.</li> + </ul> + </p> + + <p>In case of the virtual folders denoted by DatabaseObjectContainer::TABLES, + DatabaseObjectContainer::QUERIES, DatabaseObjectContainer::DATA_SOURCE, + DatabaseObjectContainer::FORMS or DatabaseObjectContainer::REPORTS, + this denotes the name of the data source (as denoted by + com::sun::star::sdb::DataSource::Name)</p> + + @see XDatabaseMetaData::isCatalogAtStart + @see DatabaseObjectContainer + */ + string Name; +}; + + +}; }; }; }; }; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/application/XCopyTableListener.idl b/offapi/com/sun/star/sdb/application/XCopyTableListener.idl new file mode 100644 index 0000000000..df9c6211b8 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/XCopyTableListener.idl @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module sdb { module application { + + +/** specifies the interface required to listen for progress in copying + table rows via a <code>CopyTableWizard</code>. + + @see CopyTableRowEvent + @see CopyTableWizard + */ +interface XCopyTableListener : ::com::sun::star::lang::XEventListener +{ + /** is called when a row is about to be copied. + + <p>This method is called immediately before a row is copied. It might be used, for instance, + to update a progress indicator.</p> + + @param Event + describes the current state of the copy operation. + CopyTableRowEvent::SourceData is positioned at the row + which is about to be copied. + */ + void copyingRow( [in] CopyTableRowEvent Event ); + + /** is called when a row was successfully copied. + + <p>This method is called right after a row has been successfully copied. It might be used, + for instance, to update a progress indicator.</p> + + @param Event + describes the current state of the copy operation. + CopyTableRowEvent::SourceData is positioned at the row + which was just copied to the target database. + */ + void copiedRow( [in] CopyTableRowEvent Event ); + + /** is called when copying a row failed. + + @param Event + describes the current state of the copy operation. + CopyTableRowEvent::SourceData is positioned at the row + which was attempted to be copied to the target database. + CopyTableRowEvent::Error will contain the actual error which + happened. + + @return + how to continue with copying. Must be one of the CopyTableContinuation + constants. + */ + short copyRowError( [in] CopyTableRowEvent Event ); +}; + + +}; }; }; }; }; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/application/XCopyTableWizard.idl b/offapi/com/sun/star/sdb/application/XCopyTableWizard.idl new file mode 100644 index 0000000000..8fa13204d6 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/XCopyTableWizard.idl @@ -0,0 +1,128 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +module com { module sun { module star { module sdb { module application { + +interface XCopyTableListener; + + +/** describes a wizard which can be used to copy table like data from one + database to another. + + <p>Copying table data between databases can be a complex task. Especially when + it comes to matching field types in the source and in the target database, + some heuristics, and sometimes support from the user doing the operation, + are required.</p> + + <p>The <code>copy table wizard</code> described by this interfaces cares for those, + and other, settings.</p> + + @since OOo 2.4 + */ +interface XCopyTableWizard : ::com::sun::star::ui::dialogs::XExecutableDialog +{ + /** specifies the basic operation for the wizard to execute. + + <p>This must be one of the CopyTableOperation constants.</p> + + <p>At initialization time, you can use this attribute to control the + initial operation in the wizard.</p> + + <p>After the wizard has finished, you can use this attribute to determine + what operation was actually executed.</p> + + <p>Changing this attribute while the dialog is running is not supported, the + result of such an attempt is undefined.</p> + + @throws IllegalArgumentException + if you attempt to set an invalid operation, or if the given operation is + not supported by the target database type, e.g. if you specified + CopyTableOperation::CreateAsView where the database + does not support views. + */ + [attribute] short Operation + { + set raises ( ::com::sun::star::lang::IllegalArgumentException ); + }; + + /** specifies the name of the table in the destination database. + + <p>At initialization time, you can use this attribute to control the + initial table name as suggested to the user.</p> + + <p>After the wizard has finished, you can use this attribute to determine + what table was actually created resp. to which existing table the source + table's data was appended.</p> + + <p>Changing this attribute while the dialog is running is not supported, the + result of such an attempt is undefined.</p> + */ + [attribute] string DestinationTableName; + + /** specifies that a new primary key is to be created in the target database + + <p>At initialization time, you can specify the initial settings for the primary + key in the UI.</p> + + <p>You cannot use this attribute to determine the primary key, possibly created + by the wizard, after it finished. The reason is that during the wizard run, the + user can define an arbitrarily complex primary key, e.g. including multiple columns, + which cannot be represented in this simple attribute anymore.</p> + + <p>This attribute is ignored if #Operation is + CopyTableOperation::AppendData.</p> + + <p>Changing this attribute while the dialog is running is not supported, the + result of such an attempt is undefined.</p> + + <p>When a primary key is to be created by the wizard, it will be an auto-increment + column, if possible.</p> + + @throws ::com::sun::star::lang::IllegalArgumentException + if the target database does not support primary keys + */ + [attribute] ::com::sun::star::beans::Optional< string > + CreatePrimaryKey + { + set raises ( ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::sdbc::SQLException ); + }; + + /** specifies that the first row should be used to identify column names. + + <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 + e.g. in the RTF format or in the HTML format. + </p> + */ + [attribute] boolean UseHeaderLineAsColumnNames; + + /** adds a listener which is to be notified of progress in the copy operation + */ + void addCopyTableListener( [in] XCopyTableListener Listener ); + + /** removes a listener + */ + void removeCopyTableListener( [in] XCopyTableListener Listener ); +}; + + +}; }; }; }; }; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/application/XDatabaseDocumentUI.idl b/offapi/com/sun/star/sdb/application/XDatabaseDocumentUI.idl new file mode 100644 index 0000000000..c07c636363 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/XDatabaseDocumentUI.idl @@ -0,0 +1,307 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module sdb { module application { + + +/** provides access to the user interface of a database document + + <p>This interface is available when a database document has been loaded into + a frame, at the controller of this frame.</p> + + @see com::sun::star::frame::Controller + @see com::sun::star::sdb::DatabaseDocument + + @since OOo 2.2 + */ +interface XDatabaseDocumentUI +{ + /** provides access to the data source belong to the database document + */ + [attribute, readonly] com::sun::star::sdbc::XDataSource DataSource; + + /** provides access to the application's main window + + <p>Note that reading this attribute is equivalent to querying the component + for the com::sun::star::frame::XController interface, + asking the controller for its frame, and asking this frame for its + container window.</p> + + @see ::com::sun::star::frame::XController + @see ::com::sun::star::frame::XFrame + */ + [attribute, readonly] com::sun::star::awt::XWindow ApplicationMainWindow; + + /** provides access to the current connection of the application + + <p>Note that the connection returned here is really the working connection + of the application. Clients should not misuse it, in particular, closing + the connection can yield unexpected results and should definitely be + avoided. If you need a separate connection to the data source, use + com::sun::star::sdbc::XDataSource::getConnection().</p> + */ + [attribute, readonly] com::sun::star::sdbc::XConnection ActiveConnection; + + /** determines whether the application is currently connected to the database + */ + boolean isConnected(); + + /** lets the application connect to the database + + <p>If the application is already connected, nothing happens. If it is not + connected, the application will try to establish a connection by using + com::sun::star::sdbc::XDataSource::getConnection() + with the current settings, as specified in the + com::sun::star::sdb::DataSource::Settings member.</p> + + <p>If the connection cannot be established, the respective error message is shown + in the application window.</p> + + @throws ::com::sun::star::sdbc::SQLException + if the connection cannot be established + */ + void connect() + raises ( ::com::sun::star::sdbc::SQLException ); + + /** contains all sub components of the database document + + <p>During working with the database, the user might open different sub components: + forms, reports, tables, queries. Those components are tracked by the application, + and provided in this attribute.</p> + + <p>The components here might either be documents (com::sun::star::frame::XModel), + controllers (com::sun::star::frame::XController), or frames + (com::sun::star::frame::XFrame). + + @since OOo 3.0 + */ + [attribute, readonly] sequence< ::com::sun::star::lang::XComponent > + SubComponents; + + /** identifies the given sub component + + @param SubComponent + the component to identify. Must be one of the components in #SubComponents. + + @return + a record describing the sub component. The first element of the returned pair is the type + of the component, denoted by one of the DatabaseObject constants. The second + element is the name of the component. For object types which support nested structures (forms + and reports, actually), this might be a hierarchical name. If the sub component has been newly created, + and not yet saved, this name is empty. + + @throws ::com::sun::star::lang::IllegalArgumentException + if the given component is not one of the controller's sub components + */ + ::com::sun::star::beans::Pair< long, string > + identifySubComponent( + [in] ::com::sun::star::lang::XComponent SubComponent + ) + raises ( + ::com::sun::star::lang::IllegalArgumentException + ); + + /** closes all sub components of the database document. + + <p>During working with the database, the user might open different sub components: + forms, reports, tables, queries. If you need to close all those documents, use + <code>closeSubComponents</code>, which will gracefully do this.</p> + + <p>In a first step, the sub components will be suspended + (com::sun::star::frame::XController::suspend()). There + are basically two reasons why suspending a single sub component can fail: The + user might veto it (she's asked if the document is currently modified), and + the component might be uncloseable currently, e.g. due to an open modal + dialog, or a long-lasting operation running currently (e.g. printing).</p> + + <p>Once all sub components have been suspended, they will, in a second step, + be closed. Again, closing might be vetoed by other instances, e.g. by a close + listener registered at the component.</p> + + @return + `TRUE` if and only if both suspending and closing all sub components succeeds. + + @since OOo 3.0 + */ + boolean closeSubComponents(); + + /** loads the given sub component of the database document + + <p>This method allows programmatic access to the functionality which is present in the UI: + it allows opening a table, query, form, or report for either editing or viewing.</p> + + <p>This method is a convenience wrapper for API which is also available otherwise. For instance, + for loading forms and reports, you could use the com::sun::star::frame::XComponentLoader + interface of the ::com::sun::star::sdb::Forms resp. ::com::sun::star::sdb::Reports + collections.</p> + + <p>Note there must exist a connection to the database before you can call this method.</p> + + <p>If an error occurs opening the given object, then this is reported to the user via an error dialog.</p> + + @see isConnected + @see connect + + @param ObjectType + specifies the type of the object, must be one of the DatabaseObject + constants. + + @param ObjectName + specifies the name of the object. In case hierarchical objects are supported + (as is the case form forms and reports), hierarchical names are supported here, too. + + @param ForEditing + specifies whether the object should be opened for editing (`TRUE`) or viewing (`FALSE`). + + <p>For the different object types, this means the following + <a name="component_types"></a> + <table style="width:100%;" border="1 solid black" cellpadding="2" cellspacing="2"> + <tr style="vertical-align: top;"> + <td></td> + <td><code>ForEditing</code> = `TRUE`</td> + <td><code>ForEditing</code> = `FALSE`</td> + </tr> + + <tr style="vertical-align: top;"> + <td><em>Tables</em></td> + <td>A table designer is opened, and allows to edit the structure of the table. + See also ::com::sun::star::sdb::TableDesign</td> + <td>A table data view is opened, and allows to view and edit the data contained in the table. + See also ::com::sun::star::sdb::DataSourceBrowser</td> + </tr> + + <tr style="vertical-align: top;"> + <td><em>Queries</em></td> + <td>A query designer is opened, and allows to edit the statement constituting the query. + See also ::com::sun::star::sdb::QueryDesign</td> + <td>A table data view is opened, and allows to view and edit the data contained in the query. + See also ::com::sun::star::sdb::DataSourceBrowser</td> + </tr> + + <tr style="vertical-align: top;"> + <td><em>Forms</em></td> + <td>The form document is opened in design mode, that is, you can modify it.</td> + <td>The form document is opened in read-only mode, allowing you to view and enter the data + which the form is based on, but not the form design.</td> + </tr> + + <tr style="vertical-align: top;"> + <td><em>Reports</em></td> + <td>The report document is opened in design mode, that is, you can modify it.</td> + <td>The report is executed, and the results will be displayed.</td> + </tr> + + </table> + </p> + + @return + the component which has been loaded. This is either a com::sun::star::frame::XModel, + or a com::sun::star::frame::XController if the component does is model-less. + + @throws ::com::sun::star::lang::IllegalArgumentException + if ObjectType denotes an invalid object type + + @throws ::com::sun::star::container::NoSuchElementException + if an object with the given name and of the given type does not exist + + @throws ::com::sun::star::sdbc::SQLException + if there is no connection to the database at the time the method is called. + */ + ::com::sun::star::lang::XComponent loadComponent( + [in] long ObjectType, + [in] string ObjectName, + [in] boolean ForEditing ) + raises ( ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::container::NoSuchElementException, + ::com::sun::star::sdbc::SQLException ); + + /** loads the given sub component of the database document + + <p>In opposite to loadComponent(), this method allows you to specify + additional arguments which are passed to the to-be-loaded component.</p> + + <p>The meaning of the arguments is defined at the service which is effectively + created. See the <a href="#component_types">above table</a> for a list of those + services.</p> + */ + ::com::sun::star::lang::XComponent loadComponentWithArguments( + [in] long ObjectType, + [in] string ObjectName, + [in] boolean ForEditing, + [in] sequence< ::com::sun::star::beans::PropertyValue > Arguments ) + raises ( ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::container::NoSuchElementException, + ::com::sun::star::sdbc::SQLException ); + + /** creates a new sub component of the given type + + @param ObjectType + specifies the type of the object, must be one of the DatabaseObject + constants. + + @param DocumentDefinition + Upon successful return, and if and only if ObjectType equals DatabaseObject::FORM + or DatabaseObject::REPORT, this will contain the com::sun::star::sdb::DocumentDefinition + object which controls the sub component. + */ + ::com::sun::star::lang::XComponent createComponent( + [in] long ObjectType, + [out] ::com::sun::star::lang::XComponent DocumentDefinition ) + raises ( ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::sdbc::SQLException ); + + /** creates a new sub component of the given type + + <p>In opposite to createComponent(), this method allows you to specify + additional arguments which are passed to the to-be-loaded component.</p> + + + @param ObjectType + specifies the type of the object, must be one of the DatabaseObject + constants. + + @param Arguments + The meaning of the arguments is defined at the service which is + effectively created. See the <a href="#component_types">above + table</a> for a list of those services. + + @param DocumentDefinition + Upon successful return, and if and only if ObjectType equals DatabaseObject::FORM + or DatabaseObject::REPORT, this will contain the com::sun::star::sdb::DocumentDefinition + object which controls the sub component.<br/> + You can use this object to control various aspects of the sub component. For instance, you could decide + to create the component hidden, by passing a <code>Hidden</code> flag (set to `TRUE`) in Arguments, + manipulate the component, and then finally show it by invoking the <code>show</code> command at the + definition object. + */ + ::com::sun::star::lang::XComponent createComponentWithArguments( + [in] long ObjectType, + [in] sequence< ::com::sun::star::beans::PropertyValue > Arguments, + [out] ::com::sun::star::lang::XComponent DocumentDefinition ) + raises ( ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::container::NoSuchElementException, + ::com::sun::star::sdbc::SQLException ); +}; + + +}; }; }; }; }; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/application/XTableUIProvider.idl b/offapi/com/sun/star/sdb/application/XTableUIProvider.idl new file mode 100644 index 0000000000..fbb9573981 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/XTableUIProvider.idl @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module sdb { module application { + +interface XDatabaseDocumentUI; + + +/** is used by the database application to obtain non-default user + interface information and/or components for database tables. + + @see com::sun::star::sdb::Connection + + @since OOo 2.2 + */ +interface XTableUIProvider +{ + /** provides the icon which should be used to represent the table in the + database application window. + + <p>The icon will usually be requested once per table, and cached. It + might be requested again if the application settings change, for instance, + if another desktop theme has been activated.</p> + + @param TableName + denotes the fully qualified name of the database table. + + @param ColorMode + denotes the color mode of the graphic to retrieve, being one of the + com::sun::star::graphic::GraphicColorMode constants. + @return + the icon which should be used to represent the table in the + database application window, or `NULL` if the default icon + should be used. + */ + com::sun::star::graphic::XGraphic getTableIcon( + [in] string TableName, [in] long ColorMode ); + + /** returns a component which can be used to edit the definition of an + existing table. + + @param DocumentUI + provides access to the UI in which the database document is + currently displayed.<br/> + In particular, this parameter provides access to the application's main + window, which is needed in case the table editor should be a dialog. + + @param TableName + denotes the fully qualified name of an existing table. + + @return + a component which can be used to edit the definition of an + existing table, or `NULL` if the default component should + be used.<br/> + Two component types are supported so far + <ul><li>modal dialogs<br/> + If the returned component supports the + com::sun::star::ui::dialogs::XExecutableDialog + interface, the dialog will be executed modally.</li> + <li>modeless frames<br/> + If the returned component supports the + com::sun::star::frame::XController + interface, it is assumed that it represents a controller, + loaded into a new frame, which is a modeless and, in its lifetime, + depends on the application main window.</li> + </ul> + If the returned component does not support any of the above-mentioned + interfaces, it's discarded. + + @throws ::com::sun::star::lang::IllegalArgumentException + if the given TableName does not denote an existing table + + @throws ::com::sun::star::lang::WrappedTargetException + if an error occurs while creating the table editor component. + */ + com::sun::star::uno::XInterface getTableEditor( + [in] XDatabaseDocumentUI DocumentUI, + [in] string TableName ) + raises (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException); +}; + + +}; }; }; }; }; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |