LibreOffice Module dbaccess (master) 1
|
#include <TableController.hxx>
Public Member Functions | |
OTableController (const css::uno::Reference< css::uno::XComponentContext > &_rM) | |
const css::uno::Reference< css::beans::XPropertySet > & | getTable () const |
bool | isAddAllowed () const |
bool | isDropAllowed () const |
bool | isAlterAllowed () const |
bool | isAutoIncrementPrimaryKey () const |
bool | isAutoIncrementValueEnabled () const |
const OUString & | getAutoIncrementValue () const |
virtual void | impl_onModifyChanged () override |
std::vector< std::shared_ptr< OTableRow > > & | getRows () |
sal_Int32 | getFirstEmptyRowPosition () |
returns the position of the first empty row More... | |
const OTypeInfoMap & | getTypeInfo () const |
TOTypeInfoSP const & | getTypeInfo (sal_Int32 _nPos) const |
TOTypeInfoSP | getTypeInfoByType (sal_Int32 _nDataType) const |
const TOTypeInfoSP & | getTypeInfoFallBack () const |
virtual bool | Construct (vcl::Window *pParent) override |
virtual void SAL_CALL | disposing (const css::lang::EventObject &Source) override |
virtual sal_Bool SAL_CALL | suspend (sal_Bool bSuspend) override |
virtual void SAL_CALL | disposing () override |
virtual OUString SAL_CALL | getImplementationName () override |
virtual css::uno::Sequence< OUString > SAL_CALL | getSupportedServiceNames () override |
Public Member Functions inherited from dbaui::OSingleDocumentController | |
SfxUndoManager & | GetUndoManager () const |
need for undo's and redo's More... | |
void | ClearUndoManager () |
complete clears the Undo/Redo stacks More... | |
void | addUndoActionAndInvalidate (std::unique_ptr< SfxUndoAction > pAction) |
addUndoActionAndInvalidate adds an undo action to the undoManager, additionally invalidates the UNDO and REDO slot More... | |
virtual FeatureState | GetState (sal_uInt16 nId) const override |
virtual void | Execute (sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override |
virtual css::uno::Reference< css::document::XUndoManager > SAL_CALL | getUndoManager () override |
Private Member Functions | |
void | reSyncRows () |
void | assignTable () |
void | loadData () |
bool | checkColumns (bool _bNew) |
void | appendColumns (css::uno::Reference< css::sdbcx::XColumnsSupplier > const &_rxColSup, bool _bNew, bool _bKeyColumns=false) |
void | appendPrimaryKey (css::uno::Reference< css::sdbcx::XKeysSupplier > const &_rxSup, bool _bNew) |
void | alterColumns () |
void | dropPrimaryKey () |
css::uno::Reference< css::container::XNameAccess > | getKeyColumns () const |
OUString | createUniqueName (const OUString &_rName) |
void | reload () |
virtual void | describeSupportedFeatures () override |
virtual FeatureState | GetState (sal_uInt16 nId) const override |
virtual void | Execute (sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override |
virtual void | losingConnection () override |
virtual OUString | getPrivateTitle () const override |
void | doEditIndexes () |
bool | doSaveDoc (bool _bSaveAs) |
virtual | ~OTableController () override |
void | startTableListening () |
void | stopTableListening () |
virtual void | impl_initialize () override |
Private Attributes | |
std::vector< std::shared_ptr< OTableRow > > | m_vRowList |
OTypeInfoMap | m_aTypeInfo |
std::vector< OTypeInfoMap::iterator > | m_aTypeInfoIndex |
css::uno::Reference< css::beans::XPropertySet > | m_xTable |
OUString | m_sName |
OUString | m_sAutoIncrementValue |
OUString | m_sTypeNames |
TOTypeInfoSP | m_pTypeInfo |
bool | m_bAllowAutoIncrementValue |
bool | m_bNew: 1 |
Additional Inherited Members | |
Protected Member Functions inherited from dbaui::OSingleDocumentController | |
OSingleDocumentController (const css::uno::Reference< css::uno::XComponentContext > &_rxORB) | |
virtual | ~OSingleDocumentController () override |
virtual void SAL_CALL | disposing () override |
Definition at line 32 of file TableController.hxx.
|
overrideprivatevirtual |
Definition at line 123 of file TableController.cxx.
References m_aTypeInfo, and m_aTypeInfoIndex.
OTableController::OTableController | ( | const css::uno::Reference< css::uno::XComponentContext > & | _rM | ) |
Definition at line 112 of file TableController.cxx.
References m_pTypeInfo, m_sTypeNames, and dbaui::TYPE_OTHER.
|
private |
Definition at line 933 of file TableController.cxx.
References aColNames, Any, appendPrimaryKey(), bAutoIncrement, dbaui::OFieldDescription::copyColumnSettingsTo(), DBA_RES, dbaui::DefaultYes, dropPrimaryKey(), Exception, dbaui::OFieldDescription::GetControlDefault(), dbaui::OFieldDescription::GetDescription(), dbaui::OFieldDescription::GetFormatKey(), dbaui::OFieldDescription::GetHelpText(), dbaui::OFieldDescription::GetHorJustify(), dbaui::OFieldDescription::GetIsNullable(), getKeyColumns(), dbaui::OFieldDescription::GetName(), dbaui::OFieldDescription::GetPrecision(), dbaui::OFieldDescription::GetScale(), dbaui::OFieldDescription::GetType(), dbaui::OFieldDescription::GetTypeName(), dbaui::OFieldDescription::IsAutoIncrement(), dbaui::OFieldDescription::IsPrimaryKey(), m_vRowList, m_xTable, dbaui::mapTextAlign(), nNullable, nPos, nType, PROPERTY_ALIGN(), PROPERTY_CONTROLDEFAULT(), PROPERTY_DESCRIPTION(), PROPERTY_FORMATKEY(), PROPERTY_HELPTEXT(), PROPERTY_ISAUTOINCREMENT(), PROPERTY_ISNULLABLE(), PROPERTY_NAME(), PROPERTY_PRECISION(), PROPERTY_SCALE(), PROPERTY_TYPE(), PROPERTY_TYPENAME(), reload(), reSyncRows(), RET_YES, weld::DialogController::run(), dbaui::setColumnProperties(), sName, xColumn, and dbaui::YesNo.
Referenced by doSaveDoc().
|
private |
Definition at line 636 of file TableController.cxx.
References Any, dbaui::OFieldDescription::copyColumnSettingsTo(), DBG_UNHANDLED_EXCEPTION, Exception, dbaui::OFieldDescription::GetName(), dbaui::OFieldDescription::IsPrimaryKey(), m_vRowList, PROPERTY_NAME(), dbaui::setColumnProperties(), showError(), and xColumn.
Referenced by appendPrimaryKey(), and doSaveDoc().
|
private |
Definition at line 695 of file TableController.cxx.
References Any, appendColumns(), i, nCount, and PROPERTY_TYPE().
Referenced by alterColumns(), and doSaveDoc().
|
private |
Definition at line 1308 of file TableController.cxx.
References getConnection(), isAddAllowed(), isAlterAllowed(), isDropAllowed(), m_bNew, m_sName, m_vRowList, m_xTable, and startTableListening().
Referenced by doSaveDoc(), impl_initialize(), and losingConnection().
|
private |
css::sdbc::SQLException | |
css::uno::RuntimeException |
Definition at line 864 of file TableController.cxx.
References createUniqueName(), DBA_RES, dbaui::DefaultYes, getConnection(), dbaui::OFieldDescription::GetName(), getView(), vcl::Window::Invalidate(), dbaui::OFieldDescription::IsPrimaryKey(), m_aTypeInfo, m_vRowList, dbaui::queryPrimaryKeyType(), RET_CANCEL, RET_YES, weld::DialogController::run(), dbaui::OFieldDescription::SetAutoIncrement(), dbaui::OFieldDescription::SetIsNullable(), dbaui::OFieldDescription::SetName(), dbaui::OFieldDescription::SetPrimaryKey(), dbtools::DatabaseMetaData::supportsPrimaryKeys(), and dbaui::YesNoCancel.
Referenced by doSaveDoc().
|
overridevirtual |
Definition at line 501 of file TableController.cxx.
|
private |
Definition at line 1410 of file TableController.cxx.
References dbaui::OFieldDescription::GetName(), i, m_vRowList, and sName.
Referenced by checkColumns().
|
overrideprivatevirtual |
Definition at line 574 of file TableController.cxx.
References ID_BROWSER_EDITDOC, ID_BROWSER_REDO, ID_BROWSER_SAVEASDOC, ID_BROWSER_SAVEDOC, and ID_BROWSER_UNDO.
|
overridevirtual |
Reimplemented from dbaui::OSingleDocumentController.
|
overridevirtual |
|
private |
Definition at line 402 of file TableController.cxx.
References aFieldNames, Application::CreateMessageDialog(), DBA_RES, DBG_UNHANDLED_EXCEPTION, doSaveDoc(), Exception, getConnection(), m_bNew, m_xTable, RET_OK, RET_YES, and weld::DialogController::run().
Referenced by Execute().
|
private |
Definition at line 242 of file TableController.cxx.
References aEvent, alterColumns(), aName, Any, appendColumns(), appendPrimaryKey(), dbaui::appendToFilter(), assignTable(), checkColumns(), DBA_RES, DBG_UNHANDLED_EXCEPTION, dbaui::Error, Exception, dbaui::OSaveAsDlg::getCatalog(), getConnection(), dbaui::OSaveAsDlg::getName(), dbaui::OSaveAsDlg::getSchema(), dbtools::SQLExceptionInfo::isValid(), m_bNew, m_sName, m_xTable, NONE, dbaui::Ok, dbtools::SQLExceptionInfo::prepend(), PROPERTY_CATALOGNAME(), PROPERTY_NAME(), PROPERTY_SCHEMANAME(), reSyncRows(), RET_OK, weld::DialogController::run(), sCatalog, showError(), sSchema, stopTableListening(), and dbaccess::TABLE.
Referenced by doEditIndexes(), and Execute().
|
private |
Definition at line 1261 of file TableController.cxx.
References DBG_UNHANDLED_EXCEPTION, Exception, i, m_xTable, PROPERTY_TYPE(), and showError().
Referenced by alterColumns().
|
overrideprivatevirtual |
Reimplemented from dbaui::OSingleDocumentController.
Definition at line 206 of file TableController.cxx.
References copy(), doEditIndexes(), doSaveDoc(), dbaui::OSingleDocumentController::Execute(), getView(), ID_BROWSER_COPY, ID_BROWSER_CUT, ID_BROWSER_EDITDOC, ID_BROWSER_PASTE, ID_BROWSER_SAVEASDOC, and ID_BROWSER_SAVEDOC.
Referenced by suspend().
|
inline |
Definition at line 91 of file TableController.hxx.
References m_sAutoIncrementValue.
Referenced by dbaui::OTableFieldControl::getAutoIncrementValue().
sal_Int32 OTableController::getFirstEmptyRowPosition | ( | ) |
returns the position of the first empty row
Definition at line 1466 of file TableController.cxx.
References isAddAllowed(), and m_vRowList.
|
overridevirtual |
Definition at line 102 of file TableController.cxx.
|
private |
Definition at line 859 of file TableController.cxx.
References getPrimaryKeyColumns_throw(), and m_xTable.
Referenced by alterColumns(), and loadData().
|
overrideprivatevirtual |
Definition at line 1431 of file TableController.cxx.
References aName, DBA_RES, DBG_UNHANDLED_EXCEPTION, Exception, getConnection(), o3tl::getToken(), m_sName, and m_xTable.
|
inline |
Definition at line 95 of file TableController.hxx.
References m_vRowList.
Referenced by dbaui::OTableEditorCtrl::OTableEditorCtrl().
|
overrideprivatevirtual |
Reimplemented from dbaui::OSingleDocumentController.
Definition at line 152 of file TableController.cxx.
References dbaui::FeatureState::bChecked, dbaui::FeatureState::bEnabled, dbaui::OSingleDocumentController::GetState(), getView(), ID_BROWSER_CLOSE, ID_BROWSER_COPY, ID_BROWSER_CUT, ID_BROWSER_EDITDOC, ID_BROWSER_PASTE, ID_BROWSER_SAVEASDOC, ID_BROWSER_SAVEDOC, dbaui::OTableRow::isValid(), m_bNew, m_vRowList, and m_xTable.
|
overridevirtual |
Definition at line 107 of file TableController.cxx.
|
inline |
Definition at line 83 of file TableController.hxx.
References m_xTable.
Referenced by dbaui::OTableEditorCtrl::GetController(), dbaui::OTableEditorCtrl::IsCopyAllowed(), dbaui::OTableEditorCtrl::IsPrimaryKeyAllowed(), and dbaui::OTableFieldControl::IsReadOnly().
|
inline |
Definition at line 100 of file TableController.hxx.
References m_aTypeInfo.
Referenced by dbaui::OTableEditorCtrl::CellModified(), dbaui::OTableFieldControl::getTypeInfo(), dbaui::OTableEditorCtrl::InitController(), and dbaui::OTableEditorCtrl::SwitchType().
|
inline |
Definition at line 102 of file TableController.hxx.
References _nPos, and m_aTypeInfoIndex.
TOTypeInfoSP OTableController::getTypeInfoByType | ( | sal_Int32 | _nDataType | ) | const |
Definition at line 631 of file TableController.cxx.
References m_aTypeInfo, and dbaui::queryTypeInfoByType().
|
inline |
Definition at line 105 of file TableController.hxx.
References m_pTypeInfo.
|
overrideprivatevirtual |
Definition at line 458 of file TableController.cxx.
References assignTable(), dbaui::OSingleDocumentController::ClearUndoManager(), DBA_RES, DBG_UNHANDLED_EXCEPTION, Exception, dbaui::fillAutoIncrementValue(), dbaui::fillTypeInfo(), comphelper::NamedValueCollection::get_ensureType(), getConnection(), dbaccess::getDataSource(), getView(), loadData(), m_aTypeInfo, m_aTypeInfoIndex, m_bAllowAutoIncrementValue, m_sAutoIncrementValue, m_sName, m_sTypeNames, PROPERTY_CURRENTTABLE(), and weld::DialogController::run().
|
overridevirtual |
Definition at line 589 of file TableController.cxx.
bool OTableController::isAddAllowed | ( | ) | const |
Definition at line 1347 of file TableController.cxx.
References DBG_UNHANDLED_EXCEPTION, Exception, and m_xTable.
Referenced by assignTable(), getFirstEmptyRowPosition(), dbaui::OTableEditorCtrl::IsCutAllowed(), dbaui::OTableEditorCtrl::IsInsertNewAllowed(), dbaui::OTableEditorCtrl::IsPasteAllowed(), loadData(), and reSyncRows().
bool OTableController::isAlterAllowed | ( | ) | const |
Definition at line 1384 of file TableController.cxx.
References m_xTable.
Referenced by assignTable(), dbaui::OTableEditorCtrl::IsCutAllowed(), loadData(), and reSyncRows().
bool OTableController::isAutoIncrementPrimaryKey | ( | ) | const |
Definition at line 1490 of file TableController.cxx.
Referenced by dbaui::OTableEditorCtrl::AdjustFieldDescription(), and dbaui::OTableEditorCtrl::SaveData().
|
inline |
Definition at line 90 of file TableController.hxx.
References m_bAllowAutoIncrementValue.
Referenced by dbaui::OTableFieldControl::isAutoIncrementValueEnabled().
bool OTableController::isDropAllowed | ( | ) | const |
Definition at line 1368 of file TableController.cxx.
References m_xTable.
Referenced by assignTable(), dbaui::OTableEditorCtrl::IsCutAllowed(), and dbaui::OTableEditorCtrl::IsDeleteAllowed().
|
private |
Definition at line 737 of file TableController.cxx.
References aColNames, Any, getKeyColumns(), dbaui::getTypeInfoFromType(), i, isAddAllowed(), isAlterAllowed(), m_aTypeInfo, m_pTypeInfo, m_vRowList, m_xTable, dbaui::mapTextJustify(), NEWCOLS, nNullable, nType, PROPERTY_ALIGN(), PROPERTY_CONTROLDEFAULT(), PROPERTY_DESCRIPTION(), PROPERTY_FORMATKEY(), PROPERTY_HELPTEXT(), PROPERTY_ISAUTOINCREMENT(), PROPERTY_ISCURRENCY(), PROPERTY_ISNULLABLE(), PROPERTY_NAME(), PROPERTY_PRECISION(), PROPERTY_SCALE(), PROPERTY_TYPE(), PROPERTY_TYPENAME(), dbaui::OFieldDescription::SetAutoIncrement(), dbaui::OFieldDescription::SetControlDefault(), dbaui::OFieldDescription::SetCurrency(), dbaui::OFieldDescription::SetDescription(), dbaui::OFieldDescription::SetFormatKey(), dbaui::OFieldDescription::SetHelpText(), dbaui::OFieldDescription::SetHorJustify(), dbaui::OFieldDescription::SetIsNullable(), dbaui::OFieldDescription::SetName(), dbaui::OFieldDescription::SetPrecision(), dbaui::OFieldDescription::SetScale(), sName, and xColumn.
Referenced by impl_initialize(), and reload().
|
overrideprivatevirtual |
Definition at line 608 of file TableController.cxx.
References assignTable(), m_bNew, m_xTable, and stopTableListening().
|
private |
Definition at line 1457 of file TableController.cxx.
References dbaui::OSingleDocumentController::ClearUndoManager(), getView(), and loadData().
Referenced by alterColumns().
|
private |
Definition at line 1390 of file TableController.cxx.
References dbaui::OSingleDocumentController::ClearUndoManager(), getView(), isAddAllowed(), isAlterAllowed(), and m_vRowList.
Referenced by alterColumns(), and doSaveDoc().
|
private |
Definition at line 130 of file TableController.cxx.
References m_xTable.
Referenced by assignTable().
|
private |
Definition at line 137 of file TableController.cxx.
References m_xTable.
Referenced by doSaveDoc(), and losingConnection().
Definition at line 508 of file TableController.cxx.
References Application::CreateBuilder(), Exception, Execute(), getConnection(), getMutex(), getView(), GrabFocus, ID_BROWSER_SAVEDOC, dbaui::OTableRow::isValid(), m_bNew, m_sName, m_vRowList, RET_CANCEL, and RET_YES.
|
private |
Definition at line 36 of file TableController.hxx.
Referenced by checkColumns(), getTypeInfo(), getTypeInfoByType(), impl_initialize(), loadData(), and ~OTableController().
|
private |
Definition at line 37 of file TableController.hxx.
Referenced by getTypeInfo(), impl_initialize(), and ~OTableController().
|
private |
Definition at line 46 of file TableController.hxx.
Referenced by impl_initialize(), and isAutoIncrementValueEnabled().
|
private |
Definition at line 47 of file TableController.hxx.
Referenced by assignTable(), doEditIndexes(), doSaveDoc(), GetState(), losingConnection(), and suspend().
|
private |
Definition at line 44 of file TableController.hxx.
Referenced by getTypeInfoFallBack(), loadData(), and OTableController().
|
private |
Definition at line 42 of file TableController.hxx.
Referenced by getAutoIncrementValue(), and impl_initialize().
|
private |
Definition at line 41 of file TableController.hxx.
Referenced by assignTable(), doSaveDoc(), getPrivateTitle(), impl_initialize(), and suspend().
|
private |
Definition at line 43 of file TableController.hxx.
Referenced by impl_initialize(), and OTableController().
|
private |
Definition at line 35 of file TableController.hxx.
Referenced by alterColumns(), appendColumns(), assignTable(), checkColumns(), createUniqueName(), getFirstEmptyRowPosition(), getRows(), GetState(), loadData(), reSyncRows(), and suspend().
|
private |
Definition at line 39 of file TableController.hxx.
Referenced by alterColumns(), assignTable(), doEditIndexes(), doSaveDoc(), dropPrimaryKey(), getKeyColumns(), getPrivateTitle(), GetState(), getTable(), isAddAllowed(), isAlterAllowed(), isDropAllowed(), loadData(), losingConnection(), startTableListening(), and stopTableListening().