22#include <com/sun/star/container/XNameAccess.hpp>
23#include <com/sun/star/sdbc/XConnection.hpp>
24#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
25#include <com/sun/star/uno/XComponentContext.hpp>
26#include <com/sun/star/beans/XPropertySet.hpp>
33#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
34#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
35#include <com/sun/star/task/XInteractionHandler.hpp>
45 virtual bool operator()(
const OUString& _sColumnName)
const = 0;
62 bool operator()(
const OUString& _sColumnName)
const override
74 const ::comphelper::UStringMixEqual& _aCase)
82 bool operator()(
const OUString& _sColumnName)
const override
85 [
this, &_sColumnName](
const OUString& lhs)
86 { return m_aCase(lhs, _sColumnName); });
110 virtual void copyUISettingsTo(
const css::uno::Reference< css::beans::XPropertySet >& _rxObject )
const = 0;
112 virtual css::uno::Sequence< OUString >
115 virtual css::uno::Sequence< OUString >
126 virtual void copyFilterAndSortingTo(
const css::uno::Reference< css::sdbc::XConnection >& _xConnection,
const css::uno::Reference< css::beans::XPropertySet >& _rxObject )
const = 0;
133 virtual ::utl::SharedUNOComponent< css::sdbc::XPreparedStatement >
145 css::uno::Reference< css::beans::XPropertySet >
m_xObject;
151 const css::uno::Reference< css::sdbc::XConnection >& _rxConnection,
152 const css::uno::Reference< css::beans::XPropertySet >& _rxObject
157 virtual bool isView()
const override;
158 virtual void copyUISettingsTo(
const css::uno::Reference< css::beans::XPropertySet >& _rxObject )
const override;
159 virtual void copyFilterAndSortingTo(
const css::uno::Reference< css::sdbc::XConnection >& _xConnection,
const css::uno::Reference< css::beans::XPropertySet >& _rxObject )
const override;
160 virtual css::uno::Sequence< OUString >
162 virtual css::uno::Sequence< OUString >
166 virtual ::utl::SharedUNOComponent< css::sdbc::XPreparedStatement >
185 const css::uno::Reference< css::sdbc::XConnection >& _rxConnection,
191 virtual bool isView()
const override;
192 virtual void copyUISettingsTo(
const css::uno::Reference< css::beans::XPropertySet >& _rxObject )
const override;
193 virtual void copyFilterAndSortingTo(
const css::uno::Reference< css::sdbc::XConnection >& _xConnection,
const css::uno::Reference< css::beans::XPropertySet >& _rxObject )
const override;
194 virtual css::uno::Sequence< OUString >
196 virtual css::uno::Sequence< OUString >
200 virtual ::utl::SharedUNOComponent< css::sdbc::XPreparedStatement >
219 typedef std::map<OUString, OUString, ::comphelper::UStringMixLess>
TNameMapping;
250 css::uno::Reference< css::uno::XComponentContext>
m_xContext;
282 bool supportsType(sal_Int32 _nDataType,sal_Int32& _rNewDataType);
300 const OUString& _rDefaultName,
301 sal_Int16 _nOperation,
303 const css::uno::Reference< css::sdbc::XConnection >& _xSourceConnection,
304 const css::uno::Reference< css::sdbc::XConnection >& _xConnection,
305 const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
306 const css::uno::Reference< css::task::XInteractionHandler>& _xInteractionHandler
312 OUString _sDefaultName,
313 sal_Int16 _nOperation,
316 const css::uno::Reference< css::sdbc::XConnection >& _xConnection,
317 const css::uno::Reference< css::util::XNumberFormatter >& _xFormatter,
320 const css::uno::Reference< css::uno::XComponentContext >& _rxContext
356 static bool supportsPrimaryKey(
const css::uno::Reference< css::sdbc::XConnection >& _rxConnection );
359 static bool supportsViews(
const css::uno::Reference< css::sdbc::XConnection >& _rxConnection );
387 css::uno::Reference< css::beans::XPropertySet >
returnTable();
388 css::uno::Reference< css::beans::XPropertySet >
getTable()
const;
389 css::uno::Reference< css::beans::XPropertySet >
createTable();
390 css::uno::Reference< css::beans::XPropertySet >
createView()
const;
397 const OUString& _sColumnName,
398 std::u16string_view _sExtraChars,
399 sal_Int32 _nMaxNameLen);
408 void showError(
const OUString& _sErrorMessage);
interface to an object to copy to another DB, using the OCopyTableWizard
virtual ::utl::SharedUNOComponent< css::sdbc::XPreparedStatement > getPreparedSelectStatement() const =0
returns the prepared statement which can be used to retrieve the data of the to-be-copied object
virtual css::uno::Sequence< OUString > getPrimaryKeyColumnNames() const =0
retrieves the names of the primary keys of the to-be-copied object
virtual css::uno::Sequence< OUString > getColumnNames() const =0
retrieves the column names of the to-be-copied object
virtual void copyFilterAndSortingTo(const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const css::uno::Reference< css::beans::XPropertySet > &_rxObject) const =0
copies the filter and sorting
virtual OUString getSelectStatement() const =0
returns the SELECT statement which can be used to retrieve the data of the to-be-copied object
virtual OFieldDescription * createFieldDescription(const OUString &_rColumnName) const =0
creates a OFieldDescription for the given column of the to-be-copied object
virtual OUString getQualifiedObjectName() const =0
retrieves the fully qualified name of the object to copy
virtual ~ICopyTableSourceObject()
virtual void copyUISettingsTo(const css::uno::Reference< css::beans::XPropertySet > &_rxObject) const =0
copies the UI settings of the object to the given target object.
virtual bool isView() const =0
determines whether the object is a view
::utl::SharedUNOComponent< css::sdbc::XPreparedStatement > const & impl_ensureStatement_throw()
css::uno::Reference< css::sdbc::XConnection > m_xConnection
void impl_ensureColumnInfo_throw()
NamedTableCopySource(const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, OUString _sTableName)
virtual void copyFilterAndSortingTo(const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const css::uno::Reference< css::beans::XPropertySet > &_rxObject) const override
copies the filter and sorting
std::vector< OFieldDescription > m_aColumnInfo
virtual css::uno::Sequence< OUString > getColumnNames() const override
retrieves the column names of the to-be-copied object
virtual OFieldDescription * createFieldDescription(const OUString &_rColumnName) const override
creates a OFieldDescription for the given column of the to-be-copied object
OUString m_sTableBareName
virtual ::utl::SharedUNOComponent< css::sdbc::XPreparedStatement > getPreparedSelectStatement() const override
returns the prepared statement which can be used to retrieve the data of the to-be-copied object
::utl::SharedUNOComponent< css::sdbc::XPreparedStatement > m_xStatement
virtual css::uno::Sequence< OUString > getPrimaryKeyColumnNames() const override
retrieves the names of the primary keys of the to-be-copied object
virtual void copyUISettingsTo(const css::uno::Reference< css::beans::XPropertySet > &_rxObject) const override
copies the UI settings of the object to the given target object.
virtual bool isView() const override
determines whether the object is a view
virtual OUString getSelectStatement() const override
returns the SELECT statement which can be used to retrieve the data of the to-be-copied object
virtual OUString getQualifiedObjectName() const override
retrieves the fully qualified name of the object to copy
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData
ODatabaseExport::TColumnVector m_aDestVec
const ODatabaseExport::TColumnVector & getSrcVector() const
const css::uno::Reference< css::uno::XComponentContext > & GetComponentContext() const
const css::uno::Reference< css::util::XNumberFormatter > & GetFormatter() const
virtual bool DeactivatePage() override
const OTypeInfoMap & getDestTypeInfo() const
void setUseHeaderLine(bool _bUseHeaderLine)
static void appendKey(css::uno::Reference< css::sdbcx::XKeysSupplier > const &_rxSup, const ODatabaseExport::TColumnVector *_pVec)
const ICopyTableSourceObject & m_rSourceObject
const OUString & getPrimaryKeyName() const
returns the name of the primary key
virtual ~OCopyTableWizard() override
const OTypeInfoMap & getTypeInfo() const
bool supportsPrimaryKey() const
bool m_bCreatePrimaryKeyColumn
void EnableNextButton(bool bEnable)
css::uno::Reference< css::util::XNumberFormatter > m_xFormatter
void replaceColumn(sal_Int32 _nPos, OFieldDescription *_pField, const OUString &_sOldName)
replaces a field description with another one.
void AddWizardPage(std::unique_ptr< OWizardPage > xPage)
void clearDestColumns()
clears the dest vectors
void showError(const css::uno::Any &_aError)
static void appendColumns(css::uno::Reference< css::sdbcx::XColumnsSupplier > const &_rxColSup, const ODatabaseExport::TColumnVector *_pVec, bool _bKeyColumns=false)
sal_Int16 getOperation() const
void setOperation(const sal_Int16 _nOperation)
virtual void ActivatePage() override
DECL_LINK(ImplPrevHdl, weld::Button &, void)
sal_uInt16 GetCurLevel() const
bool supportsType(sal_Int32 _nDataType, sal_Int32 &_rNewDataType)
static bool supportsPrimaryKey(const css::uno::Reference< css::sdbc::XConnection > &_rxConnection)
DECL_LINK(ImplNextHdl, weld::Button &, void)
ODatabaseExport::TColumns & getDestColumns()
Wizard_Button_Style m_ePressed
TOTypeInfoSP const & getDestTypeInfo(sal_Int32 _nPos) const
const ODatabaseExport::TColumnVector & getDestVector() const
css::lang::Locale m_aLocale
ODatabaseExport::TPositions m_vColumnPositions
const ODatabaseExport::TPositions & GetColumnPositions() const
std::map< OUString, OUString, ::comphelper::UStringMixLess > TNameMapping
std::vector< sal_Int32 > m_vColumnTypes
ODatabaseExport::TColumnVector m_vSourceVec
css::uno::Reference< css::beans::XPropertySet > getTable() const
css::uno::Reference< css::beans::XPropertySet > returnTable()
const std::vector< sal_Int32 > & GetColumnTypes() const
OTypeInfoMap m_aDestTypeInfo
void insertColumn(sal_Int32 _nPos, OFieldDescription *_pField)
bool m_bDeleteSourceColumns
const ODatabaseExport::TColumns & getSourceColumns() const
css::uno::Reference< css::beans::XPropertySet > createView() const
OUString convertColumnName(const TColumnFindFunctor &_rCmpFunctor, const OUString &_sColumnName, std::u16string_view _sExtraChars, sal_Int32 _nMaxNameLen)
TNameMapping m_mNameMapping
OUString createUniqueName(const OUString &_sName)
void showColumnTypeNotSupported(std::u16string_view _rColumnName)
css::uno::Reference< css::beans::XPropertySet > createTable()
bool m_bInterConnectionCopy
bool shouldCreatePrimaryKey() const
returns whether a primary key should be created in the target database
bool supportsViews() const
css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHandler
void loadData(const ICopyTableSourceObject &_rSourceObject, ODatabaseExport::TColumns &_rColumns, ODatabaseExport::TColumnVector &_rColVector)
Wizard_Button_Style GetPressedButton() const
std::vector< OTypeInfoMap::iterator > m_aTypeInfoIndex
css::uno::Reference< css::sdbc::XConnection > m_xDestConnection
TOTypeInfoSP convertType(const TOTypeInfoSP &_pType, bool &_bNotConvert)
void removeColumnNameFromNameMap(const OUString &_sName)
weld::Button & GetOKButton()
bool CheckColumns(sal_Int32 &_rnBreakPos)
bool UseHeaderLine() const
ODatabaseExport::TColumns m_vSourceColumns
css::uno::Reference< css::uno::XComponentContext > m_xContext
void showError(const OUString &_sErrorMessage)
DECL_LINK(ImplOKHdl, weld::Button &, void)
sal_Int32 getMaxColumnNameLength() const
OCopyTableWizard(weld::Window *pParent, const OUString &_rDefaultName, sal_Int16 _nOperation, const ICopyTableSourceObject &_rSourceObject, const css::uno::Reference< css::sdbc::XConnection > &_xSourceConnection, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const css::uno::Reference< css::task::XInteractionHandler > &_xInteractionHandler)
std::vector< OTypeInfoMap::iterator > m_aDestTypeInfoIndex
void setCreatePrimaryKey(bool _bDoCreate, const OUString &_rSuggestedName)
static bool supportsViews(const css::uno::Reference< css::sdbc::XConnection > &_rxConnection)
virtual std::unique_ptr< BuilderPage > createPage(vcl::WizardTypes::WizardState) override
const OUString & getName() const
ODatabaseExport::TColumns m_vDestColumns
OCopyTableWizard(weld::Window *pParent, OUString _sDefaultName, sal_Int16 _nOperation, ODatabaseExport::TColumns &&_rDestColumns, const ODatabaseExport::TColumnVector &_rSourceColVec, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const css::uno::Reference< css::util::XNumberFormatter > &_xFormatter, TypeSelectionPageFactory _pTypeSelectionPageFactory, SvStream &_rTypeSelectionPageArg, const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
weld::Container * CreatePageContainer()
const css::lang::Locale & GetLocale() const
std::map< OUString, OFieldDescription *, ::comphelper::UStringMixLess > TColumns
std::vector< std::pair< sal_Int32, sal_Int32 > > TPositions
std::vector< TColumns::const_iterator > TColumnVector
virtual css::uno::Sequence< OUString > getColumnNames() const override
retrieves the column names of the to-be-copied object
virtual OUString getQualifiedObjectName() const override
retrieves the fully qualified name of the object to copy
virtual bool isView() const override
determines whether the object is a view
virtual void copyFilterAndSortingTo(const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const css::uno::Reference< css::beans::XPropertySet > &_rxObject) const override
copies the filter and sorting
ObjectCopySource(const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const css::uno::Reference< css::beans::XPropertySet > &_rxObject)
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData
virtual OUString getSelectStatement() const override
returns the SELECT statement which can be used to retrieve the data of the to-be-copied object
css::uno::Reference< css::sdbc::XConnection > m_xConnection
css::uno::Reference< css::container::XNameAccess > m_xObjectColumns
css::uno::Reference< css::beans::XPropertySetInfo > m_xObjectPSI
virtual ::utl::SharedUNOComponent< css::sdbc::XPreparedStatement > getPreparedSelectStatement() const override
returns the prepared statement which can be used to retrieve the data of the to-be-copied object
virtual css::uno::Sequence< OUString > getPrimaryKeyColumnNames() const override
retrieves the names of the primary keys of the to-be-copied object
virtual OFieldDescription * createFieldDescription(const OUString &_rColumnName) const override
creates a OFieldDescription for the given column of the to-be-copied object
virtual void copyUISettingsTo(const css::uno::Reference< css::beans::XPropertySet > &_rxObject) const override
copies the UI settings of the object to the given target object.
css::uno::Reference< css::beans::XPropertySet > m_xObject
virtual bool operator()(const OUString &_sColumnName) const =0
TExportColumnFindFunctor(ODatabaseExport::TColumns *_pColumns)
bool operator()(const OUString &_sColumnName) const override
ODatabaseExport::TColumns * m_pColumns
virtual ~TExportColumnFindFunctor()
TMultiListBoxEntryFindFunctor(std::vector< OUString > *_pVector, const ::comphelper::UStringMixEqual &_aCase)
::comphelper::UStringMixEqual m_aCase
bool operator()(const OUString &_sColumnName) const override
std::vector< OUString > * m_pVector
virtual ~TMultiListBoxEntryFindFunctor()
std::unique_ptr< weld::Button > m_xFinish
WizardTypes::WizardState getCurrentState() const
std::unique_ptr< OWizTypeSelect >(* TypeSelectionPageFactory)(weld::Container *, OCopyTableWizard *, SvStream &)
std::multimap< sal_Int32, TOTypeInfoSP > OTypeInfoMap
std::shared_ptr< OTypeInfo > TOTypeInfoSP