LibreOffice Module dbaccess (master) 1
databasedocument.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#pragma once
20
21#include <sal/config.h>
22
23#include <map>
24#include <memory>
25
26#include <ModelImpl.hxx>
28
29#include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
30#include <com/sun/star/frame/DoubleInitializationException.hpp>
31#include <com/sun/star/frame/XModel3.hpp>
32#include <com/sun/star/frame/XTitle.hpp>
33#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
34#include <com/sun/star/frame/XUntitledNumbers.hpp>
35#include <com/sun/star/frame/XStorable.hpp>
36#include <com/sun/star/sdb/XReportDocumentsSupplier.hpp>
37#include <com/sun/star/sdb/XFormDocumentsSupplier.hpp>
38#include <com/sun/star/view/XPrintable.hpp>
39#include <com/sun/star/frame/XModuleManager2.hpp>
40#include <com/sun/star/lang/XMultiServiceFactory.hpp>
41#include <com/sun/star/lang/XServiceInfo.hpp>
42#include <com/sun/star/lang/NotInitializedException.hpp>
43#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
44#include <com/sun/star/embed/XTransactionListener.hpp>
45#include <com/sun/star/document/XStorageBasedDocument.hpp>
46#include <com/sun/star/document/XEmbeddedScripts.hpp>
47#include <com/sun/star/document/XEventsSupplier.hpp>
48#include <com/sun/star/document/XScriptInvocationContext.hpp>
49#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
50#include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
51#include <com/sun/star/frame/XLoadable.hpp>
52#include <com/sun/star/document/XEventBroadcaster.hpp>
53#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
54#include <com/sun/star/document/XDocumentRecovery.hpp>
55#include <com/sun/star/ui/XUIConfigurationManager2.hpp>
56#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
57#include <com/sun/star/util/XCloseable.hpp>
58#include <com/sun/star/util/XModifiable.hpp>
59
63#include <rtl/ref.hxx>
64
65namespace comphelper {
66 class NamedValueCollection;
67}
68
69namespace dbaccess
70{
71
72class DocumentEvents;
73class DocumentEventExecutor;
74class DocumentGuard;
75
76typedef std::vector< css::uno::Reference< css::frame::XController > > Controllers;
77
78// ViewMonitor
83{
84public:
85 explicit ViewMonitor( DocumentEventNotifier& _rEventNotifier )
86 :m_rEventNotifier( _rEventNotifier )
87 ,m_bIsNewDocument( true )
88 ,m_bEverHadController( false )
91 {
92 }
93
94 ViewMonitor(const ViewMonitor&) = delete;
95 const ViewMonitor& operator=(const ViewMonitor&) = delete;
96
97 void reset()
98 {
102 }
103
109 const css::uno::Reference< css::frame::XController >& _rxController
110 );
111
119 const css::uno::Reference< css::frame::XController >& _rxController
120 );
121
123
124private:
129 css::uno::Reference< css::frame::XController >
131};
132
133// ODatabaseDocument
134typedef cppu::PartialWeakComponentImplHelper< css::frame::XModel3
135 , css::util::XModifiable
136 , css::frame::XStorable
137 , css::document::XEventBroadcaster
138 , css::document::XDocumentEventBroadcaster
139 , css::view::XPrintable
140 , css::util::XCloseable
141 , css::lang::XServiceInfo
142 , css::sdb::XOfficeDatabaseDocument
143 , css::ui::XUIConfigurationManagerSupplier
144 , css::document::XStorageBasedDocument
145 , css::document::XEmbeddedScripts
146 , css::document::XScriptInvocationContext
147 , css::script::provider::XScriptProviderSupplier
148 , css::document::XEventsSupplier
149 , css::frame::XLoadable
150 , css::document::XDocumentRecovery
152
153typedef ::cppu::ImplHelper3< css::frame::XTitle
154 , css::frame::XTitleChangeBroadcaster
155 , css::frame::XUntitledNumbers
157
158class ODatabaseDocument :public ModelDependentComponent // ModelDependentComponent must be first!
161{
163 {
167 };
168
169 typedef std::map< OUString, css::uno::Reference< css::frame::XUntitledNumbers > > TNumberedController;
170 css::uno::Reference< css::ui::XUIConfigurationManager2> m_xUIConfigurationManager;
171
175
176 std::unique_ptr<DocumentEvents> m_pEventContainer;
179
180 css::uno::Reference< css::frame::XController > m_xCurrentController;
183
184 css::uno::WeakReference< css::container::XNameAccess > m_xForms;
185 css::uno::WeakReference< css::container::XNameAccess > m_xReports;
186 css::uno::WeakReference< css::script::provider::XScriptProvider > m_xScriptProvider;
187
189 css::uno::Reference< css::frame::XModuleManager2 > m_xModuleManager;
190 css::uno::Reference< css::frame::XTitle > m_xTitleHelper;
192
202
220 const OUString& _rURL,
221 const ::comphelper::NamedValueCollection& _rArguments,
222 const StoreType _eType,
223 DocumentGuard& _rGuard
224 );
225
233 const css::uno::Reference< css::embed::XStorage >& _rxNewRootStorage
234 );
235
238 const css::uno::Reference< css::lang::XComponent > & xComponent,
239 const char* pStreamName,
240 const char* pServiceName,
241 const css::uno::Sequence< css::uno::Any> & rArguments,
242 const css::uno::Sequence< css::beans::PropertyValue> & rMediaDesc,
243 const css::uno::Reference< css::embed::XStorage >& _xStorageToSaveTo
244 ) const;
245
249 const css::uno::Reference< css::io::XOutputStream >& xOutputStream,
250 const css::uno::Reference< css::lang::XComponent >& xComponent,
251 const char* pServiceName,
252 const css::uno::Sequence< css::uno::Any >& rArguments,
253 const css::uno::Sequence< css::beans::PropertyValue> & rMediaDesc
254 ) const;
255
265 const css::uno::Reference< css::embed::XStorage >& _rxTargetStorage,
266 const ::comphelper::NamedValueCollection& _rMediaDescriptor
267 ) const;
268
269 // ModelDependentComponent overridables
270 virtual css::uno::Reference< css::uno::XInterface > getThis() const override;
271
272 css::uno::Reference< css::frame::XTitle > const & impl_getTitleHelper_throw();
273 css::uno::Reference< css::frame::XUntitledNumbers > impl_getUntitledHelper_throw(
274 const css::uno::Reference< css::uno::XInterface >& _xComponent = css::uno::Reference< css::uno::XInterface >());
275
276private:
277 explicit ODatabaseDocument(const ::rtl::Reference<ODatabaseModelImpl>& _pImpl);
278 // Do NOT create those documents directly, always use ODatabaseModelImpl::getModel. Reason is that
279 // ODatabaseDocument requires clear ownership, and in turn lifetime synchronisation with the ModelImpl.
280 // If you create a ODatabaseDocument directly, you might easily create a leak.
281 // #i50905#
282
283protected:
284 virtual void SAL_CALL disposing() override;
285
286 virtual ~ODatabaseDocument() override;
287
288public:
289 struct FactoryAccess { friend class ODatabaseModelImpl; private: FactoryAccess() { } };
290 static rtl::Reference<ODatabaseDocument> createDatabaseDocument( const ::rtl::Reference<ODatabaseModelImpl>& _pImpl, FactoryAccess /*accessControl*/ )
291 {
292 return new ODatabaseDocument( _pImpl );
293 }
294
295 // XServiceInfo
296 virtual OUString SAL_CALL getImplementationName( ) override;
297 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
298 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
299
300 // XInterface
301 virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override;
302 virtual void SAL_CALL acquire( ) noexcept override;
303 virtual void SAL_CALL release( ) noexcept override;
304
305 // XTypeProvider
306 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
307 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
308
309 // XComponent
310 virtual void SAL_CALL dispose( ) override;
311 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
312 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
313
314 // XModel
315 virtual sal_Bool SAL_CALL attachResource( const OUString& URL, const css::uno::Sequence< css::beans::PropertyValue >& Arguments ) override ;
316 virtual OUString SAL_CALL getURL( ) override ;
317 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs( ) override ;
318 virtual void SAL_CALL connectController( const css::uno::Reference< css::frame::XController >& Controller ) override ;
319 virtual void SAL_CALL disconnectController( const css::uno::Reference< css::frame::XController >& Controller ) override ;
320 virtual void SAL_CALL lockControllers( ) override ;
321 virtual void SAL_CALL unlockControllers( ) override ;
322 virtual sal_Bool SAL_CALL hasControllersLocked( ) override ;
323 virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController( ) override ;
324 virtual void SAL_CALL setCurrentController( const css::uno::Reference< css::frame::XController >& Controller ) override ;
325 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getCurrentSelection( ) override ;
326
327 // XModel2
328 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL getControllers( ) override ;
329 virtual css::uno::Sequence< OUString > SAL_CALL getAvailableViewControllerNames( ) override ;
330 virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createDefaultViewController( const css::uno::Reference< css::frame::XFrame >& Frame ) override ;
331 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 ) override ;
332 virtual void SAL_CALL setArgs(const css::uno::Sequence<css::beans::PropertyValue>& aArgs) override;
333
334 // XModel3
335 virtual ::css::uno::Sequence< ::css::beans::PropertyValue > SAL_CALL getArgs2( const ::css::uno::Sequence< ::rtl::OUString >& requestedArgs ) override;
336
337 // XStorable
338 virtual sal_Bool SAL_CALL hasLocation( ) override ;
339 virtual OUString SAL_CALL getLocation( ) override ;
340 virtual sal_Bool SAL_CALL isReadonly( ) override ;
341 virtual void SAL_CALL store( ) override ;
342 virtual void SAL_CALL storeAsURL( const OUString& sURL, const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) override ;
343 virtual void SAL_CALL storeToURL( const OUString& sURL, const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) override ;
344
345 // XModifyBroadcaster
346 virtual void SAL_CALL addModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
347 virtual void SAL_CALL removeModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
348
349 // css::util::XModifiable
350 virtual sal_Bool SAL_CALL isModified( ) override ;
351 virtual void SAL_CALL setModified( sal_Bool bModified ) override ;
352
353 // XEventBroadcaster
354 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::document::XEventListener >& aListener ) override;
355 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::document::XEventListener >& aListener ) override;
356
357 // XDocumentEventBroadcaster
358 virtual void SAL_CALL addDocumentEventListener( const css::uno::Reference< css::document::XDocumentEventListener >& Listener ) override;
359 virtual void SAL_CALL removeDocumentEventListener( const css::uno::Reference< css::document::XDocumentEventListener >& Listener ) override;
360 virtual void SAL_CALL notifyDocumentEvent( const OUString& EventName, const css::uno::Reference< css::frame::XController2 >& ViewController, const css::uno::Any& Supplement ) override;
361
362 // XPrintable
363 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPrinter( ) override ;
364 virtual void SAL_CALL setPrinter( const css::uno::Sequence< css::beans::PropertyValue >& aPrinter ) override ;
365 virtual void SAL_CALL print( const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) override ;
366
367 // XFormDocumentsSupplier
368 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getFormDocuments( ) override;
369
370 // XReportDocumentsSupplier
371 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getReportDocuments( ) override;
372
373 // XCloseable
374 virtual void SAL_CALL close( sal_Bool DeliverOwnership ) override;
375 virtual void SAL_CALL addCloseListener( const css::uno::Reference< css::util::XCloseListener >& Listener ) override;
376 virtual void SAL_CALL removeCloseListener( const css::uno::Reference< css::util::XCloseListener >& Listener ) override;
377
378 // XUIConfigurationManagerSupplier
379 virtual css::uno::Reference< css::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager( ) override;
380
381 // XDocumentSubStorageSupplier
382 virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentSubStorage( const OUString& aStorageName, sal_Int32 nMode ) override;
383 virtual css::uno::Sequence< OUString > SAL_CALL getDocumentSubStoragesNames( ) override;
384
385 // XOfficeDatabaseDocument
386 virtual css::uno::Reference< css::sdbc::XDataSource > SAL_CALL getDataSource() override;
387
388 // XStorageBasedDocument
389 virtual void SAL_CALL loadFromStorage( const css::uno::Reference< css::embed::XStorage >& xStorage, const css::uno::Sequence< css::beans::PropertyValue >& aMediaDescriptor ) override;
390 virtual void SAL_CALL storeToStorage( const css::uno::Reference< css::embed::XStorage >& xStorage, const css::uno::Sequence< css::beans::PropertyValue >& aMediaDescriptor ) override;
391 virtual void SAL_CALL switchToStorage( const css::uno::Reference< css::embed::XStorage >& xStorage ) override;
392 virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentStorage( ) override;
393 virtual void SAL_CALL addStorageChangeListener( const css::uno::Reference< css::document::XStorageChangeListener >& xListener ) override;
394 virtual void SAL_CALL removeStorageChangeListener( const css::uno::Reference< css::document::XStorageChangeListener >& xListener ) override;
395
396 // XEmbeddedScripts
397 virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getBasicLibraries() override;
398 virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getDialogLibraries() override;
399 virtual sal_Bool SAL_CALL getAllowMacroExecution() override;
400
401 // XScriptInvocationContext
402 virtual css::uno::Reference< css::document::XEmbeddedScripts > SAL_CALL getScriptContainer() override;
403
404 // XScriptProviderSupplier
405 virtual css::uno::Reference< css::script::provider::XScriptProvider > SAL_CALL getScriptProvider( ) override;
406
407 // XEventsSupplier
408 virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents( ) override;
409
410 // XLoadable
411 virtual void SAL_CALL initNew( ) override;
412 virtual void SAL_CALL load( const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) override;
413
414 // css.document.XDocumentRecovery
415 virtual sal_Bool SAL_CALL wasModifiedSinceLastSave() override;
416 virtual void SAL_CALL storeToRecoveryFile( const OUString& i_TargetLocation, const css::uno::Sequence< css::beans::PropertyValue >& i_MediaDescriptor ) override;
417 virtual void SAL_CALL recoverFromFile( const OUString& i_SourceLocation, const OUString& i_SalvagedFile, const css::uno::Sequence< css::beans::PropertyValue >& i_MediaDescriptor ) override;
418
419 // XTitle
420 virtual OUString SAL_CALL getTitle( ) override;
421 virtual void SAL_CALL setTitle( const OUString& sTitle ) override;
422
423 // XTitleChangeBroadcaster
424 virtual void SAL_CALL addTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener ) override;
425 virtual void SAL_CALL removeTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener ) override;
426
427 // XUntitledNumbers
428 virtual ::sal_Int32 SAL_CALL leaseNumber( const css::uno::Reference< css::uno::XInterface >& xComponent ) override;
429 virtual void SAL_CALL releaseNumber( ::sal_Int32 nNumber ) override;
430 virtual void SAL_CALL releaseNumberForComponent( const css::uno::Reference< css::uno::XInterface >& xComponent ) override;
431 virtual OUString SAL_CALL getUntitledPrefix( ) override;
432
442 static void clearObjectContainer(
443 css::uno::WeakReference< css::container::XNameAccess >& _rxContainer);
444
447 void checkInitialized() const
448 {
449 if ( !impl_isInitialized() )
450 throw css::lang::NotInitializedException( OUString(), getThis() );
451 }
452
457 {
459 // fine
460 return;
461
462 throw css::lang::NotInitializedException( OUString(), getThis() );
463 }
464
469 {
471 throw css::frame::DoubleInitializationException( OUString(), getThis() );
472 }
473
474private:
476 css::uno::Reference< css::ui::XUIConfigurationManager2 > const & getUIConfigurationManager2();
477
481
484 bool impl_isInitialized() const { return m_eInitState == Initialized; }
485
488
490 void impl_setInitialized();
491
501 void impl_closeControllerFrames_nolck_throw( bool _bDeliverOwnership );
502
506
512 void impl_reparent_nothrow( const css::uno::WeakReference< css::container::XNameAccess >& _rxContainer );
513
521 css::uno::Reference< css::container::XNameAccess >
523
529 void
531
534 static void
536 const css::uno::Reference< css::uno::XComponentContext >& _rContext,
537 const css::uno::Reference< css::uno::XInterface >& _rxTargetComponent,
538 const ::comphelper::NamedValueCollection& _rResource
539 );
540
549 css::uno::Reference< css::embed::XStorage >
551 const OUString& _rURL
552 ) const;
553
564 css::uno::Reference<css::embed::XStorage> impl_GetStorageOrCreateFor_throw(
565 const ::comphelper::NamedValueCollection& _rArguments, const OUString& _rURL) const;
566
581 void impl_setModified_nothrow( bool _bModified, DocumentGuard& _rGuard );
582
607 const css::uno::Reference< css::embed::XStorage >& _rxTargetStorage,
608 const css::uno::Sequence< css::beans::PropertyValue >& _rMediaDescriptor,
609 DocumentGuard& _rDocGuard
610 ) const;
611
622 const OUString& i_rLogicalDocumentURL,
623 const css::uno::Sequence< css::beans::PropertyValue >& i_rMediaDescriptor,
624 DocumentGuard& _rDocGuard
625 );
626
631 const css::uno::Any& i_rError,
632 std::u16string_view i_rTargetURL
633 ) const;
634};
635
640{
641public:
643 {
644 // a method which is to initialize the document
646 };
647
649 {
650 // a default method
652 };
653
655 {
656 // a method which is used (externally) during the initialization phase
658 };
659
661 {
662 // a method which does not need initialization - use with care!
664 };
665
666
679 : ModelMethodGuard(_document)
680 , m_document(_document )
681 {
683 }
684
697 : ModelMethodGuard(_document)
698 , m_document(_document)
699 {
701 }
702
716 : ModelMethodGuard(_document)
717 , m_document(_document)
718 {
720 }
721
731 : ModelMethodGuard( _document )
732 , m_document( _document )
733 {
734 }
735
736 void clear()
737 {
739 }
740 void reset()
741 {
744 }
745
746private:
747
749};
750
751} // namespace dbaccess
752
753/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
an extended version of the ModelMethodGuard, which also cares for the initialization state of the doc...
DocumentGuard(const ODatabaseDocument &_document, MethodWithoutInit_)
constructs the guard
DocumentGuard(const ODatabaseDocument &_document, InitMethod_)
constructs the guard
DocumentGuard(const ODatabaseDocument &_document, DefaultMethod_)
constructs the guard
DocumentGuard(const ODatabaseDocument &_document, MethodUsedDuringInit_)
constructs the guard
const ODatabaseDocument & m_document
a small base class for UNO components whose functionality depends on an ODatabaseModelImpl
Definition: ModelImpl.hxx:452
void checkDisposed() const
checks whether the component is already disposed, throws a DisposedException if so
Definition: ModelImpl.hxx:472
a guard for public methods of objects dependent on an ODatabaseModelImpl instance
Definition: ModelImpl.hxx:513
css::uno::Reference< css::ui::XUIConfigurationManager2 > m_xUIConfigurationManager
void impl_throwIOExceptionCausedBySave_throw(const css::uno::Any &i_rError, std::u16string_view i_rTargetURL) const
throws an IOException with the message as defined in the RID_STR_ERROR_WHILE_SAVING resource,...
virtual ::sal_Int32 SAL_CALL leaseNumber(const css::uno::Reference< css::uno::XInterface > &xComponent) override
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
css::uno::Reference< css::container::XNameAccess > impl_getDocumentContainer_throw(ODatabaseModelImpl::ObjectType _eType)
retrieves the forms or reports contained, creates and initializes it, if necessary
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getCurrentSelection() override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
css::uno::WeakReference< css::container::XNameAccess > m_xReports
ODatabaseDocument(const ::rtl::Reference< ODatabaseModelImpl > &_pImpl)
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
InitState m_eInitState
true if and only if the DatabaseDocument's "initNew" or "load" have been called (or,...
void checkInitialized() const
checks whether the component is already initialized, throws a NotInitializedException if not
virtual sal_Bool SAL_CALL getAllowMacroExecution() override
std::map< OUString, css::uno::Reference< css::frame::XUntitledNumbers > > TNumberedController
virtual void SAL_CALL notifyDocumentEvent(const OUString &EventName, const css::uno::Reference< css::frame::XController2 > &ViewController, const css::uno::Any &Supplement) override
::comphelper::OInterfaceContainerHelper3< css::util::XCloseListener > m_aCloseListener
::comphelper::OInterfaceContainerHelper3< css::util::XModifyListener > m_aModifyListeners
virtual sal_Bool SAL_CALL wasModifiedSinceLastSave() override
virtual OUString SAL_CALL getLocation() override
virtual void SAL_CALL initNew() override
virtual void SAL_CALL unlockControllers() override
void impl_storeToStorage_throw(const css::uno::Reference< css::embed::XStorage > &_rxTargetStorage, const css::uno::Sequence< css::beans::PropertyValue > &_rMediaDescriptor, DocumentGuard &_rDocGuard) const
stores the document to the given storage
css::uno::Reference< css::frame::XTitle > const & impl_getTitleHelper_throw()
void impl_notifyStorageChange_nolck_nothrow(const css::uno::Reference< css::embed::XStorage > &_rxNewRootStorage)
notifies our storage change listeners that our underlying storage changed
virtual void SAL_CALL lockControllers() override
virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getBasicLibraries() override
static rtl::Reference< ODatabaseDocument > createDatabaseDocument(const ::rtl::Reference< ODatabaseModelImpl > &_pImpl, FactoryAccess)
css::uno::Reference< css::ui::XUIConfigurationManager2 > const & getUIConfigurationManager2()
virtual void SAL_CALL setTitle(const OUString &sTitle) override
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getReportDocuments() override
virtual void SAL_CALL connectController(const css::uno::Reference< css::frame::XController > &Controller) override
static void clearObjectContainer(css::uno::WeakReference< css::container::XNameAccess > &_rxContainer)
clears the given object container
void checkNotUninitialized() const
checks the document is currently in the initialization phase, or already initialized.
void impl_closeControllerFrames_nolck_throw(bool _bDeliverOwnership)
closes the frames of all connected controllers
void impl_reparent_nothrow(const css::uno::WeakReference< css::container::XNameAccess > &_rxContainer)
does a reparenting at the given object container to ourself
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL getControllers() override
virtual void SAL_CALL storeToStorage(const css::uno::Reference< css::embed::XStorage > &xStorage, const css::uno::Sequence< css::beans::PropertyValue > &aMediaDescriptor) override
virtual sal_Bool SAL_CALL isReadonly() override
virtual void SAL_CALL removeDocumentEventListener(const css::uno::Reference< css::document::XDocumentEventListener > &Listener) override
DocumentEventNotifier m_aEventNotifier
virtual void SAL_CALL setPrinter(const css::uno::Sequence< css::beans::PropertyValue > &aPrinter) override
css::uno::WeakReference< css::container::XNameAccess > m_xForms
virtual void SAL_CALL storeToURL(const OUString &sURL, const css::uno::Sequence< css::beans::PropertyValue > &lArguments) override
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getFormDocuments() override
virtual void SAL_CALL recoverFromFile(const OUString &i_SourceLocation, const OUString &i_SalvagedFile, const css::uno::Sequence< css::beans::PropertyValue > &i_MediaDescriptor) override
virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentSubStorage(const OUString &aStorageName, sal_Int32 nMode) override
virtual ::css::uno::Sequence< ::css::beans::PropertyValue > SAL_CALL getArgs2(const ::css::uno::Sequence< ::rtl::OUString > &requestedArgs) override
virtual void SAL_CALL switchToStorage(const css::uno::Reference< css::embed::XStorage > &xStorage) override
css::uno::Reference< css::embed::XStorage > impl_createStorageFor_throw(const OUString &_rURL) const
creates a storage for the given URL, truncating it if a file with this name already exists
virtual css::uno::Sequence< OUString > SAL_CALL getDocumentSubStoragesNames() override
virtual void SAL_CALL setCurrentController(const css::uno::Reference< css::frame::XController > &Controller) override
virtual void SAL_CALL removeStorageChangeListener(const css::uno::Reference< css::document::XStorageChangeListener > &xListener) override
virtual void SAL_CALL setArgs(const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
::rtl::Reference< DocumentEventExecutor > m_pEventExecutor
virtual void SAL_CALL dispose() override
bool m_bEmbedded
If XModel::attachResource() was called to inform us that the document is embedded into another one.
TNumberedController m_aNumberedControllers
void impl_disposeControllerFrames_nothrow()
disposes the frames of all controllers which are still left in m_aControllers.
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &_rType) override
void impl_storeAs_throw(const OUString &_rURL, const ::comphelper::NamedValueCollection &_rArguments, const StoreType _eType, DocumentGuard &_rGuard)
stores the document to the given URL, rebases it to the respective new storage, if necessary,...
static void impl_import_nolck_throw(const css::uno::Reference< css::uno::XComponentContext > &_rContext, const css::uno::Reference< css::uno::XInterface > &_rxTargetComponent, const ::comphelper::NamedValueCollection &_rResource)
imports the document from the given resource.
void WriteThroughComponent(const css::uno::Reference< css::lang::XComponent > &xComponent, const char *pStreamName, const char *pServiceName, const css::uno::Sequence< css::uno::Any > &rArguments, const css::uno::Sequence< css::beans::PropertyValue > &rMediaDesc, const css::uno::Reference< css::embed::XStorage > &_xStorageToSaveTo) const
write a single XML stream into the package
virtual css::uno::Reference< css::script::provider::XScriptProvider > SAL_CALL getScriptProvider() override
virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController() override
virtual ~ODatabaseDocument() override
virtual void SAL_CALL releaseNumber(::sal_Int32 nNumber) override
css::uno::Reference< css::frame::XModuleManager2 > m_xModuleManager
such module manager is used to classify new opened documents.
void impl_setModified_nothrow(bool _bModified, DocumentGuard &_rGuard)
sets our "modified" flag
virtual void SAL_CALL release() noexcept override
virtual void SAL_CALL addTitleChangeListener(const css::uno::Reference< css::frame::XTitleChangeListener > &xListener) override
virtual void SAL_CALL storeToRecoveryFile(const OUString &i_TargetLocation, const css::uno::Sequence< css::beans::PropertyValue > &i_MediaDescriptor) override
virtual void SAL_CALL print(const css::uno::Sequence< css::beans::PropertyValue > &xOptions) override
virtual void SAL_CALL disposing() override
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableViewControllerNames() override
virtual void SAL_CALL load(const css::uno::Sequence< css::beans::PropertyValue > &lArguments) override
virtual void SAL_CALL acquire() noexcept override
::comphelper::OInterfaceContainerHelper3< css::document::XStorageChangeListener > m_aStorageListeners
virtual void SAL_CALL addCloseListener(const css::uno::Reference< css::util::XCloseListener > &Listener) override
void checkNotInitialized() const
checks whether the document is currently being initialized, or already initialized,...
void impl_setInitialized()
tells the model its initialization is done
virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createDefaultViewController(const css::uno::Reference< css::frame::XFrame > &Frame) override
virtual sal_Bool SAL_CALL hasControllersLocked() override
virtual sal_Bool SAL_CALL isModified() override
virtual void SAL_CALL disconnectController(const css::uno::Reference< css::frame::XController > &Controller) override
css::uno::WeakReference< css::script::provider::XScriptProvider > m_xScriptProvider
void impl_writeStorage_throw(const css::uno::Reference< css::embed::XStorage > &_rxTargetStorage, const ::comphelper::NamedValueCollection &_rMediaDescriptor) const
writes the content and settings
bool impl_isInitialized() const
returns whether the model is already initialized, i.e.
virtual void SAL_CALL setModified(sal_Bool bModified) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void impl_setInitializing()
tells the model it is being initialized now
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) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual OUString SAL_CALL getTitle() override
virtual void SAL_CALL loadFromStorage(const css::uno::Reference< css::embed::XStorage > &xStorage, const css::uno::Sequence< css::beans::PropertyValue > &aMediaDescriptor) override
bool impl_isInitializing() const
returns whether the model is currently being initialized
virtual void SAL_CALL addDocumentEventListener(const css::uno::Reference< css::document::XDocumentEventListener > &Listener) override
virtual OUString SAL_CALL getURL() override
virtual void SAL_CALL removeCloseListener(const css::uno::Reference< css::util::XCloseListener > &Listener) override
css::uno::Reference< css::embed::XStorage > impl_GetStorageOrCreateFor_throw(const ::comphelper::NamedValueCollection &_rArguments, const OUString &_rURL) const
Extracts storage from arguments, or creates for the given URL, truncating it if a file with this name...
css::uno::Reference< css::frame::XUntitledNumbers > impl_getUntitledHelper_throw(const css::uno::Reference< css::uno::XInterface > &_xComponent=css::uno::Reference< css::uno::XInterface >())
virtual css::uno::Reference< css::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager() override
bool impl_attachResource(const OUString &i_rLogicalDocumentURL, const css::uno::Sequence< css::beans::PropertyValue > &i_rMediaDescriptor, DocumentGuard &_rDocGuard)
impl-version of attachResource
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual void SAL_CALL addStorageChangeListener(const css::uno::Reference< css::document::XStorageChangeListener > &xListener) override
virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getDialogLibraries() override
virtual sal_Bool SAL_CALL hasLocation() override
virtual OUString SAL_CALL getUntitledPrefix() override
virtual css::uno::Reference< css::document::XEmbeddedScripts > SAL_CALL getScriptContainer() override
css::uno::Reference< css::frame::XTitle > m_xTitleHelper
virtual css::uno::Reference< css::uno::XInterface > getThis() const override
returns the component itself
void WriteThroughComponent(const css::uno::Reference< css::io::XOutputStream > &xOutputStream, const css::uno::Reference< css::lang::XComponent > &xComponent, const char *pServiceName, const css::uno::Sequence< css::uno::Any > &rArguments, const css::uno::Sequence< css::beans::PropertyValue > &rMediaDesc) const
write a single output stream (to be called either directly or by WriteThroughComponent(....
virtual sal_Bool SAL_CALL attachResource(const OUString &URL, const css::uno::Sequence< css::beans::PropertyValue > &Arguments) override
css::uno::Reference< css::frame::XController > m_xCurrentController
virtual void SAL_CALL storeAsURL(const OUString &sURL, const css::uno::Sequence< css::beans::PropertyValue > &lArguments) override
virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentStorage() override
virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents() override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPrinter() override
void impl_reset_nothrow()
resets everything
virtual css::uno::Reference< css::sdbc::XDataSource > SAL_CALL getDataSource() override
virtual void SAL_CALL removeTitleChangeListener(const css::uno::Reference< css::frame::XTitleChangeListener > &xListener) override
virtual void SAL_CALL releaseNumberForComponent(const css::uno::Reference< css::uno::XInterface > &xComponent) override
virtual void SAL_CALL close(sal_Bool DeliverOwnership) override
std::unique_ptr< DocumentEvents > m_pEventContainer
helper class monitoring the views of a document, and firing appropriate events when views are attache...
const ViewMonitor & operator=(const ViewMonitor &)=delete
bool onControllerConnected(const css::uno::Reference< css::frame::XController > &_rxController)
to be called when a view (aka controller) has been connected to the document
css::uno::Reference< css::frame::XController > m_xLastConnectedController
DocumentEventNotifier & m_rEventNotifier
bool onSetCurrentController(const css::uno::Reference< css::frame::XController > &_rxController)
to be called when a controller is set as current controller
ViewMonitor(DocumentEventNotifier &_rEventNotifier)
ViewMonitor(const ViewMonitor &)=delete
Type
std::vector< css::uno::Reference< css::frame::XController > > Controllers
::cppu::ImplHelper3< css::frame::XTitle, css::frame::XTitleChangeBroadcaster, css::frame::XUntitledNumbers > ODatabaseDocument_Title
cppu::PartialWeakComponentImplHelper< css::frame::XModel3, 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 > ODatabaseDocument_OfficeDocument
unsigned char sal_Bool
signed char sal_Int8