22#include <core_resource.hxx>
27#include <com/sun/star/sdb/DatabaseContext.hpp>
28#include <com/sun/star/sdb/XSingleSelectQueryAnalyzer.hpp>
29#include <com/sun/star/sdb/XCompletedConnection.hpp>
30#include <com/sun/star/sdbc/XDataSource.hpp>
31#include <com/sun/star/sdb/SQLContext.hpp>
32#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
33#include <com/sun/star/sdbcx/XViewsSupplier.hpp>
34#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
35#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
36#include <com/sun/star/sdbcx/XAppend.hpp>
37#include <com/sun/star/sdbc/XRow.hpp>
38#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
39#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
40#include <com/sun/star/sdbc/ColumnValue.hpp>
41#include <com/sun/star/task/InteractionHandler.hpp>
42#include <com/sun/star/ucb/XContent.hpp>
43#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
44#include <com/sun/star/beans/PropertyValue.hpp>
45#include <com/sun/star/container/XNameContainer.hpp>
46#include <com/sun/star/ucb/InteractiveIOException.hpp>
47#include <com/sun/star/sdb/XDocumentDataSource.hpp>
48#include <com/sun/star/ucb/IOErrorCode.hpp>
52#include <com/sun/star/beans/XPropertySetInfo.hpp>
53#include <com/sun/star/beans/XPropertySet.hpp>
54#include <com/sun/star/container/XNameAccess.hpp>
55#include <com/sun/star/container/XHierarchicalNameContainer.hpp>
56#include <com/sun/star/lang/XMultiServiceFactory.hpp>
57#include <com/sun/star/awt/TextAlign.hpp>
64#include <svx/svxids.hrc>
77#include <com/sun/star/container/XChild.hpp>
78#include <com/sun/star/util/NumberFormatter.hpp>
79#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
80#include <com/sun/star/util/XNumberFormatter.hpp>
110using namespace ::
svt;
111using ::com::sun::star::ucb::InteractiveIOException;
112using ::com::sun::star::ucb::IOErrorCode_NO_FILE;
113using ::com::sun::star::ucb::IOErrorCode_NOT_EXISTING;
124 xProp.set(_xDatabaseContext->getByName(_rsDataSourceName),UNO_QUERY);
139 if ( !_xDataSource.is() )
141 SAL_WARN(
"dbaccess.ui",
"createConnection: could not retrieve the data source!");
145 OUString sPwd, sUser;
146 bool bPwdReq =
false;
155 SAL_WARN(
"dbaccess.ui",
"createConnection: error while retrieving data source properties!");
160 if(bPwdReq && sPwd.isEmpty())
163 if (!xConnectionCompletion.is())
165 SAL_WARN(
"dbaccess.ui",
"createConnection: missing an interface ... need an error message here!");
170 _rOUTConnection = xConnectionCompletion->connectWithCompletion(xHandler);
176 _rOUTConnection = xDataSource->getConnection(sUser, sPwd);
180 if (xComponent.is() && _rEvtLst.is())
181 xComponent->addEventListener(_rEvtLst);
187 TOOLS_WARN_EXCEPTION(
"dbaccess.ui",
"SbaTableQueryBrowser::OnExpandEntry: could not connect - unknown exception");
202 xDatabaseContext->getByName( _rDataSourceName ) >>= xDatasource;
204 catch(
const WrappedTargetException& e)
206 InteractiveIOException aIOException;
207 if ( ( e.TargetException >>= aIOException )
208 && ( ( aIOException.Code == IOErrorCode_NO_FILE )
209 || ( aIOException.Code == IOErrorCode_NOT_EXISTING )
213 OUString sErrorMessage(
DBA_RES( STR_FILE_DOES_NOT_EXIST ) );
228 if ( xDatasource.is() )
235 *_pErrorInfo = aSQLError;
239 showError( aSQLError, _pErrorMessageParent ? _pErrorMessageParent->
GetXWindow() :
nullptr, _rxContext );
250 if ( xDocumentDataSource.is() )
251 xRet = xDocumentDataSource->getDatabaseDocument();
256 if ( xOfficeDoc.is() )
257 xRet = xOfficeDoc->getDataSource();
265 const OUString& _sTypeName,
266 const OUString& _sCreateParams,
267 sal_Int32 _nPrecision,
269 bool _bAutoIncrement,
270 bool& _brForceToType)
273 _brForceToType =
false;
275 std::pair<OTypeInfoMap::const_iterator, OTypeInfoMap::const_iterator> aPair = _rTypeInfo.equal_range(_nType);
276 OTypeInfoMap::const_iterator aIter = aPair.first;
277 if(aIter != _rTypeInfo.end())
279 for(;aIter != aPair.second;++aIter)
283 OUString sDBTypeName = aIter->second->aTypeName; (void)sDBTypeName;
287 || (aIter->second->aTypeName.equalsIgnoreAsciiCase(_sTypeName))
291 !aIter->second->aCreateParams.getLength()
292 && _sCreateParams.isEmpty()
295 (aIter->second->nPrecision >= _nPrecision)
296 && (aIter->second->nMaximumScale >= _nScale)
297 && ( (_bAutoIncrement && aIter->second->bAutoIncrement) || !_bAutoIncrement )
304 if (aIter == aPair.second)
306 for(aIter = aPair.first; aIter != aPair.second; ++aIter)
308 sal_Int32 nPrec = aIter->second->nPrecision;
309 sal_Int32 nScale = aIter->second->nMaximumScale;
311 if ( (aIter->second->aLocalTypeName.equalsIgnoreAsciiCase(_sTypeName))
312 && (nPrec >= _nPrecision)
313 && (nScale >= _nScale)
314 && ( (_bAutoIncrement && aIter->second->bAutoIncrement) || !_bAutoIncrement )
317 SAL_WARN(
"dbaccess.ui",
"getTypeInfoFromType: assuming column type " <<
318 aIter->second->aTypeName <<
"\" (expected type name " <<
319 _sTypeName <<
" matches the type's local name).");
325 if (aIter == aPair.second)
330 for(aIter = aPair.first; aIter != aPair.second; ++aIter)
333 sal_Int32 nPrec = aIter->second->nPrecision;
334 sal_Int32 nScale = aIter->second->nMaximumScale;
335 if ( (nPrec >= _nPrecision)
336 && (nScale >= _nScale)
337 && ( (_bAutoIncrement && aIter->second->bAutoIncrement) || !_bAutoIncrement )
342 if (aIter == aPair.second)
344 if ( _bAutoIncrement )
346 for(aIter = aPair.first; aIter != aPair.second; ++aIter)
349 sal_Int32 nScale = aIter->second->nMaximumScale;
350 if ( (nScale >= _nScale)
351 && (aIter->second->bAutoIncrement == _bAutoIncrement)
355 if ( aIter == aPair.second )
368 pTypeInfo = aIter->second;
372 pTypeInfo = aPair.first->second;
373 _brForceToType =
true;
377 pTypeInfo = aIter->second;
383 for (
auto const& elem : _rTypeInfo)
385 if ( aCase( elem.second->getDBName() , _sTypeName ) )
387 pTypeInfo = elem.second;
393 OSL_ENSURE(pTypeInfo,
"getTypeInfoFromType: no type info found for this type!");
398 std::u16string_view _rsTypeNames,
400 std::vector<OTypeInfoMap::iterator>& _rTypeInfoIters)
402 if(!_rxConnection.is())
412 std::vector<sal_Int32>
aTypes;
413 std::vector<bool> aNullable;
421 sal_Int32
nCount = xResultSetMetaData->getColumnCount();
426 aNullable.push_back(
false);
427 for (sal_Int32 j = 1; j <=
nCount ; ++j)
429 aTypes.push_back(xResultSetMetaData->getColumnType(j));
430 aNullable.push_back(xResultSetMetaData->isNullable(j) != ColumnValue::NO_NULLS);
441 pInfo->nPrecision = aValue.
getInt32();
448 pInfo->aCreateParams = aValue.
getString();
451 pInfo->bNullable = aValue.
getInt32() == ColumnValue::NULLABLE;
457 pInfo->nSearchType = aValue.
getInt16();
463 pInfo->bCurrency = aValue.
getBool();
466 pInfo->bAutoIncrement = aValue.
getBool();
469 pInfo->aLocalTypeName = aValue.
getString();
472 pInfo->nMinimumScale = aValue.
getInt16();
475 pInfo->nMaximumScale = aValue.
getInt16();
480 pInfo->nNumPrecRadix = aValue.
getInt32();
483 if( pInfo->nPrecision < 0)
484 pInfo->nPrecision = 0;
485 if( pInfo->nMinimumScale < 0)
486 pInfo->nMinimumScale = 0;
487 if( pInfo->nMaximumScale < 0)
488 pInfo->nMaximumScale = 0;
489 if( pInfo->nNumPrecRadix <= 1)
490 pInfo->nNumPrecRadix = 10;
492 std::u16string_view
aName;
498 case DataType::VARCHAR:
501 case DataType::DECIMAL:
504 case DataType::NUMERIC:
507 case DataType::BIGINT:
510 case DataType::FLOAT:
513 case DataType::DOUBLE:
516 case DataType::LONGVARCHAR:
519 case DataType::LONGVARBINARY:
528 case DataType::TIMESTAMP:
532 if ( !pInfo->aCreateParams.isEmpty() )
538 case DataType::BOOLEAN:
541 case DataType::TINYINT:
544 case DataType::SMALLINT:
547 case DataType::INTEGER:
553 case DataType::BINARY:
556 case DataType::VARBINARY:
559 case DataType::SQLNULL:
562 case DataType::OBJECT:
565 case DataType::DISTINCT:
568 case DataType::STRUCT:
571 case DataType::ARRAY:
583 case DataType::OTHER:
587 if ( !
aName.empty() )
589 pInfo->aUIName =
aName;
590 pInfo->aUIName +=
" [ ";
592 pInfo->aUIName += pInfo->aTypeName;
593 if ( !
aName.empty() )
594 pInfo->aUIName +=
" ]";
596 _rTypeInfoMap.emplace(pInfo->nType,pInfo);
599 _rTypeInfoIters.reserve(_rTypeInfoMap.size());
601 OTypeInfoMap::iterator aIter = _rTypeInfoMap.begin();
602 OTypeInfoMap::const_iterator aEnd = _rTypeInfoMap.end();
603 for(;aIter != aEnd;++aIter)
604 _rTypeInfoIters.push_back(aIter);
608 ::comphelper::disposeComponent(xRs);
631 OSL_ENSURE(_xMetaData.is(),
"No MetaData!");
632 OUString sDefaultName = _sName;
636 if(_xMetaData->supportsCatalogsInTableDefinitions())
647 while(xRes.is() && xRes->next())
655 catch(
const SQLException&)
659 if(_xMetaData->supportsSchemasInTableDefinitions())
661 sSchema = _xMetaData->getUserName();
663 sCompsedName = ::dbtools::composeTableName( _xMetaData,
sCatalog,
sSchema, _sName,
false, ::dbtools::EComposeRule::InDataManipulation );
664 sDefaultName = ::dbtools::createUniqueName(_xTables,sCompsedName);
666 catch(
const SQLException&)
675 bool bRet = xDataBaseContext->hasByName(_sDataSourceName);
680 bRet = xDataBaseContext->getByName(_sDataSourceName).hasValue();
691 sal_Int32 nAlignment = css::awt::TextAlign::LEFT;
694 case SvxCellHorJustify::Standard:
695 case SvxCellHorJustify::Left: nAlignment = css::awt::TextAlign::LEFT;
break;
696 case SvxCellHorJustify::Center: nAlignment = css::awt::TextAlign::CENTER;
break;
697 case SvxCellHorJustify::Right: nAlignment = css::awt::TextAlign::RIGHT;
break;
699 SAL_WARN(
"dbaccess.ui",
"Invalid TextAlign!");
709 case css::awt::TextAlign::LEFT : eJustify = SvxCellHorJustify::Left;
break;
710 case css::awt::TextAlign::CENTER : eJustify = SvxCellHorJustify::Center;
break;
711 case css::awt::TextAlign::RIGHT : eJustify = SvxCellHorJustify::Right;
break;
713 SAL_WARN(
"dbaccess.ui",
"Invalid TextAlign!");
723 if (!(xAffectedCol.is() && xField.is()))
734 if (aAlignment.hasValue())
736 sal_Int32 nFormatKey = 0;
738 nFormatKey = ::comphelper::getINT32(xAffectedCol->getPropertyValue(
PROPERTY_FORMATKEY));
756 sal_Int32 _nDataType,
757 sal_Int32& _nFormatKey,
767 { SID_ATTR_NUMBERFORMAT_VALUE,
true },
768 { SID_ATTR_ALIGN_HOR_JUSTIFY,
true },
769 { SID_ATTR_NUMBERFORMAT_INFO,
true },
770 { SID_ATTR_NUMBERFORMAT_ONE_AREA,
true }
773 SBA_DEF_RANGEFORMAT, SBA_ATTR_ALIGN_HOR_JUSTIFY,
774 SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO,
775 SID_ATTR_NUMBERFORMAT_ONE_AREA, SID_ATTR_NUMBERFORMAT_ONE_AREA
778 std::vector<SfxPoolItem*> pDefaults
780 new SfxRangeItem(SBA_DEF_RANGEFORMAT, SBA_DEF_FMTVALUE, SBA_ATTR_ALIGN_HOR_JUSTIFY),
784 new SfxBoolItem(SID_ATTR_NUMBERFORMAT_ONE_AREA,
false)
788 pPool->SetDefaultMetric( MapUnit::MapTwip );
789 pPool->FreezeIdRanges();
791 std::optional<SfxItemSet> pFormatDescriptor(
SfxItemSet(*pPool, aAttrMap));
793 pFormatDescriptor->Put(
SvxHorJustifyItem(_eJustify, SBA_ATTR_ALIGN_HOR_JUSTIFY));
798 if ((DataType::CHAR == _nDataType) || (DataType::VARCHAR == _nDataType) || (DataType::LONGVARCHAR == _nDataType) || (DataType::CLOB == _nDataType))
801 pFormatDescriptor->Put(
SfxBoolItem(SID_ATTR_NUMBERFORMAT_ONE_AREA,
true));
807 pFormatDescriptor->Put(
SfxUInt32Item(SBA_DEF_FMTVALUE, _nFormatKey));
812 SvxNumberInfoItem aFormatter(_pFormatter, 1234.56789, SID_ATTR_NUMBERFORMAT_INFO);
813 pFormatDescriptor->Put(aFormatter);
817 SbaSbAttrDlg aDlg(_pParent, &*pFormatDescriptor, _pFormatter, _bHasFormat);
829 _eJustify = pHorJustify->GetValue();
835 _nFormatKey =
static_cast<sal_Int32
>(pFormat->
GetValue());
853 pFormatDescriptor.reset();
864 OSL_ENSURE(pFilter,
"Filter: StarOffice XML (Base) could not be found!");
869 const OUString& _sName,
883 bool bHasToInsert =
true;
884 for (
const OUString& rItem : std::as_const(aFilter))
886 if(rItem.indexOf(
'%') != -1)
888 sal_Int32 nLen = rItem.lastIndexOf(
'.');
889 if(nLen != -1 && !rItem.compareTo(_sName,nLen))
890 bHasToInsert =
false;
891 else if(rItem.getLength() == 1)
892 bHasToInsert =
false;
901 OUString aMessage(
DBA_RES(STR_TABLEDESIGN_DATASOURCE_DELETED));
908 aFilter.realloc(aFilter.getLength()+1);
909 aFilter.getArray()[aFilter.getLength()-1] = _sName;
920 OSL_ENSURE(_pWindow,
"Window can not be null!");
930 sal_Int32 nColSize = -1;
935 nColSize = aSizeMM.
Width() * 10;
938 Size aDefaultMM = _pBox->PixelToLogic(
Size( nDefaultWidth, 0 ),
MapMode( MapUnit::MapMM ) );
940 DlgSize aColumnSizeDlg(_pBox->GetFrameWeld(), nColSize,
false, aDefaultMM.
Width() * 10);
952 nValue = _pBox->LogicToPixel( aSizeMM,
MapMode( MapUnit::MapMM ) ).Width();
974 bool& _rAutoIncrementValueEnabled,
975 OUString& _rsAutoIncrementValue)
977 if ( !_xDatasource.is() )
980 OSL_ENSURE(_xDatasource->getPropertySetInfo()->hasPropertyByName(
PROPERTY_INFO),
"NO datasource supplied!");
985 const PropertyValue* pValue =std::find_if(std::cbegin(aInfo), std::cend(aInfo),
986 [](
const PropertyValue& lhs)
989 if ( pValue != std::cend(aInfo) )
990 pValue->Value >>= _rsAutoIncrementValue;
991 pValue =std::find_if(std::cbegin(aInfo), std::cend(aInfo),
992 [](
const PropertyValue& lhs)
993 {
return lhs.Name ==
"IsAutoRetrievingEnabled";} );
995 if ( pValue != std::cend(aInfo) )
996 pValue->Value >>= _rAutoIncrementValueEnabled;
1000 bool& _rAutoIncrementValueEnabled,
1001 OUString& _rsAutoIncrementValue)
1013 if ( _rsDatabaseName.isEmpty() && _xDataSource.is() )
1017 _xDataSource->getPropertyValue(
PROPERTY_NAME) >>= _rsDatabaseName;
1024 OUString
sName = _rsDatabaseName;
1026 if (
aURL.GetProtocol() != INetProtocol::NotValid )
1033 OSL_ENSURE( _rxFormatter.is(),
"setEvalDateFormatForFormatter: Formatter is NULL!");
1034 if ( !_rxFormatter.is() )
1039 auto pSupplierImpl = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(xSupplier);
1040 OSL_ENSURE(pSupplierImpl,
"No Supplier!");
1042 if ( pSupplierImpl )
1053 for (
auto const& elem : _rTypeInfo)
1060 if ( elem.second->nType == DataType::INTEGER )
1062 pTypeInfo = elem.second;
1065 else if ( !pTypeInfo && elem.second->nType == DataType::DOUBLE )
1066 pTypeInfo = elem.second;
1067 else if ( !pTypeInfo && elem.second->nType == DataType::REAL )
1068 pTypeInfo = elem.second;
1073 OSL_ENSURE(pTypeInfo,
"checkColumns: can't find a type which is usable as a key!");
1079 OTypeInfoMap::const_iterator aIter = _rTypeInfo.find(_nDataType);
1080 if(aIter != _rTypeInfo.end())
1081 return aIter->second;
1086 case DataType::TINYINT:
1090 case DataType::SMALLINT:
1094 case DataType::INTEGER:
1098 case DataType::FLOAT:
1102 case DataType::DATE:
1103 case DataType::TIME:
1104 if( DataType::DATE == _nDataType || DataType::TIME == _nDataType )
1110 case DataType::TIMESTAMP:
1111 case DataType::REAL:
1112 case DataType::BIGINT:
1116 case DataType::DOUBLE:
1120 case DataType::NUMERIC:
1123 case DataType::DECIMAL:
1129 case DataType::VARCHAR:
1133 case DataType::LONGVARCHAR:
1145 OSL_ENSURE(pTypeInfo,
"Wrong DataType supplied!");
1152 OUString aMsg =
DBA_RES(pText);
1153 aMsg = aMsg.replaceFirst(
"%1", _sName);
1164 OUString lcl_createSDBCLevelStatement(
const OUString& _rStatement,
const Reference< XConnection >& _rxConnection )
1166 OUString sSDBCLevelStatement( _rStatement );
1169 Reference< XMultiServiceFactory > xAnalyzerFactory( _rxConnection, UNO_QUERY_THROW );
1171 xAnalyzer->setQuery( _rStatement );
1172 sSDBCLevelStatement = xAnalyzer->getQueryWithSubstitution();
1174 catch(
const Exception& )
1178 return sSDBCLevelStatement;
1183 const OUString& _rCommand )
1188 xViews = xSup->getViews();
1190 OSL_ENSURE(xFact.is(),
"No XDataDescriptorFactory available!");
1199 ::dbtools::qualifiedNameComponents(_rxConnection->getMetaData(),
1204 ::dbtools::EComposeRule::InDataManipulation);
1214 xAppend->appendByDescriptor(xView);
1223 xTables = xTabSup->getTables();
1224 if ( xTables.is() && xTables->hasByName( _rName ) )
1225 xTables->getByName( _rName ) >>= xView;
1240 bool bEscapeProcessing(
false );
1242 if ( bEscapeProcessing )
1243 sCommand = lcl_createSDBCLevelStatement( sCommand, _rxConnection );
1249 return createView( _rName, _rxConnection, sCommand );
1254 const OUString& _sParentFolder,
1260 OSL_ENSURE( _xNames.is(),
"insertHierarchyElement: illegal name container!" );
1261 if ( !_xNames.is() )
1265 if ( _xNames->hasByHierarchicalName(_sParentFolder) )
1267 Reference<XChild> xChild(_xNames->getByHierarchicalName(_sParentFolder),UNO_QUERY);
1268 xNameAccess.set(xChild,UNO_QUERY);
1269 if ( !xNameAccess.is() && xChild.is() )
1270 xNameAccess.set(xChild->getParent(),UNO_QUERY);
1273 OSL_ENSURE( xNameAccess.is(),
"insertHierarchyElement: could not find the proper name container!" );
1274 if ( !xNameAccess.is() )
1282 if ( !_bMove || sNewName.isEmpty() )
1284 if ( sNewName.isEmpty() || xNameAccess->hasByName(sNewName) )
1286 OUString sLabel, sTargetName;
1287 if ( !sNewName.isEmpty() )
1288 sTargetName = sNewName;
1290 sTargetName =
DBA_RES( _bCollection ? STR_NEW_FOLDER : ((_bForm) ? RID_STR_FORM : RID_STR_REPORT));
1291 sLabel =
DBA_RES( _bCollection ? STR_FOLDER_LABEL : ((_bForm) ? STR_FRM_LABEL : STR_RPT_LABEL));
1292 sTargetName = ::dbtools::createUniqueName(xNameAccess,sTargetName);
1307 sNewName = aAskForName.
getName();
1310 else if ( xNameAccess->hasByName(sNewName) )
1312 OUString sError(
DBA_RES(STR_NAME_ALREADY_EXISTS));
1313 sError = sError.replaceFirst(
"#",sNewName);
1314 throw SQLException(sError,
nullptr,
"S1000",0,
Any());
1330 xNameContainer->insertByName( sNewName,
Any( xNew ) );
1332 catch(
const IllegalArgumentException& e )
1334 ::dbtools::throwGenericSQLException( e.Message, e.Context );
1354 if ( xSupplier.is() )
1357 xFormatter.set(util::NumberFormatter::create( _rxContext ), UNO_QUERY_THROW);
1358 xFormatter->attachNumberFormatsSupplier(xSupplier);
constexpr OUStringLiteral sServiceName
static const AllSettings & GetSettings()
void SetColumnWidth(sal_uInt16 nColumnId, sal_uLong nWidth)
OUString GetColumnTitle(sal_uInt16 nColumnId) const
sal_uLong GetDefaultColumnWidth(const OUString &_rText) const
sal_uLong GetColumnWidth(sal_uInt16 nColumnId) const
sal_uInt32 GetValue() const
static std::shared_ptr< const SfxFilter > GetFilterByName(const OUString &rName)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
virtual const SfxItemSet * GetExampleSet() const override
virtual short run() override
const SfxItemSet * GetOutputItemSet() const
constexpr tools::Long Width() const
const std::vector< sal_uInt32 > & GetDelFormats() const
TaskPaneList * GetTaskPaneList()
sal_Int32 getInt32() const
OUString getString() const
sal_Int16 getInt16() const
void fill(sal_Int32 _nPos, sal_Int32 _nType, const css::uno::Reference< css::sdbc::XRow > &_xRow)
sal_Int32 GetValue() const
class implementing the IObjectNameCheck interface, and checking given object names against a hierarch...
OUString GetDescription() const
const TOTypeInfoSP & getTypeInfo() const
sal_Int32 GetScale() const
bool IsAutoIncrement() const
OUString GetAutoIncrementValue() const
sal_Int32 GetType() const
sal_Int32 GetPrecision() const
sal_Int32 GetIsNullable() const
void add_button(const OUString &rText, int nResponse, const OUString &rHelpId={})
const OUString & getName() const
OUString get(NOTATION _eOutputNotation) const
SystemWindow * GetSystemWindow() const
virtual css::uno::Reference< css::awt::XWindow > GetXWindow()=0
#define TOOLS_WARN_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
SfxItemInfo const aItemInfos[]
constexpr OUStringLiteral HID_CONFIRM_DROP_BUTTON_ALL
Sequence< PropertyValue > aArguments
#define SAL_WARN(area, stream)
css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
const sal_uInt16 TYPE_IMAGE
const sal_uInt16 TYPE_NUMERIC
void fillTypeInfo(const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, std::u16string_view _rsTypeNames, OTypeInfoMap &_rTypeInfoMap, std::vector< OTypeInfoMap::iterator > &_rTypeInfoIters)
fills a map and a vector with localized type names
css::uno::Reference< css::beans::XPropertySet > createView(const OUString &_sName, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const css::uno::Reference< css::beans::XPropertySet > &_xSourceObject)
creates a new view from a query or table
const sal_uInt16 TYPE_REAL
void adjustBrowseBoxColumnWidth(::svt::EditBrowseBox *_pBox, sal_uInt16 _nColId)
const sal_uInt16 TYPE_OTHER
void callColumnFormatDialog(const css::uno::Reference< css::beans::XPropertySet > &_xAffectedCol, const css::uno::Reference< css::beans::XPropertySet > &_xField, SvNumberFormatter *_pFormatter, weld::Widget *_pParent)
call the format dialog and set the selected format at the column
bool checkDataSourceAvailable(const OUString &_sDataSourceName, const Reference< css::uno::XComponentContext > &_xContext)
const sal_uInt16 TYPE_TINYINT
const sal_uInt16 TYPE_DATE
css::uno::Reference< css::sdbc::XDataSource > getDataSourceByName(const OUString &_rDataSourceName, weld::Window *_pErrorMessageParent, const css::uno::Reference< css::uno::XComponentContext > &_rxContext, ::dbtools::SQLExceptionInfo *_pErrorInfo)
retrieves a data source given by name or URL, and displays an error if this fails
const sal_uInt16 TYPE_SQLNULL
TOTypeInfoSP queryPrimaryKeyType(const OTypeInfoMap &_rTypeInfo)
query for a type info which can be used to create a primary key column
::dbtools::SQLExceptionInfo createConnection(const OUString &_rsDataSourceName, const css::uno::Reference< css::container::XNameAccess > &_xDatabaseContext, const css::uno::Reference< css::uno::XComponentContext > &_rxContext, css::uno::Reference< css::lang::XEventListener > const &_rEvtLst, css::uno::Reference< css::sdbc::XConnection > &_rOUTConnection)
creates a new connection and appends the eventlistener
const sal_uInt16 TYPE_STRUCT
bool generateAsBeforeTableAlias(const css::uno::Reference< css::sdbc::XConnection > &_rxConnection)
determines whether when generating SQL statements, AS should be placed before a table alias
css::uno::Reference< css::util::XNumberFormatter > getNumberFormatter(const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
creates a number formatter
void fillAutoIncrementValue(const css::uno::Reference< css::beans::XPropertySet > &_xDatasource, bool &_rAutoIncrementValueEnabled, OUString &_rsAutoIncrementValue)
fills the bool and string value with information out of the datasource info property
bool isAppendTableAliasEnabled(const css::uno::Reference< css::sdbc::XConnection > &_xConnection)
check if the alias name of the table should be added at select statements
const sal_uInt16 TYPE_SMALLINT
const sal_uInt16 TYPE_CHAR
void notifySystemWindow(vcl::Window const *_pWindow, vcl::Window *_pToRegister, const ::comphelper::mem_fun1_t< TaskPaneList, vcl::Window * > &_rMemFunc)
notifySystemWindow adds or remove the given window _pToRegister at the Systemwindow found when search...
std::multimap< sal_Int32, TOTypeInfoSP > OTypeInfoMap
TOTypeInfoSP queryTypeInfoByType(sal_Int32 _nDataType, const OTypeInfoMap &_rTypeInfo)
query for a specific type.
void setColumnProperties(const css::uno::Reference< css::beans::XPropertySet > &_rxColumn, const OFieldDescription *_pFieldDesc)
SvxCellHorJustify mapTextJustify(sal_Int32 _nAlignment)
maps css::awt::TextAlign to SvxCellHorJustify
TOTypeInfoSP getTypeInfoFromType(const OTypeInfoMap &_rTypeInfo, sal_Int32 _nType, const OUString &_sTypeName, const OUString &_sCreateParams, sal_Int32 _nPrecision, sal_Int32 _nScale, bool _bAutoIncrement, bool &_brForceToType)
return the most suitable typeinfo for a requested type
const sal_uInt16 TYPE_TEXT
const sal_uInt16 TYPE_DECIMAL
void setEvalDateFormatForFormatter(css::uno::Reference< css::util::XNumberFormatter > const &_rxFormatter)
set the evaluation flag at the number formatter
std::shared_ptr< OTypeInfo > TOTypeInfoSP
OUString createDefaultName(const css::uno::Reference< css::sdbc::XDatabaseMetaData > &_xMetaData, const css::uno::Reference< css::container::XNameAccess > &_xTables, const OUString &_sName)
css::uno::Reference< css::uno::XInterface > getDataSourceOrModel(const css::uno::Reference< css::uno::XInterface > &_xObject)
returns either the model when data source is given as parameter, or returns a data source when a mode...
const sal_uInt16 TYPE_DATETIME
const sal_uInt16 TYPE_OBJECT
const sal_uInt16 TYPE_MEMO
sal_Int32 askForUserAction(weld::Window *pParent, TranslateId pTitle, TranslateId pText, bool bAll, std::u16string_view rName)
returns the configuration node name of user defined drivers.
bool isSQL92CheckEnabled(const css::uno::Reference< css::sdbc::XConnection > &_xConnection)
check if SQL92 name checking is enabled
const sal_uInt16 TYPE_CLOB
const sal_uInt16 TYPE_DISTINCT
const sal_uInt16 TYPE_BIT
std::shared_ptr< const SfxFilter > getStandardDatabaseFilter()
returns the standard database filter
const sal_uInt16 TYPE_TIME
const sal_uInt16 TYPE_BINARY
sal_Int32 mapTextAlign(const SvxCellHorJustify &_eAlignment)
maps SvxCellHorJustify to css::awt::TextAlign
bool checkDataSourceAvailable(const OUString &_sDataSourceName, const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
checks if the given name exists in the database context
const sal_uInt16 TYPE_INTEGER
const sal_uInt16 TYPE_VARBINARY
const sal_uInt16 TYPE_ARRAY
bool appendToFilter(const css::uno::Reference< css::sdbc::XConnection > &xConnection, const OUString &rName, const css::uno::Reference< css::uno::XComponentContext > &rxContext, weld::Window *pParent)
append a name to tablefilter of a datasource
OUString getStrippedDatabaseName(const css::uno::Reference< css::beans::XPropertySet > &_xDataSource, OUString &_rsDatabaseName)
returns the stripped database name.
bool insertHierarchyElement(weld::Window *pParent, const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const css::uno::Reference< css::container::XHierarchicalNameContainer > &_xNames, const OUString &_sParentFolder, bool _bForm, bool _bCollection=true, const css::uno::Reference< css::ucb::XContent > &_xContent=nullptr, bool _bMove=false)
opens a save dialog to store a form or report folder in the current hierarchy.
const sal_uInt16 TYPE_FLOAT
const sal_uInt16 TYPE_BLOB
const sal_uInt16 TYPE_BOOL
const sal_uInt16 TYPE_REF
const sal_uInt16 TYPE_DOUBLE
const sal_uInt16 TYPE_BIGINT
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
static constexpr auto Items
constexpr OUStringLiteral INFO_AS_BEFORE_CORRELATION_NAME
constexpr OUStringLiteral PROPERTY_COMMAND(u"Command")
constexpr OUStringLiteral PROPERTY_TABLEFILTER(u"TableFilter")
constexpr OUStringLiteral PROPERTY_ISAUTOINCREMENT(u"IsAutoIncrement")
constexpr OUStringLiteral PROPERTY_ISCURRENCY(u"IsCurrency")
constexpr OUStringLiteral PROPERTY_USER(u"User")
constexpr OUStringLiteral PROPERTY_INFO(u"Info")
constexpr OUStringLiteral PROPERTY_PRECISION(u"Precision")
constexpr OUStringLiteral PROPERTY_TYPENAME(u"TypeName")
constexpr OUStringLiteral SERVICE_NAME_FORM_COLLECTION
constexpr OUStringLiteral PROPERTY_ENABLESQL92CHECK(u"EnableSQL92Check")
constexpr OUStringLiteral INFO_APPEND_TABLE_ALIAS
constexpr OUStringLiteral PROPERTY_ISNULLABLE(u"IsNullable")
constexpr OUStringLiteral PROPERTY_SCHEMANAME(u"SchemaName")
constexpr OUStringLiteral PROPERTY_DESCRIPTION(u"Description")
constexpr OUStringLiteral PROPERTY_FORMATKEY(u"FormatKey")
constexpr OUStringLiteral PROPERTY_SCALE(u"Scale")
constexpr OUStringLiteral SERVICE_SDB_DOCUMENTDEFINITION
constexpr OUStringLiteral SERVICE_NAME_SINGLESELECTQUERYCOMPOSER
constexpr OUStringLiteral PROPERTY_PASSWORD(u"Password")
constexpr OUStringLiteral PROPERTY_ESCAPE_PROCESSING(u"EscapeProcessing")
constexpr OUStringLiteral SERVICE_NAME_REPORT_COLLECTION
constexpr OUStringLiteral PROPERTY_CATALOGNAME(u"CatalogName")
constexpr OUStringLiteral PROPERTY_TYPE(u"Type")
constexpr OUStringLiteral PROPERTY_NAME(u"Name")
constexpr OUStringLiteral PROPERTY_ALIGN(u"Align")
constexpr OUStringLiteral PROPERTY_EMBEDDEDOBJECT(u"EmbeddedObject")
constexpr OUStringLiteral PROPERTY_AUTOINCREMENTCREATION(u"AutoIncrementCreation")
constexpr OUStringLiteral PROPERTY_ISPASSWORDREQUIRED(u"IsPasswordRequired")
Reference< XComponentContext > _xContext