24#include <com/sun/star/lang/XSingleServiceFactory.hpp>
25#include <com/sun/star/frame/TaskCreator.hpp>
26#include <com/sun/star/frame/XFrame.hpp>
27#include <com/sun/star/sdb/CommandType.hpp>
28#include <com/sun/star/sdb/application/XTableUIProvider.hpp>
29#include <com/sun/star/beans/NamedValue.hpp>
32#include <osl/diagnose.h>
55 OUString _sComponentURL )
57 ,m_xParentFrame ( _rxParentFrame )
58 ,m_xApplication ( _rxApplication )
59 ,m_sComponentURL (
std::move( _sComponentURL ))
61 OSL_ENSURE(
m_xORB.is(),
"DatabaseObjectView::DatabaseObjectView: invalid service factory!" );
62 OSL_ENSURE(
m_xApplication.is(),
"DatabaseObjectView::DatabaseObjectView: invalid connection!" );
75 return doCreateView(
Any( _xDataSource ), OUString(), i_rDispatchArgs );
79 const ::comphelper::NamedValueCollection& i_rDispatchArgs )
81 return doCreateView( _rDataSource, _rName, i_rDispatchArgs );
85 const ::comphelper::NamedValueCollection& i_rCreationArgs )
89 aDispatchArgs.
merge( i_rCreationArgs,
false );
91 aDispatchArgs.
merge( i_rCreationArgs,
true );
108 Any(NamedValue(
"TopWindow",
Any(
true))),
109 Any(NamedValue(
"SupportPersistentWindowState",
112 m_xFrameLoader.set(xFact->createInstanceWithArguments(lArgs), UNO_QUERY_THROW);
120 ENSURE_OR_THROW( pContainerWindow,
"no implementation access to the frame's container window!" );
121 pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WindowExtendedStyle::Document );
125 xReturn = xFrameLoader->loadComponentFromURL(
129 i_rDispatchArgs.getPropertyValues()
142 const Any& _aDataSource,
146 OUString sDataSource;
148 if ( _aDataSource >>= sDataSource )
152 else if ( _aDataSource >>= xDataSource )
169 const OUString& _rObjectName )
173 const bool bIncludeQueryName = !_rObjectName.isEmpty();
179 if ( bIncludeQueryName )
184 if ( bEditViewAsSQLCommand )
197 const OUString& _rObjectName )
201 if ( !_rObjectName.isEmpty() )
208 const ::comphelper::NamedValueCollection& i_rCreationArgs )
210 bool bIsNewDesign = _rObjectName.isEmpty();
217 if ( !xDesigner.is() )
233 if ( xTableUIProv.is() )
234 xDesigner = xTableUIProv->getTableEditor(
getApplicationUI(), _rTableName );
252 const OUString& _rQualifiedName)
255 OSL_ENSURE( !_rQualifiedName.isEmpty(),
"A Table name must be set");
264 ::dbtools::qualifiedNameComponents(
getConnection()->getMetaData(), _rQualifiedName,
sCatalog,
sSchema, sTable, ::dbtools::EComposeRule::InDataManipulation );
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
bool put(const OUString &_rValueName, const VALUE_TYPE &_rValue)
NamedValueCollection & merge(const NamedValueCollection &_rAdditionalValues, bool _bOverwriteExisting)
VALUE_TYPE getOrDefault(const OUString &_rValueName, const VALUE_TYPE &_rDefault) const
static void executeModalDialogAsync(const css::uno::Reference< css::ui::dialogs::XExecutableDialog > &_rxDialog)
executes the given dialog asynchronously, but still modal
encapsulates access to the view of a database object.
css::uno::Reference< css::lang::XComponent > openExisting(const css::uno::Any &_aDataSource, const OUString &_rName, const ::comphelper::NamedValueCollection &i_rDispatchArgs)
opens a view for an existent object
css::uno::Reference< css::lang::XComponent > doDispatch(const ::comphelper::NamedValueCollection &i_rDispatchArgs)
css::uno::Reference< css::frame::XFrame > m_xParentFrame
virtual void fillDispatchArgs(::comphelper::NamedValueCollection &i_rDispatchArgs, const css::uno::Any &_rDataSource, const OUString &_rObjectName)
css::uno::Reference< css::sdbc::XConnection > getConnection() const
css::uno::Reference< css::lang::XComponent > createNew(const css::uno::Reference< css::sdbc::XDataSource > &_xDataSource, const ::comphelper::NamedValueCollection &i_rDispatchArgs=::comphelper::NamedValueCollection())
opens a view for a to-be-created object
css::uno::Reference< css::frame::XComponentLoader > m_xFrameLoader
css::uno::Reference< css::uno::XComponentContext > m_xORB
css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > m_xApplication
const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > & getApplicationUI() const
DatabaseObjectView(const css::uno::Reference< css::uno::XComponentContext > &_rxORB, const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > &_rxApplication, const css::uno::Reference< css::frame::XFrame > &_rxParentFrame, OUString _sComponentURL)
virtual css::uno::Reference< css::lang::XComponent > doCreateView(const css::uno::Any &_rDataSource, const OUString &_rObjectName, const ::comphelper::NamedValueCollection &i_rCreationArgs)
creates the desired view
virtual void fillDispatchArgs(::comphelper::NamedValueCollection &i_rDispatchArgs, const css::uno::Any &_aDataSource, const OUString &_rObjectName) override
QueryDesigner(const css::uno::Reference< css::uno::XComponentContext > &_rxORB, const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > &_rxApplication, const css::uno::Reference< css::frame::XFrame > &_rxParentFrame, bool _bCreateView)
RelationDesigner(const css::uno::Reference< css::uno::XComponentContext > &_rxORB, const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > &_rxApplication, const css::uno::Reference< css::frame::XFrame > &_rxParentFrame)
virtual void fillDispatchArgs(::comphelper::NamedValueCollection &i_rDispatchArgs, const css::uno::Any &_aDataSource, const OUString &_rQualifiedName) override
ResultSetBrowser(const css::uno::Reference< css::uno::XComponentContext > &_rxORB, const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > &_rxApplication, const css::uno::Reference< css::frame::XFrame > &_rxParentFrame, bool _bTable)
css::uno::Reference< css::uno::XInterface > impl_getConnectionProvidedDesigner_nothrow(const OUString &_rTableName)
retrieves the table designer component as provided by the connection, if any
virtual void fillDispatchArgs(::comphelper::NamedValueCollection &i_rDispatchArgs, const css::uno::Any &_aDataSource, const OUString &_rObjectName) override
TableDesigner(const css::uno::Reference< css::uno::XComponentContext > &_rxORB, const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > &_rxApplication, const css::uno::Reference< css::frame::XFrame > &_rxParentFrame)
virtual css::uno::Reference< css::lang::XComponent > doCreateView(const css::uno::Any &_rDataSource, const OUString &_rObjectName, const ::comphelper::NamedValueCollection &i_rCreationArgs) override
creates the desired view
#define ENSURE_OR_THROW(c, m)
#define DBG_UNHANDLED_EXCEPTION(...)
constexpr OUStringLiteral PROPERTY_COMMAND(u"Command")
constexpr OUStringLiteral PROPERTY_UPDATE_TABLENAME(u"UpdateTableName")
constexpr OUStringLiteral PROPERTY_UPDATE_SCHEMANAME(u"UpdateSchemaName")
constexpr OUStringLiteral URL_COMPONENT_RELATIONDESIGN
constexpr OUStringLiteral PROPERTY_ACTIVE_CONNECTION(u"ActiveConnection")
constexpr OUStringLiteral URL_COMPONENT_DATASOURCEBROWSER
constexpr OUStringLiteral URL_COMPONENT_QUERYDESIGN
constexpr OUStringLiteral PROPERTY_ESCAPE_PROCESSING(u"EscapeProcessing")
constexpr OUStringLiteral URL_COMPONENT_VIEWDESIGN
constexpr OUStringLiteral PROPERTY_CURRENTTABLE(u"CurrentTable")
constexpr OUStringLiteral PROPERTY_DATASOURCE(u"DataSource")
constexpr OUStringLiteral PROPERTY_ENABLE_BROWSER(u"EnableBrowser")
constexpr OUStringLiteral PROPERTY_UPDATE_CATALOGNAME(u"UpdateCatalogName")
constexpr OUStringLiteral PROPERTY_DATASOURCENAME(u"DataSourceName")
constexpr OUStringLiteral PROPERTY_GRAPHICAL_DESIGN(u"GraphicalDesign")
constexpr OUStringLiteral PROPERTY_COMMAND_TYPE(u"CommandType")
constexpr OUStringLiteral URL_COMPONENT_TABLEDESIGN
Reference< XFrame > xFrame
the frame which the component resides in. Must not be <NULL>