2010-10-27 12:33:13 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-14 17:39:53 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2013-11-05 02:18:53 +01:00
|
|
|
#ifndef INCLUDED_DBACCESS_SOURCE_CORE_DATAACCESS_DATABASEDOCUMENT_HXX
|
|
|
|
#define INCLUDED_DBACCESS_SOURCE_CORE_DATAACCESS_DATABASEDOCUMENT_HXX
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2013-12-05 22:41:15 +01:00
|
|
|
#include <sal/config.h>
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
2008-03-06 16:58:34 +00:00
|
|
|
#include "ModelImpl.hxx"
|
2008-10-16 06:57:26 +00:00
|
|
|
#include "documenteventnotifier.hxx"
|
2008-03-06 16:58:34 +00:00
|
|
|
|
2005-03-10 15:34:06 +00:00
|
|
|
#include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
|
2007-04-16 15:24:16 +00:00
|
|
|
#include <com/sun/star/frame/XModel2.hpp>
|
2008-04-04 13:33:18 +00:00
|
|
|
#include <com/sun/star/frame/XTitle.hpp>
|
|
|
|
#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
|
|
|
|
#include <com/sun/star/frame/XUntitledNumbers.hpp>
|
2005-03-10 15:34:06 +00:00
|
|
|
#include <com/sun/star/frame/XStorable.hpp>
|
|
|
|
#include <com/sun/star/sdb/XReportDocumentsSupplier.hpp>
|
|
|
|
#include <com/sun/star/sdb/XFormDocumentsSupplier.hpp>
|
|
|
|
#include <com/sun/star/view/XPrintable.hpp>
|
2012-09-05 14:55:34 +02:00
|
|
|
#include <com/sun/star/frame/XModuleManager2.hpp>
|
2005-03-10 15:34:06 +00:00
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
|
|
|
#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
|
|
|
|
#include <com/sun/star/embed/XTransactionListener.hpp>
|
2008-03-06 16:58:34 +00:00
|
|
|
#include <com/sun/star/document/XStorageBasedDocument.hpp>
|
|
|
|
#include <com/sun/star/document/XEmbeddedScripts.hpp>
|
2008-10-16 06:57:26 +00:00
|
|
|
#include <com/sun/star/document/XEventsSupplier.hpp>
|
2008-03-06 16:58:34 +00:00
|
|
|
#include <com/sun/star/document/XScriptInvocationContext.hpp>
|
|
|
|
#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
|
|
|
|
#include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
|
2008-10-16 06:57:26 +00:00
|
|
|
#include <com/sun/star/frame/XLoadable.hpp>
|
|
|
|
#include <com/sun/star/document/XEventBroadcaster.hpp>
|
|
|
|
#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
|
autorecovery: define a new css.document.XDocumentRecovery interface, implement it in both SFX and DBACCESS, and use it in the autorecovery
In this course, the auto recovery learned to restore multiple views of a document. Also, in the course of the change,
the LoadDispatchListener became superfluous, and was removed.
Also, the loader code in dbaccess was slightly adjusted, since now the connectController call is in the responsibility
of the loader, and must not happen inside the XController::attachModel call anymore. This change made the
ModelControllerConnector class superfluous, so it has been removed, too.
2010-01-05 22:32:38 +01:00
|
|
|
#include <com/sun/star/document/XDocumentRecovery.hpp>
|
2013-02-26 16:24:53 +02:00
|
|
|
#include <com/sun/star/ui/XUIConfigurationManager2.hpp>
|
|
|
|
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
|
|
|
|
#include <com/sun/star/util/XCloseable.hpp>
|
|
|
|
#include <com/sun/star/util/XModifiable.hpp>
|
2008-03-06 16:58:34 +00:00
|
|
|
|
2015-06-22 21:48:36 +02:00
|
|
|
#include <cppuhelper/compbase.hxx>
|
2008-10-16 06:57:26 +00:00
|
|
|
#include <cppuhelper/implbase3.hxx>
|
|
|
|
#include <rtl/ref.hxx>
|
|
|
|
|
2008-03-06 16:58:34 +00:00
|
|
|
namespace comphelper {
|
|
|
|
class NamedValueCollection;
|
|
|
|
}
|
2006-04-19 12:18:53 +00:00
|
|
|
|
2005-03-10 15:34:06 +00:00
|
|
|
namespace dbaccess
|
|
|
|
{
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
class DocumentEvents;
|
|
|
|
class DocumentEventExecutor;
|
|
|
|
class DocumentGuard;
|
2007-07-24 11:04:48 +00:00
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
typedef ::std::vector< css::uno::Reference< css::frame::XController > > Controllers;
|
2007-07-24 11:04:48 +00:00
|
|
|
|
2013-08-17 23:43:14 +02:00
|
|
|
// ViewMonitor
|
2008-10-16 06:57:26 +00:00
|
|
|
/** helper class monitoring the views of a document, and firing appropriate events
|
|
|
|
when views are attached / detached
|
|
|
|
*/
|
2016-04-08 14:58:51 +02:00
|
|
|
class ViewMonitor
|
2008-10-16 06:57:26 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-07-05 21:05:13 +01:00
|
|
|
explicit ViewMonitor( DocumentEventNotifier& _rEventNotifier )
|
2008-10-16 06:57:26 +00:00
|
|
|
:m_rEventNotifier( _rEventNotifier )
|
|
|
|
,m_bIsNewDocument( true )
|
|
|
|
,m_bEverHadController( false )
|
|
|
|
,m_bLastIsFirstEverController( false )
|
|
|
|
,m_xLastConnectedController()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-04-08 14:58:51 +02:00
|
|
|
ViewMonitor(const ViewMonitor&) = delete;
|
|
|
|
const ViewMonitor& operator=(const ViewMonitor&) = delete;
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
void reset()
|
|
|
|
{
|
|
|
|
m_bEverHadController = false;
|
|
|
|
m_bLastIsFirstEverController = false;
|
|
|
|
m_xLastConnectedController.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
/** to be called when a view (aka controller) has been connected to the document
|
|
|
|
@return
|
|
|
|
<TRUE/> if and only if this was the first-ever controller connected to the document
|
|
|
|
*/
|
|
|
|
bool onControllerConnected(
|
2015-08-03 09:14:58 +02:00
|
|
|
const css::uno::Reference< css::frame::XController >& _rxController
|
2008-10-16 06:57:26 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
/** to be called when a controller is set as current controller
|
2010-02-16 15:31:07 +01:00
|
|
|
@return <TRUE/>
|
|
|
|
if and only if the controller connection indicates that loading the document is finished. This
|
|
|
|
is the case if the given controller has previously been connected, and it was the first controller
|
|
|
|
ever for which this happened.
|
2008-10-16 06:57:26 +00:00
|
|
|
*/
|
2010-02-16 15:31:07 +01:00
|
|
|
bool onSetCurrentController(
|
2015-08-03 09:14:58 +02:00
|
|
|
const css::uno::Reference< css::frame::XController >& _rxController
|
2008-10-16 06:57:26 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
void onLoadedDocument() { m_bIsNewDocument = false; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
DocumentEventNotifier& m_rEventNotifier;
|
|
|
|
bool m_bIsNewDocument;
|
|
|
|
bool m_bEverHadController;
|
|
|
|
bool m_bLastIsFirstEverController;
|
2015-08-03 09:14:58 +02:00
|
|
|
css::uno::Reference< css::frame::XController >
|
2008-10-16 06:57:26 +00:00
|
|
|
m_xLastConnectedController;
|
|
|
|
};
|
|
|
|
|
2013-08-17 23:43:14 +02:00
|
|
|
// ODatabaseDocument
|
2015-08-03 09:14:58 +02:00
|
|
|
typedef cppu::PartialWeakComponentImplHelper< css::frame::XModel2
|
|
|
|
, css::util::XModifiable
|
|
|
|
, css::frame::XStorable
|
|
|
|
, css::document::XEventBroadcaster
|
|
|
|
, css::document::XDocumentEventBroadcaster
|
|
|
|
, css::view::XPrintable
|
|
|
|
, css::util::XCloseable
|
|
|
|
, css::lang::XServiceInfo
|
|
|
|
, css::sdb::XOfficeDatabaseDocument
|
|
|
|
, css::ui::XUIConfigurationManagerSupplier
|
|
|
|
, css::document::XStorageBasedDocument
|
|
|
|
, css::document::XEmbeddedScripts
|
|
|
|
, css::document::XScriptInvocationContext
|
|
|
|
, css::script::provider::XScriptProviderSupplier
|
|
|
|
, css::document::XEventsSupplier
|
|
|
|
, css::frame::XLoadable
|
|
|
|
, css::document::XDocumentRecovery
|
2008-03-06 16:58:34 +00:00
|
|
|
> ODatabaseDocument_OfficeDocument;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
typedef ::cppu::ImplHelper3< css::frame::XTitle
|
|
|
|
, css::frame::XTitleChangeBroadcaster
|
|
|
|
, css::frame::XUntitledNumbers
|
2008-04-04 13:33:18 +00:00
|
|
|
> ODatabaseDocument_Title;
|
|
|
|
|
2005-12-21 12:35:05 +00:00
|
|
|
class ODatabaseDocument :public ModelDependentComponent // ModelDependentComponent must be first!
|
|
|
|
,public ODatabaseDocument_OfficeDocument
|
2008-04-04 13:33:18 +00:00
|
|
|
,public ODatabaseDocument_Title
|
2005-03-10 15:34:06 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
enum InitState
|
|
|
|
{
|
|
|
|
NotInitialized,
|
|
|
|
Initializing,
|
|
|
|
Initialized
|
|
|
|
};
|
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
typedef std::map< OUString, css::uno::Reference< css::frame::XUntitledNumbers > > TNumberedController;
|
|
|
|
css::uno::Reference< css::ui::XUIConfigurationManager2> m_xUIConfigurationManager;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2016-01-19 19:45:45 +02:00
|
|
|
::comphelper::OInterfaceContainerHelper2 m_aModifyListeners;
|
|
|
|
::comphelper::OInterfaceContainerHelper2 m_aCloseListener;
|
|
|
|
::comphelper::OInterfaceContainerHelper2 m_aStorageListeners;
|
2006-02-07 09:18:54 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentEvents* m_pEventContainer;
|
|
|
|
::rtl::Reference< DocumentEventExecutor > m_pEventExecutor;
|
|
|
|
DocumentEventNotifier m_aEventNotifier;
|
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
css::uno::Reference< css::frame::XController > m_xCurrentController;
|
2008-03-06 16:58:34 +00:00
|
|
|
Controllers m_aControllers;
|
2008-10-16 06:57:26 +00:00
|
|
|
ViewMonitor m_aViewMonitor;
|
2007-07-24 11:04:48 +00:00
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
css::uno::WeakReference< css::container::XNameAccess > m_xForms;
|
|
|
|
css::uno::WeakReference< css::container::XNameAccess > m_xReports;
|
|
|
|
css::uno::WeakReference< css::script::provider::XScriptProvider > m_xScriptProvider;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
/** @short such module manager is used to classify new opened documents. */
|
2015-08-03 09:14:58 +02:00
|
|
|
css::uno::Reference< css::frame::XModuleManager2 > m_xModuleManager;
|
|
|
|
css::uno::Reference< css::frame::XTitle > m_xTitleHelper;
|
2008-10-16 06:57:26 +00:00
|
|
|
TNumberedController m_aNumberedControllers;
|
|
|
|
|
|
|
|
/** true if and only if the DatabaseDocument's "initNew" or "load" have been called (or, well,
|
|
|
|
the document has be initialized implicitly - see storeAsURL
|
|
|
|
*/
|
|
|
|
InitState m_eInitState;
|
|
|
|
bool m_bClosing;
|
2009-04-24 18:34:24 +00:00
|
|
|
bool m_bAllowDocumentScripting;
|
2010-01-14 15:10:17 +01:00
|
|
|
bool m_bHasBeenRecovered;
|
2015-04-29 14:44:16 +02:00
|
|
|
/// If XModel::attachResource() was called to inform us that the document is embedded into an other one.
|
|
|
|
bool m_bEmbedded;
|
2008-10-16 06:57:26 +00:00
|
|
|
|
|
|
|
enum StoreType { SAVE, SAVE_AS };
|
2008-03-06 16:58:34 +00:00
|
|
|
/** stores the document to the given URL, rebases it to the respective new storage, if necessary, resets
|
|
|
|
the modified flag, and notifies any listeners as required
|
2008-10-16 06:57:26 +00:00
|
|
|
|
|
|
|
@param _rURL
|
|
|
|
the URL to store the document to
|
|
|
|
@param _rArguments
|
|
|
|
arguments for storing the document (MediaDescriptor)
|
|
|
|
@param _eType
|
|
|
|
the type of the store process (Save or SaveAs). The method will automatically
|
|
|
|
notify the proper events for this type.
|
|
|
|
@param _rGuard
|
|
|
|
the instance lock to be released before doing synchronous notifications
|
2005-03-10 15:34:06 +00:00
|
|
|
*/
|
2008-03-06 16:58:34 +00:00
|
|
|
void impl_storeAs_throw(
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& _rURL,
|
2010-01-29 13:54:37 +01:00
|
|
|
const ::comphelper::NamedValueCollection& _rArguments,
|
2008-10-16 06:57:26 +00:00
|
|
|
const StoreType _eType,
|
|
|
|
DocumentGuard& _rGuard
|
CWS-TOOLING: integrate CWS dba32g
2009-09-09 07:53:55 +0200 oj r275964 : replace strlen with rtl_str_getLength
2009-09-07 20:59:10 +0200 fs r275913 : disable the CopyTableWizard test until issue 104869 is fixed
2009-09-07 12:17:31 +0200 oj r275885 : #i104810# remove de as lang
2009-09-05 22:26:21 +0200 fs r275857 : protect StateChanged against re-entrance
2009-09-05 22:25:52 +0200 fs r275856 : don't attempt to classify the parent of a form as control
2009-09-05 22:25:29 +0200 fs r275855 : protect against re-entrance
2009-09-05 00:11:40 +0200 fs r275835 : #i10000#
2009-09-04 23:25:50 +0200 fs r275834 : #i10000#
2009-09-04 23:23:47 +0200 fs r275833 : #i10000#
2009-09-04 21:49:37 +0200 fs r275830 : #i10000# correct wrong conflict resolution
2009-09-04 20:59:51 +0200 fs r275829 : CWS-TOOLING: rebase CWS dba32g to trunk@275801 (milestone: DEV300:m57)
2009-09-04 11:08:32 +0200 oj r275791 : #i104780# new version 1.2.0
2009-09-03 22:29:21 +0200 fs r275775 : OSL_TRACE doesn't need \n anymore
2009-09-03 08:33:21 +0200 fs r275743 : CWS-TOOLING: rebase CWS dba32g to trunk@275331 (milestone: DEV300:m56)
2009-09-02 13:48:12 +0200 fs r275708 : removed useless include
2009-09-02 13:45:43 +0200 fs r275707 : more since tags, which are used across offapi/udkapi
2009-09-02 13:23:04 +0200 fs r275705 : should *not* have the dtor, copy ctor, and assignment operator compiler-generated, else we run into trouble as soon as the compiler creates different versions of our singleton member's static data in different libraries
2009-09-02 12:32:45 +0200 fs r275704 : AutoIncrementIsPrimaryKey is a driver setting, not a data source setting
2009-09-02 11:42:49 +0200 fs r275701 : URL meta data are meta data which are valid for all connections of this type, not per-data-source properties. Settings them as data source properties is a hack.
2009-09-02 08:43:34 +0200 fs r275696 : 3.x.x is not a valid 'since' tag
2009-09-01 16:05:24 +0200 fs r275665 : #i104686# don't treat controls bound to read-only columns as required
2009-09-01 13:10:22 +0200 fs r275657 : #i104574# use PageUp/Down to scroll through the complete page
2009-09-01 07:04:48 +0200 oj r275641 : #i104104# correct line ends
2009-08-31 15:52:34 +0200 fs r275612 : #i104410#
2009-08-31 12:29:05 +0200 fs r275596 : #i104364#
2009-08-31 12:28:56 +0200 fs r275595 : #i104364#
2009-08-31 11:43:09 +0200 fs r275593 : #i104649# JavaDriverClassPath is also a known JDBC-bridge setting
2009-08-31 11:41:37 +0200 fs r275592 : #i104649#
2009-08-28 21:48:27 +0200 fs r275552 : during #i96862#: renamed the configuration data which controls availability of certain DBA-related UI
2009-08-28 21:48:17 +0200 fs r275551 : #i96862# do not show the 'Create a new database' option when a) no embedded/dBase driver is installed or b) the configuration requests to hide the option
2009-08-28 21:47:19 +0200 fs r275550 : during #i96862#: renamed the configuration data which controls availability of certain DBA-related UI
2009-08-28 21:46:41 +0200 fs r275549 : #i96862# renamed and extended the configuration data which controls availability of certain DBA-related UI
2009-08-28 15:10:19 +0200 fs r275535 : #i96862# if no embedded driver is installed, use dBase for creating new DBs. If no dBase driver is installed, too, do not offer the 'Create new database' option
2009-08-28 14:03:04 +0200 fs r275532 : #i104454# allow multiple fields to display the same column
2009-08-28 13:14:00 +0200 fs r275528 : #i104584# driver meta data do not belong into a data source's settings
2009-08-28 13:09:57 +0200 fs r275527 : properly chech the MySQL type buttons (else next/back in the wizard leads to state with two buttons checked)
2009-08-28 13:09:17 +0200 fs r275526 : #i104584# driver meta data do not belong into a data source's settings
2009-08-28 13:07:18 +0200 fs r275525 : BooleanComparisonMode is a property, or a feature - but not a driver meta data
2009-08-28 11:00:31 +0200 fs r275521 : #i104580#
2009-08-28 10:40:05 +0200 fs r275519 : #i104577# correct assertion: If the template node type is ANY, then any value type is allowed
2009-08-28 10:09:30 +0200 fs r275518 : #i104575# implement Named Pipe UI
2009-08-28 10:09:07 +0200 fs r275517 : pass the trigger-event to IWindowOperator::operateOn / work with VclWindowEvents, not VclSimpleEvents
2009-08-27 14:27:36 +0200 fs r275484 : ImplPosTabPage: respect mbEmptyViewMargin for WINDOWALIGN_LEFT
2009-08-27 13:43:56 +0200 fs r275480 : merging latest changes from CWS dba32f herein
2009-08-27 13:23:07 +0200 fs r275475 : #i103882#
2009-08-27 11:56:55 +0200 fs r275466 : #i104544# SetState: Do not call Update at the window which we just set text for. It should (sic\!) not be needed, but causes trouble
2009-08-27 11:55:34 +0200 fs r275465 : #i104544#
do not allow re-entrance for impl_ensureControl_nothrow
Actually, this is part of the fix only. I also removed the code which triggered this re-entrance (from
the grid control implementation), but to ensure it won't happen, again, I added some safety herein.
2009-08-27 10:14:11 +0200 fs r275459 : preparations for supporting a 'NamedPipe' parameter for the MySQL Connector/OOo
2009-08-27 10:13:21 +0200 fs r275458 : preparations for supporting a 'NamedPipe' setting for the MySQL Connector/OOo
2009-08-27 10:11:14 +0200 fs r275456 : outsourced the MySQLNative settings into a dedicated class, to not duplicate all the code in two tab page implementations
2009-08-26 14:18:13 +0200 fs r275422 : #i10000#
2009-08-26 13:26:36 +0200 fs r275419 : ignore output paths
2009-08-26 13:23:38 +0200 fs r275417 : support the LocalSocket property for the MySQL native driver
2009-08-26 13:17:05 +0200 fs r275416 : some re-factoring, to outsource the tab page for setting up the MySQLNative connection, into a dedicated class (needed later)
2009-08-26 13:15:15 +0200 fs r275415 : support a NoThousandSep property for NumericFormatters - I'm tired of correcting this at runtime, instead of controlling it in the resource
2009-08-26 11:45:08 +0200 fs r275410 : oops, 'flat' shouldn't have got lost
2009-08-26 09:38:57 +0200 fs r275398 : #i102631# when saving the document fails, ensure that the interaction handler really can handle/display the error
2009-08-26 09:37:05 +0200 fs r275397 : #i102631# don't let non-IO/RuntimeExceptions escape from DatabaseDocument::store*, wrap them into an IOException
2009-08-26 09:35:39 +0200 fs r275395 : let the default interaction handler implement XInteractionHandler2
2009-08-25 13:51:34 +0200 fs r275352 : #i102631# createTempFile: pass URL through FileHelper.getOOoCompatibleFileURL
2009-08-25 13:49:23 +0200 fs r275351 : #i102631# createTempFileURL: immediately delete the file implicitly created by createTempFile, we really only need the URL
2009-08-24 14:49:07 +0200 fs r275318 : #i10000#
2009-08-24 14:36:03 +0200 fs r275315 : properly terminate message with 0 character
2009-08-24 14:35:45 +0200 fs r275314 : trace method concepts in non-pro, if special flag is enabled
2009-08-24 14:24:17 +0200 fs r275312 : #i98973# filter some more events for grid control columns
2009-08-24 14:15:23 +0200 fs r275311 : #i98973# implement XComboBox for combo box cells
2009-08-24 13:39:24 +0200 fs r275308 : #i98973# do not display the 'actionPerformed' event for grid combo box columns
2009-08-24 12:52:03 +0200 fs r275303 : #i98973# implement XCheckBox and XButton for check box cells
2009-08-24 11:56:05 +0200 oj r275300 : #i104447# wrong default for orientation
2009-08-24 10:51:21 +0200 fs r275296 : in the script selector dialog, interpret a double click onto a function as OK
2009-08-24 10:50:56 +0200 fs r275295 : localize some to-be-displayed names, consolidate some code regarding form/control naming
2009-08-21 14:28:05 +0200 fs r275255 : #i98973# implement KeyListeners
2009-08-21 14:27:20 +0200 fs r275254 : #i98973# move the conversion VCL[Mouse|Key]Event->Awt[Mouse|Key]Event from vclxwindow.cxx to VCLUnoHelper
2009-08-21 14:08:50 +0200 fs r275248 : #i98973# implement Mouse- and MouseMotion-broadcasting
2009-08-21 13:31:08 +0200 fs r275244 : #i98973# implement text and change listeners at text cells
2009-08-21 12:47:38 +0200 fs r275234 : #i104399# some refactoring:
If the MySQL Connector/OOo is installed, it registers for the sdbc:mysqlc: protocol (now known as DST_MYSQL_NATIVE_DIRECT).
However, we do not want to display this in the UI, instead we display "MySQL" only, which collects DST_MYSQL_ODBC, DST_MYSQL_JDBC, and DST_MYSQL_NATIVE.
2009-08-21 12:45:18 +0200 fs r275232 : #i104399# also register for the sdbc:mysql:mysqlc protocol, decide at runtime (depending on the availability of sdbc:mysqlc:), whether it is really accepted. This prevents that the C/OOo extension needs to register *our* implementation name for the sdbc:mysql:mysqlc: protocol, which would be somewhat weird
2009-08-20 16:18:48 +0200 fs r275190 : merging the latest changes from CWS dba32f (which this CWS was created from)
2009-08-19 20:19:59 +0200 fs r275160 : add some spacing between the radios
2009-08-19 14:50:15 +0200 fs r275150 : #i98973# slightly refactoring the grid cell implementations, to prepare for proper events being fired. Implement focus events for the moment, more to come.
2009-08-19 10:53:38 +0200 fs r275142 : #i99936# initialize newly created models
2009-08-18 23:03:48 +0200 fs r275132 : merging latest changes from CWS dba32f
2009-08-18 15:14:08 +0200 fs r275110 : #i102819# SetColumnPos: SCROLL_CLIP is deadly here
2009-09-14 11:18:01 +00:00
|
|
|
)
|
2014-06-16 15:59:11 +01:00
|
|
|
throw (css::io::IOException,
|
|
|
|
css::uno::RuntimeException,
|
|
|
|
std::exception);
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-03-06 16:58:34 +00:00
|
|
|
/** notifies our storage change listeners that our underlying storage changed
|
|
|
|
|
|
|
|
@param _rxNewRootStorage
|
|
|
|
the new root storage to be notified. If <NULL/>, it is assumed that no storage change actually
|
|
|
|
happened, and the listeners are not notified.
|
2005-12-21 12:35:05 +00:00
|
|
|
*/
|
2008-03-06 16:58:34 +00:00
|
|
|
void impl_notifyStorageChange_nolck_nothrow(
|
2015-08-03 09:14:58 +02:00
|
|
|
const css::uno::Reference< css::embed::XStorage >& _rxNewRootStorage
|
2008-03-06 16:58:34 +00:00
|
|
|
);
|
2005-03-10 15:34:06 +00:00
|
|
|
|
|
|
|
/// write a single XML stream into the package
|
2008-03-06 16:58:34 +00:00
|
|
|
void WriteThroughComponent(
|
2015-08-03 09:14:58 +02:00
|
|
|
const css::uno::Reference< css::lang::XComponent > & xComponent, /// the component we export
|
2008-03-06 16:58:34 +00:00
|
|
|
const sal_Char* pStreamName, /// the stream name
|
|
|
|
const sal_Char* pServiceName, /// service name of the component
|
2015-08-03 09:14:58 +02:00
|
|
|
const css::uno::Sequence< css::uno::Any> & rArguments, /// the argument (XInitialization)
|
|
|
|
const css::uno::Sequence< css::beans::PropertyValue> & rMediaDesc,/// output descriptor
|
|
|
|
const css::uno::Reference< css::embed::XStorage >& _xStorageToSaveTo
|
2008-03-06 16:58:34 +00:00
|
|
|
) const;
|
|
|
|
|
2005-03-10 15:34:06 +00:00
|
|
|
/// write a single output stream
|
|
|
|
/// (to be called either directly or by WriteThroughComponent(...))
|
2008-03-06 16:58:34 +00:00
|
|
|
void WriteThroughComponent(
|
2015-08-03 09:14:58 +02:00
|
|
|
const css::uno::Reference< css::io::XOutputStream >& xOutputStream,
|
|
|
|
const css::uno::Reference< css::lang::XComponent >& xComponent,
|
2005-03-10 15:34:06 +00:00
|
|
|
const sal_Char* pServiceName,
|
2015-08-03 09:14:58 +02:00
|
|
|
const css::uno::Sequence< css::uno::Any >& rArguments,
|
|
|
|
const css::uno::Sequence< css::beans::PropertyValue> & rMediaDesc
|
2008-03-06 16:58:34 +00:00
|
|
|
) const;
|
2005-03-23 08:46:19 +00:00
|
|
|
|
|
|
|
/** writes the content and settings
|
|
|
|
@param sURL
|
|
|
|
The URL
|
|
|
|
@param lArguments
|
|
|
|
The media descriptor
|
|
|
|
@param _xStorageToSaveTo
|
|
|
|
The storage which should be used for saving
|
|
|
|
*/
|
2009-04-24 18:34:24 +00:00
|
|
|
void impl_writeStorage_throw(
|
2015-08-03 09:14:58 +02:00
|
|
|
const css::uno::Reference< css::embed::XStorage >& _rxTargetStorage,
|
2008-03-06 16:58:34 +00:00
|
|
|
const ::comphelper::NamedValueCollection& _rMediaDescriptor
|
|
|
|
) const;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2005-12-21 12:35:05 +00:00
|
|
|
// ModelDependentComponent overridables
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual css::uno::Reference< css::uno::XInterface > getThis() const override;
|
2005-12-21 12:35:05 +00:00
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
css::uno::Reference< css::frame::XTitle > impl_getTitleHelper_throw();
|
|
|
|
css::uno::Reference< css::frame::XUntitledNumbers > impl_getUntitledHelper_throw(
|
|
|
|
const css::uno::Reference< css::uno::XInterface >& _xComponent = css::uno::Reference< css::uno::XInterface >());
|
2008-04-04 13:33:18 +00:00
|
|
|
|
2005-07-08 09:36:26 +00:00
|
|
|
private:
|
2015-07-05 21:05:13 +01:00
|
|
|
explicit ODatabaseDocument(const ::rtl::Reference<ODatabaseModelImpl>& _pImpl);
|
2005-07-08 09:36:26 +00:00
|
|
|
// Do NOT create those documents directly, always use ODatabaseModelImpl::getModel. Reason is that
|
2008-03-06 16:58:34 +00:00
|
|
|
// ODatabaseDocument requires clear ownership, and in turn lifetime synchronisation with the ModelImpl.
|
2005-07-08 09:36:26 +00:00
|
|
|
// If you create a ODatabaseDocument directly, you might easily create a leak.
|
2011-02-27 22:55:22 +01:00
|
|
|
// #i50905#
|
2005-07-08 09:36:26 +00:00
|
|
|
|
2005-03-10 15:34:06 +00:00
|
|
|
protected:
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL disposing() override;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
|
|
|
virtual ~ODatabaseDocument();
|
2005-07-08 09:36:26 +00:00
|
|
|
|
2005-03-10 15:34:06 +00:00
|
|
|
public:
|
2005-07-08 09:36:26 +00:00
|
|
|
struct FactoryAccess { friend class ODatabaseModelImpl; private: FactoryAccess() { } };
|
2006-06-20 01:44:31 +00:00
|
|
|
static ODatabaseDocument* createDatabaseDocument( const ::rtl::Reference<ODatabaseModelImpl>& _pImpl, FactoryAccess /*accessControl*/ )
|
2005-07-08 09:36:26 +00:00
|
|
|
{
|
|
|
|
return new ODatabaseDocument( _pImpl );
|
|
|
|
}
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-03-06 16:58:34 +00:00
|
|
|
// XServiceInfo
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(css::uno::RuntimeException, std::exception) override;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-04-04 13:33:18 +00:00
|
|
|
// XInterface
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL acquire( ) throw () override;
|
|
|
|
virtual void SAL_CALL release( ) throw () override;
|
2008-04-04 13:33:18 +00:00
|
|
|
|
|
|
|
// XTypeProvider
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (css::uno::RuntimeException, std::exception) override;
|
2008-04-04 13:33:18 +00:00
|
|
|
|
2008-03-06 16:58:34 +00:00
|
|
|
// XComponent
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL dispose( ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) throw (css::uno::RuntimeException, std::exception) override;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-03-06 16:58:34 +00:00
|
|
|
// XModel
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual sal_Bool SAL_CALL attachResource( const OUString& URL, const css::uno::Sequence< css::beans::PropertyValue >& Arguments ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual OUString SAL_CALL getURL( ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs( ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual void SAL_CALL connectController( const css::uno::Reference< css::frame::XController >& Controller ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual void SAL_CALL disconnectController( const css::uno::Reference< css::frame::XController >& Controller ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual void SAL_CALL lockControllers( ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual void SAL_CALL unlockControllers( ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual sal_Bool SAL_CALL hasControllersLocked( ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController( ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual void SAL_CALL setCurrentController( const css::uno::Reference< css::frame::XController >& Controller ) throw (css::container::NoSuchElementException, css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getCurrentSelection( ) throw (css::uno::RuntimeException, std::exception) override ;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// XModel2
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL getControllers( ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableViewControllerNames( ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createDefaultViewController( const css::uno::Reference< css::frame::XFrame >& Frame ) throw (css::lang::IllegalArgumentException, css::uno::Exception, css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createViewController( const OUString& ViewName, const css::uno::Sequence< css::beans::PropertyValue >& Arguments, const css::uno::Reference< css::frame::XFrame >& Frame ) throw (css::lang::IllegalArgumentException, css::uno::Exception, css::uno::RuntimeException, std::exception) override ;
|
2007-04-16 15:24:16 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// XStorable
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual sal_Bool SAL_CALL hasLocation( ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual OUString SAL_CALL getLocation( ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual sal_Bool SAL_CALL isReadonly( ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual void SAL_CALL store( ) throw (css::io::IOException, css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual void SAL_CALL storeAsURL( const OUString& sURL, const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw (css::io::IOException, css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual void SAL_CALL storeToURL( const OUString& sURL, const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw (css::io::IOException, css::uno::RuntimeException, std::exception) override ;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// XModifyBroadcaster
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL addModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL removeModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) throw (css::uno::RuntimeException, std::exception) override;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
// css::util::XModifiable
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual sal_Bool SAL_CALL isModified( ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual void SAL_CALL setModified( sal_Bool bModified ) throw (css::beans::PropertyVetoException, css::uno::RuntimeException, std::exception) override ;
|
2008-10-16 06:57:26 +00:00
|
|
|
|
|
|
|
// XEventBroadcaster
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL addEventListener( const css::uno::Reference< css::document::XEventListener >& aListener ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::document::XEventListener >& aListener ) throw (css::uno::RuntimeException, std::exception) override;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// XDocumentEventBroadcaster
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL addDocumentEventListener( const css::uno::Reference< css::document::XDocumentEventListener >& _Listener ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL removeDocumentEventListener( const css::uno::Reference< css::document::XDocumentEventListener >& _Listener ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL notifyDocumentEvent( const OUString& _EventName, const css::uno::Reference< css::frame::XController2 >& _ViewController, const css::uno::Any& _Supplement ) throw (css::lang::IllegalArgumentException, css::lang::NoSupportException, css::uno::RuntimeException, std::exception) override;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// XPrintable
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPrinter( ) throw (css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual void SAL_CALL setPrinter( const css::uno::Sequence< css::beans::PropertyValue >& aPrinter ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override ;
|
|
|
|
virtual void SAL_CALL print( const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override ;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// XFormDocumentsSupplier
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getFormDocuments( ) throw (css::uno::RuntimeException, std::exception) override;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// XReportDocumentsSupplier
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getReportDocuments( ) throw (css::uno::RuntimeException, std::exception) override;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// XCloseable
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL close( sal_Bool DeliverOwnership ) throw (css::util::CloseVetoException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL addCloseListener( const css::uno::Reference< css::util::XCloseListener >& Listener ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL removeCloseListener( const css::uno::Reference< css::util::XCloseListener >& Listener ) throw (css::uno::RuntimeException, std::exception) override;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// XUIConfigurationManagerSupplier
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual css::uno::Reference< css::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager( ) throw (css::uno::RuntimeException, std::exception) override;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// XDocumentSubStorageSupplier
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentSubStorage( const OUString& aStorageName, sal_Int32 nMode ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Sequence< OUString > SAL_CALL getDocumentSubStoragesNames( ) throw (css::io::IOException, css::uno::RuntimeException, std::exception) override;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
|
|
|
// XOfficeDatabaseDocument
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual css::uno::Reference< css::sdbc::XDataSource > SAL_CALL getDataSource() throw (css::uno::RuntimeException, std::exception) override;
|
2005-03-10 15:34:06 +00:00
|
|
|
|
2008-03-06 16:58:34 +00:00
|
|
|
// XStorageBasedDocument
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL loadFromStorage( const css::uno::Reference< css::embed::XStorage >& xStorage, const css::uno::Sequence< css::beans::PropertyValue >& aMediaDescriptor ) throw (css::lang::IllegalArgumentException, css::frame::DoubleInitializationException, css::io::IOException, css::uno::Exception, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL storeToStorage( const css::uno::Reference< css::embed::XStorage >& xStorage, const css::uno::Sequence< css::beans::PropertyValue >& aMediaDescriptor ) throw (css::lang::IllegalArgumentException, css::io::IOException, css::uno::Exception, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL switchToStorage( const css::uno::Reference< css::embed::XStorage >& xStorage ) throw (css::lang::IllegalArgumentException, css::io::IOException, css::uno::Exception, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentStorage( ) throw (css::io::IOException, css::uno::Exception, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL addStorageChangeListener( const css::uno::Reference< css::document::XStorageChangeListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL removeStorageChangeListener( const css::uno::Reference< css::document::XStorageChangeListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override;
|
2008-03-06 16:58:34 +00:00
|
|
|
|
|
|
|
// XEmbeddedScripts
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getBasicLibraries() throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getDialogLibraries() throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL getAllowMacroExecution() throw (css::uno::RuntimeException, std::exception) override;
|
2008-03-06 16:58:34 +00:00
|
|
|
|
|
|
|
// XScriptInvocationContext
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual css::uno::Reference< css::document::XEmbeddedScripts > SAL_CALL getScriptContainer() throw (css::uno::RuntimeException, std::exception) override;
|
2008-03-06 16:58:34 +00:00
|
|
|
|
|
|
|
// XScriptProviderSupplier
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual css::uno::Reference< css::script::provider::XScriptProvider > SAL_CALL getScriptProvider( ) throw (css::uno::RuntimeException, std::exception) override;
|
2008-03-06 16:58:34 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// XEventsSupplier
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents( ) throw (css::uno::RuntimeException, std::exception) override;
|
2008-10-16 06:57:26 +00:00
|
|
|
|
|
|
|
// XLoadable
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL initNew( ) throw (css::frame::DoubleInitializationException, css::io::IOException, css::uno::Exception, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL load( const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw (css::frame::DoubleInitializationException, css::io::IOException, css::uno::Exception, css::uno::RuntimeException, std::exception) override;
|
2008-10-16 06:57:26 +00:00
|
|
|
|
autorecovery: define a new css.document.XDocumentRecovery interface, implement it in both SFX and DBACCESS, and use it in the autorecovery
In this course, the auto recovery learned to restore multiple views of a document. Also, in the course of the change,
the LoadDispatchListener became superfluous, and was removed.
Also, the loader code in dbaccess was slightly adjusted, since now the connectController call is in the responsibility
of the loader, and must not happen inside the XController::attachModel call anymore. This change made the
ModelControllerConnector class superfluous, so it has been removed, too.
2010-01-05 22:32:38 +01:00
|
|
|
// css.document.XDocumentRecovery
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual sal_Bool SAL_CALL wasModifiedSinceLastSave() throw ( css::uno::RuntimeException, std::exception ) override;
|
|
|
|
virtual void SAL_CALL storeToRecoveryFile( const OUString& i_TargetLocation, const css::uno::Sequence< css::beans::PropertyValue >& i_MediaDescriptor ) throw ( css::uno::RuntimeException, css::io::IOException, css::lang::WrappedTargetException, std::exception ) override;
|
|
|
|
virtual void SAL_CALL recoverFromFile( const OUString& i_SourceLocation, const OUString& i_SalvagedFile, const css::uno::Sequence< css::beans::PropertyValue >& i_MediaDescriptor ) throw ( css::uno::RuntimeException, css::io::IOException, css::lang::WrappedTargetException, std::exception ) override;
|
autorecovery: define a new css.document.XDocumentRecovery interface, implement it in both SFX and DBACCESS, and use it in the autorecovery
In this course, the auto recovery learned to restore multiple views of a document. Also, in the course of the change,
the LoadDispatchListener became superfluous, and was removed.
Also, the loader code in dbaccess was slightly adjusted, since now the connectController call is in the responsibility
of the loader, and must not happen inside the XController::attachModel call anymore. This change made the
ModelControllerConnector class superfluous, so it has been removed, too.
2010-01-05 22:32:38 +01:00
|
|
|
|
2008-04-04 13:33:18 +00:00
|
|
|
// XTitle
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual OUString SAL_CALL getTitle( ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL setTitle( const OUString& sTitle ) throw (css::uno::RuntimeException, std::exception) override;
|
2008-04-04 13:33:18 +00:00
|
|
|
|
|
|
|
// XTitleChangeBroadcaster
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL addTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL removeTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override;
|
2008-04-04 13:33:18 +00:00
|
|
|
|
|
|
|
// XUntitledNumbers
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual ::sal_Int32 SAL_CALL leaseNumber( const css::uno::Reference< css::uno::XInterface >& xComponent ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL releaseNumber( ::sal_Int32 nNumber ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL releaseNumberForComponent( const css::uno::Reference< css::uno::XInterface >& xComponent ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual OUString SAL_CALL getUntitledPrefix( ) throw (css::uno::RuntimeException, std::exception) override;
|
2008-04-04 13:33:18 +00:00
|
|
|
|
2006-04-19 12:18:53 +00:00
|
|
|
/** clears the given object container
|
|
|
|
|
|
|
|
Clearing is done via disposal - the method calls XComponent::dispose at the given object,
|
|
|
|
which must be one of our impl's or our object containers (m_xForms, m_xReports,
|
|
|
|
m_xTableDefinitions, m_xCommandDefinitions)
|
|
|
|
|
|
|
|
@param _rxContainer
|
|
|
|
the container to clear
|
|
|
|
*/
|
|
|
|
static void clearObjectContainer(
|
2015-08-03 09:14:58 +02:00
|
|
|
css::uno::WeakReference< css::container::XNameAccess >& _rxContainer);
|
2006-04-19 12:18:53 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
/** checks whether the component is already initialized, throws a NotInitializedException if not
|
|
|
|
*/
|
|
|
|
inline void checkInitialized() const
|
|
|
|
{
|
|
|
|
if ( !impl_isInitialized() )
|
2015-08-03 09:14:58 +02:00
|
|
|
throw css::lang::NotInitializedException( OUString(), getThis() );
|
2008-10-16 06:57:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/** checks the document is currently in the initialization phase, or already initialized.
|
|
|
|
Throws NotInitializedException if not so.
|
|
|
|
*/
|
|
|
|
inline void checkNotUninitilized() const
|
|
|
|
{
|
|
|
|
if ( impl_isInitialized() || impl_isInitializing() )
|
|
|
|
// fine
|
|
|
|
return;
|
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
throw css::lang::NotInitializedException( OUString(), getThis() );
|
2008-10-16 06:57:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/** checks whether the document is currently being initialized, or already initialized,
|
|
|
|
throws a DoubleInitializationException if so
|
|
|
|
*/
|
|
|
|
inline void checkNotInitialized() const
|
|
|
|
{
|
|
|
|
if ( impl_isInitializing() || impl_isInitialized() )
|
2015-08-03 09:14:58 +02:00
|
|
|
throw css::frame::DoubleInitializationException( OUString(), getThis() );
|
2008-10-16 06:57:26 +00:00
|
|
|
}
|
|
|
|
|
2005-09-23 11:05:10 +00:00
|
|
|
private:
|
2015-08-03 09:14:58 +02:00
|
|
|
css::uno::Reference< css::ui::XUIConfigurationManager2 > getUIConfigurationManager2() throw (css::uno::RuntimeException);
|
2013-02-26 16:24:53 +02:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
/** returns whether the model is currently being initialized
|
|
|
|
*/
|
|
|
|
bool impl_isInitializing() const { return m_eInitState == Initializing; }
|
|
|
|
|
|
|
|
/** returns whether the model is already initialized, i.e. the XModel's "initNew" or "load" methods have been called
|
|
|
|
*/
|
|
|
|
bool impl_isInitialized() const { return m_eInitState == Initialized; }
|
|
|
|
|
|
|
|
/// tells the model it is being initialized now
|
|
|
|
void impl_setInitializing() { m_eInitState = Initializing; }
|
|
|
|
|
|
|
|
/// tells the model its initialization is done
|
|
|
|
void impl_setInitialized();
|
|
|
|
|
2005-09-23 11:05:10 +00:00
|
|
|
/** closes the frames of all connected controllers
|
|
|
|
|
|
|
|
@param _bDeliverOwnership
|
2014-04-29 19:05:05 +00:00
|
|
|
determines if the ownership should be transferred to the component which
|
2005-09-23 11:05:10 +00:00
|
|
|
possibly vetos the closing
|
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
@raises css::util::CloseVetoException
|
2005-09-23 11:05:10 +00:00
|
|
|
if the closing was vetoed by any instance
|
|
|
|
*/
|
2014-04-17 11:16:55 +02:00
|
|
|
void impl_closeControllerFrames_nolck_throw( bool _bDeliverOwnership );
|
2006-02-07 09:18:54 +00:00
|
|
|
|
2007-07-24 11:04:48 +00:00
|
|
|
/** disposes the frames of all controllers which are still left in m_aControllers.
|
|
|
|
*/
|
|
|
|
void impl_disposeControllerFrames_nothrow();
|
|
|
|
|
2006-02-07 09:18:54 +00:00
|
|
|
/** does a reparenting at the given object container to ourself
|
|
|
|
|
|
|
|
Calls XChild::setParent at the given object, which must be one of our impl's or our
|
|
|
|
object containers (m_xForms, m_xReports, m_xTableDefinitions, m_xCommandDefinitions)
|
|
|
|
*/
|
2015-08-03 09:14:58 +02:00
|
|
|
void impl_reparent_nothrow( const css::uno::WeakReference< css::container::XNameAccess >& _rxContainer );
|
2006-02-07 09:18:54 +00:00
|
|
|
|
|
|
|
/** retrieves the forms or reports contained, creates and initializes it, if necessary
|
|
|
|
|
|
|
|
@raises DisposedException
|
|
|
|
if the instance is already disposed
|
|
|
|
@raises IllegalArgumentException
|
|
|
|
if <arg>_eType</arg> is not ODatabaseModelImpl::E_FORM and not ODatabaseModelImpl::E_REPORT
|
|
|
|
*/
|
2015-08-03 09:14:58 +02:00
|
|
|
css::uno::Reference< css::container::XNameAccess >
|
2006-02-07 09:18:54 +00:00
|
|
|
impl_getDocumentContainer_throw( ODatabaseModelImpl::ObjectType _eType );
|
2007-09-26 13:40:04 +00:00
|
|
|
|
2008-03-06 16:58:34 +00:00
|
|
|
/** resets everything
|
|
|
|
|
|
|
|
@precond
|
2015-07-02 18:21:49 +02:00
|
|
|
m_pImpl is not <NULL/>
|
2008-03-06 16:58:34 +00:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
impl_reset_nothrow();
|
|
|
|
|
|
|
|
/** imports the document from the given resource.
|
|
|
|
*/
|
2009-04-24 18:34:24 +00:00
|
|
|
static void
|
|
|
|
impl_import_nolck_throw(
|
2015-08-03 09:14:58 +02:00
|
|
|
const css::uno::Reference< css::uno::XComponentContext >& _rContext,
|
|
|
|
const css::uno::Reference< css::uno::XInterface >& _rxTargetComponent,
|
2009-04-24 18:34:24 +00:00
|
|
|
const ::comphelper::NamedValueCollection& _rResource
|
|
|
|
);
|
2008-03-06 16:58:34 +00:00
|
|
|
|
|
|
|
/** creates a storage for the given URL, truncating it if a file with this name already exists
|
|
|
|
|
2008-06-06 13:02:39 +00:00
|
|
|
@throws Exception
|
|
|
|
if creating the storage failed
|
2008-03-06 16:58:34 +00:00
|
|
|
|
|
|
|
@return
|
2008-06-06 13:02:39 +00:00
|
|
|
the newly created storage for the file at the given URL
|
2008-03-06 16:58:34 +00:00
|
|
|
*/
|
2015-08-03 09:14:58 +02:00
|
|
|
css::uno::Reference< css::embed::XStorage >
|
2008-06-06 13:02:39 +00:00
|
|
|
impl_createStorageFor_throw(
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& _rURL
|
2008-03-06 16:58:34 +00:00
|
|
|
) const;
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
/** sets our "modified" flag
|
|
|
|
|
|
|
|
will notify all our respective listeners, if the "modified" state actually changed
|
|
|
|
|
|
|
|
@param _bModified
|
|
|
|
the (new) flag indicating whether the document is currently modified or not
|
|
|
|
@param _rGuard
|
|
|
|
the guard for our instance. At method entry, the guard must hold the lock. At the moment
|
|
|
|
of method leave, the lock will be released.
|
|
|
|
@precond
|
|
|
|
our mutex is locked
|
|
|
|
@postcond
|
|
|
|
our mutex is not locked
|
2007-09-26 13:40:04 +00:00
|
|
|
*/
|
2014-04-17 11:16:55 +02:00
|
|
|
void impl_setModified_nothrow( bool _bModified, DocumentGuard& _rGuard );
|
2008-03-06 16:58:34 +00:00
|
|
|
|
|
|
|
/** stores the document to the given storage
|
|
|
|
|
|
|
|
Note that the document is actually not rebased to this storage, it just stores a copy of itself
|
|
|
|
to the given target storage.
|
|
|
|
|
2009-04-24 18:34:24 +00:00
|
|
|
@param _rxTargetStorage
|
|
|
|
denotes the storage to store the document into
|
|
|
|
@param _rMediaDescriptor
|
|
|
|
contains additional parameters for storing the document
|
|
|
|
@param _rDocGuard
|
|
|
|
a guard which holds the (only) lock to the document, and which will be temporarily
|
|
|
|
released where necessary (e.g. for notifications, or calling into other components)
|
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
@throws css::uno::IllegalArgumentException
|
2008-03-06 16:58:34 +00:00
|
|
|
if the given storage is <NULL/>.
|
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
@throws css::uno::RuntimeException
|
2008-03-06 16:58:34 +00:00
|
|
|
when any of the used operations throws it
|
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
@throws css::io::IOException
|
2008-03-06 16:58:34 +00:00
|
|
|
when any of the used operations throws it, or any other exception occurs which is no
|
|
|
|
RuntimeException and no IOException
|
|
|
|
*/
|
|
|
|
void impl_storeToStorage_throw(
|
2015-08-03 09:14:58 +02:00
|
|
|
const css::uno::Reference< css::embed::XStorage >& _rxTargetStorage,
|
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >& _rMediaDescriptor,
|
2009-04-24 18:34:24 +00:00
|
|
|
DocumentGuard& _rDocGuard
|
2008-03-06 16:58:34 +00:00
|
|
|
) const;
|
2010-01-28 22:19:50 +01:00
|
|
|
|
|
|
|
/** impl-version of attachResource
|
|
|
|
|
2010-02-15 16:05:58 +01:00
|
|
|
@param i_rLogicalDocumentURL
|
|
|
|
denotes the logical URL of the document, to be reported by getURL/getLocation
|
2010-01-28 22:19:50 +01:00
|
|
|
@param i_rMediaDescriptor
|
|
|
|
denotes additional document parameters
|
|
|
|
@param _rDocGuard
|
|
|
|
is the guard which currently protects the document instance
|
|
|
|
*/
|
2014-04-17 11:16:55 +02:00
|
|
|
bool impl_attachResource(
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& i_rLogicalDocumentURL,
|
2015-08-03 09:14:58 +02:00
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >& i_rMediaDescriptor,
|
2010-01-28 22:19:50 +01:00
|
|
|
DocumentGuard& _rDocGuard
|
|
|
|
);
|
2010-02-02 10:49:34 +01:00
|
|
|
|
|
|
|
/** throws an IOException with the message as defined in the RID_STR_ERROR_WHILE_SAVING resource, wrapping
|
|
|
|
the given caught non-IOException error
|
|
|
|
*/
|
|
|
|
void impl_throwIOExceptionCausedBySave_throw(
|
2015-08-03 09:14:58 +02:00
|
|
|
const css::uno::Any& i_rError,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& i_rTargetURL
|
2010-02-02 10:49:34 +01:00
|
|
|
) const;
|
2008-10-16 06:57:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/** an extended version of the ModelMethodGuard, which also cares for the initialization state
|
|
|
|
of the document
|
|
|
|
*/
|
2009-04-24 18:34:24 +00:00
|
|
|
class DocumentGuard : private ModelMethodGuard
|
2008-10-16 06:57:26 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-05-30 15:35:46 +01:00
|
|
|
enum __InitMethod
|
2008-10-16 06:57:26 +00:00
|
|
|
{
|
|
|
|
// a method which is to initialize the document
|
|
|
|
InitMethod,
|
2014-05-30 15:35:46 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
enum __DefaultMethod
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
// a default method
|
2014-05-30 15:35:46 +01:00
|
|
|
DefaultMethod
|
|
|
|
};
|
|
|
|
|
|
|
|
enum __MethodUsedDuringInit
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
// a method which is used (externally) during the initialization phase
|
2014-05-30 15:35:46 +01:00
|
|
|
MethodUsedDuringInit
|
|
|
|
};
|
|
|
|
|
|
|
|
enum __MethodWithoutInit
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
// a method which does not need initialization - use with care!
|
|
|
|
MethodWithoutInit
|
|
|
|
};
|
|
|
|
|
2014-05-30 15:35:46 +01:00
|
|
|
|
|
|
|
/** constructs the guard
|
|
|
|
|
|
|
|
@param _document
|
|
|
|
the ODatabaseDocument instance
|
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
@throws css::lang::DisposedException
|
2014-05-30 15:35:46 +01:00
|
|
|
If the given component is already disposed
|
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
@throws css::lang::NotInitializedException
|
2014-05-30 15:35:46 +01:00
|
|
|
if the given component is not yet initialized
|
|
|
|
*/
|
|
|
|
DocumentGuard(const ODatabaseDocument& _document, __DefaultMethod)
|
|
|
|
: ModelMethodGuard(_document)
|
|
|
|
, m_document(_document )
|
|
|
|
{
|
|
|
|
m_document.checkInitialized();
|
|
|
|
}
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
/** constructs the guard
|
|
|
|
|
|
|
|
@param _document
|
|
|
|
the ODatabaseDocument instance
|
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
@throws css::lang::DisposedException
|
2008-10-16 06:57:26 +00:00
|
|
|
If the given component is already disposed
|
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
@throws css::frame::DoubleInitializationException
|
2014-05-30 15:35:46 +01:00
|
|
|
if the given component is already initialized, or currently being initialized.
|
|
|
|
*/
|
|
|
|
DocumentGuard(const ODatabaseDocument& _document, __InitMethod)
|
|
|
|
: ModelMethodGuard(_document)
|
|
|
|
, m_document(_document)
|
|
|
|
{
|
|
|
|
m_document.checkNotInitialized();
|
|
|
|
}
|
|
|
|
|
|
|
|
/** constructs the guard
|
|
|
|
|
|
|
|
@param _document
|
|
|
|
the ODatabaseDocument instance
|
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
@throws css::lang::DisposedException
|
2014-05-30 15:35:46 +01:00
|
|
|
If the given component is already disposed
|
2008-10-16 06:57:26 +00:00
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
@throws css::lang::NotInitializedException
|
2014-05-30 15:35:46 +01:00
|
|
|
if the component is still uninitialized, and not in the initialization
|
2008-10-16 06:57:26 +00:00
|
|
|
phase currently.
|
|
|
|
*/
|
2014-05-30 15:35:46 +01:00
|
|
|
DocumentGuard(const ODatabaseDocument& _document, __MethodUsedDuringInit)
|
|
|
|
: ModelMethodGuard(_document)
|
|
|
|
, m_document(_document)
|
|
|
|
{
|
|
|
|
m_document.checkNotUninitilized();
|
|
|
|
}
|
|
|
|
|
|
|
|
/** constructs the guard
|
|
|
|
|
|
|
|
@param _document
|
|
|
|
the ODatabaseDocument instance
|
|
|
|
|
2015-08-03 09:14:58 +02:00
|
|
|
@throws css::lang::DisposedException
|
2014-05-30 15:35:46 +01:00
|
|
|
If the given component is already disposed
|
|
|
|
*/
|
|
|
|
DocumentGuard(const ODatabaseDocument& _document, __MethodWithoutInit)
|
|
|
|
: ModelMethodGuard( _document )
|
|
|
|
, m_document( _document )
|
2008-10-16 06:57:26 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
~DocumentGuard()
|
|
|
|
{
|
|
|
|
}
|
2009-04-24 18:34:24 +00:00
|
|
|
|
|
|
|
void clear()
|
|
|
|
{
|
|
|
|
ModelMethodGuard::clear();
|
|
|
|
}
|
|
|
|
void reset()
|
|
|
|
{
|
|
|
|
ModelMethodGuard::reset();
|
|
|
|
m_document.checkDisposed();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
const ODatabaseDocument& m_document;
|
2005-03-10 15:34:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dbaccess
|
2013-11-05 02:18:53 +01:00
|
|
|
#endif // INCLUDED_DBACCESS_SOURCE_CORE_DATAACCESS_DATABASEDOCUMENT_HXX
|
2010-10-27 12:33:13 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|