From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- .../star/sdb/application/CopyTableContinuation.idl | 59 ++++ .../star/sdb/application/CopyTableOperation.idl | 62 ++++ .../sun/star/sdb/application/CopyTableRowEvent.idl | 57 ++++ .../sun/star/sdb/application/CopyTableWizard.idl | 219 ++++++++++++++ .../sun/star/sdb/application/DatabaseObject.idl | 64 ++++ .../sdb/application/DatabaseObjectContainer.idl | 95 ++++++ .../star/sdb/application/DefaultViewController.idl | 92 ++++++ .../star/sdb/application/NamedDatabaseObject.idl | 78 +++++ .../star/sdb/application/XCopyTableListener.idl | 84 ++++++ .../sun/star/sdb/application/XCopyTableWizard.idl | 138 +++++++++ .../star/sdb/application/XDatabaseDocumentUI.idl | 322 +++++++++++++++++++++ .../sun/star/sdb/application/XTableUIProvider.idl | 112 +++++++ 12 files changed, 1382 insertions(+) create mode 100644 offapi/com/sun/star/sdb/application/CopyTableContinuation.idl create mode 100644 offapi/com/sun/star/sdb/application/CopyTableOperation.idl create mode 100644 offapi/com/sun/star/sdb/application/CopyTableRowEvent.idl create mode 100644 offapi/com/sun/star/sdb/application/CopyTableWizard.idl create mode 100644 offapi/com/sun/star/sdb/application/DatabaseObject.idl create mode 100644 offapi/com/sun/star/sdb/application/DatabaseObjectContainer.idl create mode 100644 offapi/com/sun/star/sdb/application/DefaultViewController.idl create mode 100644 offapi/com/sun/star/sdb/application/NamedDatabaseObject.idl create mode 100644 offapi/com/sun/star/sdb/application/XCopyTableListener.idl create mode 100644 offapi/com/sun/star/sdb/application/XCopyTableWizard.idl create mode 100644 offapi/com/sun/star/sdb/application/XDatabaseDocumentUI.idl create mode 100644 offapi/com/sun/star/sdb/application/XTableUIProvider.idl (limited to 'offapi/com/sun/star/sdb/application') 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 000000000..dfc3423c0 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/CopyTableContinuation.idl @@ -0,0 +1,59 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_sdb_application_CopyTableContinuation_idl__ +#define __com_sun_star_sdb_application_CopyTableContinuation_idl__ + + +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. + +

The user can choose between ignoring the error and canceling the copy + operation.

+ */ + const short AskUser = 3; +}; + + +}; }; }; }; }; + + +#endif + +/* 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 000000000..0a5587439 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/CopyTableOperation.idl @@ -0,0 +1,62 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_sdb_application_CopyTableOperation_idl__ +#define __com_sun_star_sdb_application_CopyTableOperation_idl__ + + +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 + +

This option is not available if the target database does not support views.

+ */ + 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; +}; + + +}; }; }; }; }; + + +#endif + +/* 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 000000000..b0935ea66 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/CopyTableRowEvent.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 . + */ + +#ifndef __com_sun_star_sdb_application_CopyTableRowEvent_idl__ +#define __com_sun_star_sdb_application_CopyTableRowEvent_idl__ + +#include +#include + + +module com { module sun { module star { module sdb { module application { + + +/** specifies an event happening while copying table data between databases. + +

Whenever this event is fired to an XCopyTableListener, + com::sun::star::lang::EventObject::Source contains the + wizard instance which actually does the copying.

+ + @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. + +

Usually, this contains an instance of com::sun::star::sdbc::SQLException.

+ */ + any Error; +}; + + +}; }; }; }; }; + + +#endif + +/* 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 000000000..eb7e4b689 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/CopyTableWizard.idl @@ -0,0 +1,219 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_sdb_application_CopyTableWizard_idl__ +#define __com_sun_star_sdb_application_CopyTableWizard_idl__ + +#include +#include +#include +#include +#include +#include + + +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. + +
+
Interactions
+
+

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 +

    +
  • fulfilling parameter requests. This might become necessary if the copy source + describes a parametrized query.
  • +
  • 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 SQLException, usually) that happened.
  • +
  • displaying other errors which happen during copying, in particular errors in + creating the target table or view.
  • +

+ +

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 ConnectionResource, 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.

+ +

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.

+
+
+ + @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. + +

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.

+ +

If the connection has been newly created by the wizard (e.g. because the + data access descriptor specified a DataSource instead of an ActiveConnection), + then this connection will be disposed upon disposal of the wizard.

+ + @param Source + the com::sun::star::sdb::DataAccessDescriptor describing the + data to copy. + +

The following members of the DataAccessDescriptor are supported, and evaluated + in the given order: +

  1. ActiveConnection
  2. +
  3. DataSourceName
  4. +
  5. DatabaseLocation
  6. +
  7. ConnectionResource
  8. +
  9. ConnectionInfo
  10. +
  11. Command
  12. +
  13. CommandType
  14. +
+ 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 Command and CommandType + are required.

+ +

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: +

  • Only com::sun::star::sdb::CommandType::TABLE and + com::sun::star::sdb::CommandType::QUERY are supported.
  • + +
  • If you specify a ConnectionResource, or an + ActiveConnection 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 QUERY will be rejected.
  • + +
  • Filter, Order, HavingClause and GroupBy + are unsupported at the moment.
  • +
+ Violating any of the above restrictions will result in an error at creation time.

+ + @param Destination + the com::sun::star::sdb::DataAccessDescriptor describing the + target for the copy operation. + +

Only DataSourceName, DatabaseLocation, ActiveConnection + 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.

+ +

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.

+ +

Note that creating a view (see CopyTableOperation::CreateAsView) is + not supported if the target connection is an SDBC-level connection only.

+ + @throws ::com::sun::star::lang::IllegalArgumentException + if +
  • either Source or Destination is `NULL`
  • +
  • either Source or Destination are not sufficient + to describe a database connection.
  • +
  • Source is not sufficient to describe the to-be-copied data
  • +
  • either Source or Destination contain unsupported settings.
  • +
+ + @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 DataSourceName 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. + +

The only difference to the create() constructor is that + createWithInteractionHandler takes an additional argument, which + can be used to intercept interactions (such as error messages) during the wizard + run.

+ + @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. + +

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 above.

+ + @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 + ); + +}; + + +}; }; }; }; }; + + +#endif + +/* 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 000000000..366be5002 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/DatabaseObject.idl @@ -0,0 +1,64 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_sdb_application_DatabaseObject_idl__ +#define __com_sun_star_sdb_application_DatabaseObject_idl__ + +#include + + +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 + +

Note that table 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.

+ */ + 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; +}; + + +}; }; }; }; }; + + +#endif + +/* 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 000000000..a4e714cdc --- /dev/null +++ b/offapi/com/sun/star/sdb/application/DatabaseObjectContainer.idl @@ -0,0 +1,95 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_sdb_application_DatabaseObjectContainer_idl__ +#define __com_sun_star_sdb_application_DatabaseObjectContainer_idl__ + + +module com { module sun { module star { module sdb { module application { + + +/** denotes different types of (maybe virtual) containers of database objects + +

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. + +

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.

+ +

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.

+ + @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; +}; + + +}; }; }; }; }; + + +#endif + +/* 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 000000000..c41879e57 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/DefaultViewController.idl @@ -0,0 +1,92 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_sdb_application_DefaultViewController_idl__ +#define __com_sun_star_sdb_application_DefaultViewController_idl__ + +#include +#include +#include +#include +#include +#include +#include + + +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 + +

The ::com::sun::star::ui::ContextMenuExecuteEvent::Selection member + of the event passed to an interceptor will not be the controller itself + (though the controller also supports the XSelectionSupplier + interface), but a component which describes the current selection of the very window where the context + menu was requested.

+ +

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 XContextMenuInterception interface. Context menu requests + in other places cannot be intercepted.

+ +

For the aforementioned tree view, the selection supplied by the ContextMenuEvent::Selection + component is an array of NamedDatabaseObject instances.

+ */ + interface ::com::sun::star::ui::XContextMenuInterception; + + /** allows intercepting user input done by the user + */ + interface ::com::sun::star::awt::XUserInputInterception; + + /** + provides access to the current selection inside the application window, and allows to change it + programmatically + +

The selection is an array of NamedDatabaseObject instances.

+ */ + 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; +}; + + +}; }; }; }; }; + + +#endif + +/* 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 000000000..99f239596 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/NamedDatabaseObject.idl @@ -0,0 +1,78 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_sdb_application_NamedDatabaseObject_idl__ +#define __com_sun_star_sdb_application_NamedDatabaseObject_idl__ + + +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. + +

This member is one of the DatabaseObject or DatabaseObjectContainer constants.

+ */ + long Type; + + /** denotes the name of the object + +

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 (/).

+ +

In case of tables, this is the fully qualified name of the table, as required + by the database's table name composition rules.

+ +

In case of queries, this is the name of the query.

+ +

In case of virtual folders denoted by DatabaseObjectContainer::CATALOG and + DatabaseObjectContainer::SCHEMA, it is +

  • <schema>, if the database supports schemas only
  • +
  • <catalog>, if the database supports catalogs only
  • +
  • <catalog>.<schema>, if the database supports both + catalogs and schemas, and catalogs are to appear at the beginning of an identifier.
  • +
  • <schema>.<catalog>, if the database supports both + catalogs and schemas, and catalogs are to appear at the end of an identifier.
  • +
+

+ +

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)

+ + @see XDatabaseMetaData::isCatalogAtStart + @see DatabaseObjectContainer + */ + string Name; +}; + + +}; }; }; }; }; + + +#endif + +/* 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 000000000..72613157e --- /dev/null +++ b/offapi/com/sun/star/sdb/application/XCopyTableListener.idl @@ -0,0 +1,84 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_sdb_application_XCopyTableListener_idl__ +#define __com_sun_star_sdb_application_XCopyTableListener_idl__ + +#include +#include + + +module com { module sun { module star { module sdb { module application { + + +/** specifies the interface required to listen for progress in copying + table rows via a CopyTableWizard. + + @see CopyTableRowEvent + @see CopyTableWizard + */ +interface XCopyTableListener : ::com::sun::star::lang::XEventListener +{ + /** is called when a row is about to be copied. + +

This method is called immediately before a row is copied. It might be used, for instance, + to update a progress indicator.

+ + @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. + +

This method is called right after a row has been successfully copied. It might be used, + for instance, to update a progress indicator.

+ + @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 ); +}; + + +}; }; }; }; }; + + +#endif + +/* 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 000000000..18b312f4f --- /dev/null +++ b/offapi/com/sun/star/sdb/application/XCopyTableWizard.idl @@ -0,0 +1,138 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_sdb_application_XCopyTableWizard_idl__ +#define __com_sun_star_sdb_application_XCopyTableWizard_idl__ + +#include +#include +#include +#include + +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. + +

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.

+ +

The copy table wizard described by this interfaces cares for those, + and other, settings.

+ + @since OOo 2.4 + */ +interface XCopyTableWizard : ::com::sun::star::ui::dialogs::XExecutableDialog +{ + /** specifies the basic operation for the wizard to execute. + +

This must be one of the CopyTableOperation constants.

+ +

At initialization time, you can use this attribute to control the + initial operation in the wizard.

+ +

After the wizard has finished, you can use this attribute to determine + what operation was actually executed.

+ +

Changing this attribute while the dialog is running is not supported, the + result of such an attempt is undefined.

+ + @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. + +

At initialization time, you can use this attribute to control the + initial table name as suggested to the user.

+ +

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.

+ +

Changing this attribute while the dialog is running is not supported, the + result of such an attempt is undefined.

+ */ + [attribute] string DestinationTableName; + + /** specifies that a new primary key is to be created in the target database + +

At initialization time, you can specify the initial settings for the primary + key in the UI.

+ +

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.

+ +

This attribute is ignored if #Operation is + CopyTableOperation::AppendData.

+ +

Changing this attribute while the dialog is running is not supported, the + result of such an attempt is undefined.

+ +

When a primary key is to be created by the wizard, it will be an auto-increment + column, if possible.

+ + @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. + +

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. +

+ */ + [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 ); +}; + + +}; }; }; }; }; + + +#endif + +/* 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 000000000..a8f54d4f7 --- /dev/null +++ b/offapi/com/sun/star/sdb/application/XDatabaseDocumentUI.idl @@ -0,0 +1,322 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_sdb_application_XDatabaseDocumentUI_idl__ +#define __com_sun_star_sdb_application_XDatabaseDocumentUI_idl__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +module com { module sun { module star { module sdb { module application { + + +/** provides access to the user interface of a database document + +

This interface is available when a database document has been loaded into + a frame, at the controller of this frame.

+ + @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 + +

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.

+ + @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 + +

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().

+ */ + [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 + +

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.

+ +

If the connection cannot be established, the respective error message is shown + in the application window.

+ + @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 + +

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.

+ +

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. + +

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 + closeSubComponents, which will gracefully do this.

+ +

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).

+ +

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.

+ + @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 + +

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.

+ +

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.

+ +

Note there must exist a connection to the database before you can call this method.

+ +

If an error occurs opening the given object, then this is reported to the user via an error dialog.

+ + @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`). + +

For the different object types, this means the following + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ForEditing = `TRUE`ForEditing = `FALSE`
TablesA table designer is opened, and allows to edit the structure of the table. + See also ::com::sun::star::sdb::TableDesignA table data view is opened, and allows to view and edit the data contained in the table. + See also ::com::sun::star::sdb::DataSourceBrowser
QueriesA query designer is opened, and allows to edit the statement constituting the query. + See also ::com::sun::star::sdb::QueryDesignA table data view is opened, and allows to view and edit the data contained in the query. + See also ::com::sun::star::sdb::DataSourceBrowser
FormsThe form document is opened in design mode, that is, you can modify it.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.
ReportsThe report document is opened in design mode, that is, you can modify it.The report is executed, and the results will be displayed.
+

+ + @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 + +

In opposite to loadComponent(), this method allows you to specify + additional arguments which are passed to the to-be-loaded component.

+ +

The meaning of the arguments is defined at the service which is effectively + created. See the above table for a list of those + services.

+ */ + ::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 + +

In opposite to createComponent(), this method allows you to specify + additional arguments which are passed to the to-be-loaded component.

+ + + @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 above + table 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.
+ 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 Hidden flag (set to `TRUE`) in Arguments, + manipulate the component, and then finally show it by invoking the show 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 ); +}; + + +}; }; }; }; }; + + +#endif + +/* 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 000000000..e9bb5b53e --- /dev/null +++ b/offapi/com/sun/star/sdb/application/XTableUIProvider.idl @@ -0,0 +1,112 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_sdb_application_XTableUIProvider_idl__ +#define __com_sun_star_sdb_application_XTableUIProvider_idl__ + +#include +#include +#include + + +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. + +

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.

+ + @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.
+ 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.
+ Two component types are supported so far +
  • modal dialogs
    + If the returned component supports the + com::sun::star::ui::dialogs::XExecutableDialog + interface, the dialog will be executed modally.
  • +
  • modeless frames
    + 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.
  • +
+ 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); +}; + + +}; }; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3