25#include <com/sun/star/beans/PropertyValue.hpp>
26#include <com/sun/star/beans/XPropertyBag.hpp>
27#include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
28#include <com/sun/star/embed/XStorage.hpp>
29#include <com/sun/star/frame/XModel.hpp>
30#include <com/sun/star/lang/XSingleServiceFactory.hpp>
31#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
32#include <com/sun/star/sdbc/XDataSource.hpp>
33#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
46 class NamedValueCollection;
73 ,
ValueType( _rDefaultValue.getValueType() )
75 OSL_ENSURE(
ValueType.getTypeClass() != css::uno::TypeClass_VOID,
76 "AsciiPropertyValue::AsciiPropertyValue: NULL values not allowed here, use the other CTOR for this!" );
83 OSL_ENSURE(
ValueType.getTypeClass() != css::uno::TypeClass_VOID,
84 "AsciiPropertyValue::AsciiPropertyValue: VOID property values not supported!" );
88class ODatabaseContext;
89class OSharedConnectionManager;
123 css::uno::WeakReference< css::frame::XModel >
m_xModel;
168 const css::uno::Reference< css::uno::XComponentContext >
m_aContext;
174 css::uno::Reference< css::util::XNumberFormatsSupplier >
181 css::uno::Sequence< css::beans::PropertyValue>
190 css::uno::Reference< css::beans::XPropertyBag >
195 css::uno::Reference< css::lang::XEventListener >
197 css::uno::Reference<css::awt::XWindow>
222 const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
228 OUString _sRegistrationName,
229 const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
235 void disposing(
const css::lang::EventObject& Source );
244 css::uno::Reference< css::embed::XStorage >
248 const css::uno::Reference< css::util::XNumberFormatsSupplier >&
254 const ::comphelper::NamedValueCollection&
258 const OUString& _rURL,
259 const css::uno::Sequence< css::beans::PropertyValue >& _rArgs
262 const OUString& i_rLoadedFrom
265 static ::comphelper::NamedValueCollection
274 css::uno::Reference< css::lang::XSingleServiceFactory >
282 const css::uno::Reference< css::embed::XStorage >& _rxStorage
322 css::uno::Reference< css::document::XDocumentSubStorageSupplier >
344 const css::uno::Reference< css::embed::XStorage >& _rxContainerStorage,
345 const OUString& _rPersistentName
381 css::uno::Reference< css::script::XStorageBasedLibraryContainer >
398 css::uno::Reference< css::embed::XStorage >
400 const css::uno::Reference< css::embed::XStorage >& _rxNewRootStorage
437 css::uno::Reference< css::embed::XStorage >
const &
444 const OUString& i_rDocumentURL
463 virtual css::uno::Reference< css::uno::XInterface >
getThis()
const = 0;
475 throw css::lang::DisposedException(
"Component is already disposed.",
getThis() );
a small base class for UNO components whose functionality depends on an ODatabaseModelImpl
void checkDisposed() const
checks whether the component is already disposed, throws a DisposedException if so
::osl::Mutex & getMutex()
::rtl::Reference< ODatabaseModelImpl > m_pImpl
virtual ~ModelDependentComponent()
virtual css::uno::Reference< css::uno::XInterface > getThis() const =0
returns the component itself
ModelDependentComponent(::rtl::Reference< ODatabaseModelImpl > _model)
a guard for public methods of objects dependent on an ODatabaseModelImpl instance
ModelMethodGuard(const ModelDependentComponent &_component)
constructs the guard
SolarMutexResettableGuard m_SolarGuard
ModelDependentComponent & m_rComponent
ModifyLock(ModelDependentComponent &_component)
TContentPtr & getObjectContainer(const ObjectType _eType)
retrieves the requested container of objects (forms/reports/tables/queries)
void setResource(const OUString &_rURL, const css::uno::Sequence< css::beans::PropertyValue > &_rArgs)
void setImposedMacroExecMode(const sal_Int16 _nMacroMode)
virtual bool hasTrustedScriptingSignature(bool bAllowUIToAddAuthor) override
bool m_bDocumentInitialized
true if and only if a database document existed previously (though meanwhile disposed),...
SharedStorage m_xDocumentStorage
virtual void storageIsModified() override
static const AsciiPropertyValue * getDefaultDataSourceSettings()
returns all known data source settings, including their default values
const css::uno::Reference< css::uno::XComponentContext > m_aContext
bool m_bSuppressVersionColumns
ODatabaseModelImpl(const css::uno::Reference< css::uno::XComponentContext > &_rxContext, ODatabaseContext &_pDBContext)
::comphelper::NamedValueCollection stripLoadArguments(const ::comphelper::NamedValueCollection &_rArguments)
OUString m_sDocFileLocation
the URL the document was loaded from
sal_Int16 m_nImposedMacroExecMode
virtual bool macroCallsSeenWhileLoading() const override
css::uno::WeakReference< css::sdbc::XDataSource > m_xDataSource
o3tl::enumarray< ObjectType, TContentPtr > m_aContainer
bool isModifyLocked() const
sal_uInt16 m_nControllerLockCount
css::uno::Reference< css::awt::XWindow > m_xDialogParent
bool commitEmbeddedStorage(bool _bPreventRootCommits=false)
stores the embedded storage ("database")
const css::uno::Reference< css::util::XNumberFormatsSupplier > & getNumberFormatsSupplier()
css::uno::Sequence< OUString > m_aTableFilter
const ::comphelper::NamedValueCollection & getMediaDescriptor() const
virtual sal_Int16 getCurrentMacroExecMode() const override
css::uno::Reference< css::document::XDocumentSubStorageSupplier > getDocumentSubStorageSupplier()
::comphelper::NamedValueCollection m_aMediaDescriptor
void impl_construct_nothrow()
css::uno::WeakReference< css::container::XNameAccess > m_xTableDefinitions
css::uno::Reference< css::embed::XStorage > const & getRootStorage() const
css::uno::Sequence< OUString > m_aTableTypeFilter
css::uno::Reference< css::embed::XStorage > const & getOrCreateRootStorage()
void modelIsDisposing(const bool _wasInitialized, ResetModelAccess)
resets the model to NULL
rtl::Reference< DocumentStorageAccess > m_pStorageAccess
css::uno::Reference< css::lang::XEventListener > m_xSharedConnectionManager
css::uno::Reference< css::script::XStorageBasedLibraryContainer > m_xDialogLibraries
::sfx2::DocumentMacroMode m_aMacroMode
ODatabaseContext & m_rDBContext
sal_Int16 getImposedMacroExecMode() const
returns the macro mode imposed by an external instance, which passed it to attachResource
css::uno::Reference< css::beans::XPropertyBag > m_xSettings
SignatureState m_nScriptingSignatureState
::std::optional< EmbeddedMacros > m_aEmbeddedMacros
do we have any object (forms/reports) which contains macros?
virtual ~ODatabaseModelImpl()
void storeLibraryContainersTo(const css::uno::Reference< css::embed::XStorage > &_rxToRootStorage)
lets our library containers store themself into the given root storage
void impl_switchToLogicalURL(const OUString &i_rDocumentURL)
switches to the given document URL, which denotes the logical URL of the document,...
css::uno::Reference< css::embed::XStorage > getStorage(const ObjectType _eType)
const OUString & getDocFileLocation() const
css::uno::Sequence< css::beans::PropertyValue > m_aLayoutInformation
bool m_bMacroCallsSeenWhileLoading
OUString m_sDocumentURL
the URL which the document should report as its URL
void resetMacroExecutionMode()
resets our macro execute mode, so next time the checkMacrosOnLoading is called, it will behave as if ...
::rtl::Reference< ::sfx2::DocumentStorageModifyListener > m_pStorageModifyListener
OWeakConnectionArray m_aConnections
virtual SignatureState getScriptingSignatureState() override
weld::Window * GetFrameWeld()
void commitRootStorage()
commits our storage
ODatabaseModelImpl(OUString _sRegistrationName, const css::uno::Reference< css::uno::XComponentContext > &_rxContext, ODatabaseContext &_rDBContext)
bool m_bModificationLock
true if setting the Modified flag of the document is currently locked
bool commitStorageIfWriteable_ignoreErrors(const css::uno::Reference< css::embed::XStorage > &_rxStorage)
commits a given storage if it's not readonly, ignoring (but asserting) all errors
DocumentStorageAccess * getDocumentStorageAccess()
sal_Int32 m_nLoginTimeout
const OUString & getURL() const
void setModified(bool bModified)
css::uno::Reference< css::script::XStorageBasedLibraryContainer > getLibraryContainer(bool _bScript)
ensures that ->m_xBasicLibraries resp.
void disposing(const css::lang::EventObject &Source)
css::uno::WeakReference< css::frame::XModel > m_xModel
void setDocFileLocation(const OUString &i_rLoadedFrom)
OSharedConnectionManager * m_pSharedConnectionManager
virtual css::uno::Reference< css::document::XEmbeddedScripts > getEmbeddedDocumentScripts() const override
css::uno::Reference< css::embed::XStorage > const & impl_switchToStorage_throw(const css::uno::Reference< css::embed::XStorage > &_rxNewRootStorage)
bool hadInitializedDocument() const
bool isEmbeddedDatabase() const
determines whether the database document has an embedded data storage
DocumentEventsData m_aDocumentEvents
css::uno::WeakReference< css::container::XNameAccess > m_xCommandDefinitions
void commitStorages()
commits all sub storages
css::uno::Reference< css::lang::XSingleServiceFactory > createStorageFactory() const
creates a ->css::embed::StorageFactory
css::uno::Reference< css::sdbc::XDataSource > getOrCreateDataSource()
returns the data source.
OUString m_sFailedPassword
bool adjustMacroMode_AutoReject()
adjusts our document's macro execution mode, without using any UI, assuming the user would reject exe...
oslInterlockedCount m_refCount
virtual bool documentStorageHasMacros() const override
virtual OUString getDocumentLocation() const override
bool checkMacrosOnLoading()
checks our document's macro execution mode, using the interaction handler as supplied with our load a...
virtual void setCurrentMacroExecMode(sal_uInt16) override
css::uno::Reference< css::frame::XModel > getModel_noCreate() const
returns the model, if there already exists one
css::uno::Reference< css::embed::XStorage > switchToStorage(const css::uno::Reference< css::embed::XStorage > &_rxNewRootStorage)
rebases the document to the given storage
DocumentEventsData & getDocumentEvents()
css::uno::Reference< css::script::XStorageBasedLibraryContainer > m_xBasicLibraries
EmbeddedMacros determineEmbeddedMacros()
determines which kind of embedded macros are present in the document
css::uno::Reference< css::util::XNumberFormatsSupplier > m_xNumberFormatsSupplier
css::uno::Reference< css::frame::XModel > createNewModel_deliverOwnership()
returns a new ->ODatabaseDocument
static OUString getObjectContainerStorageName(const ObjectType _eType)
returns the name of the storage which is used to stored objects of the given type,...
static bool objectHasMacros(const css::uno::Reference< css::embed::XStorage > &_rxContainerStorage, const OUString &_rPersistentName)
determines whether a given object storage contains macros
const css::uno::Reference< INTERFACE > & getTyped() const
std::shared_ptr< OContentHelper_Impl > TContentPtr
std::vector< css::uno::WeakReference< css::sdbc::XConnection > > OWeakConnectionArray
std::map< OUString, css::uno::Sequence< css::beans::PropertyValue > > DocumentEventsData
::utl::SharedUNOComponent< css::embed::XStorage > SharedStorage
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
const css::uno::Type & ValueType
css::uno::Any DefaultValue
AsciiPropertyValue(const char *_pAsciiName, const css::uno::Any &_rDefaultValue)
AsciiPropertyValue(const char *_pAsciiName, const css::uno::Type &_rValeType)