21#include <com/sun/star/sdbc/XRow.hpp>
23#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
30#include <osl/mutex.hxx>
31#include <osl/diagnose.h>
63 virtual css::uno::Reference< css::sdbc::XConnection >
68 virtual void addTableWindow(
const OUString& _rQualifiedTableName,
const OUString& _rAliasName )
override;
149 OJoinController_BASE::reconnect( _bUI );
156 OJoinController_BASE::impl_onModifyChanged();
157 InvalidateFeature( SID_RELATION_ADD_RELATION );
163 const TTableWindowData::value_type&
pData = pTabWin->
GetData();
164 OSL_ENSURE(
pData !=
nullptr,
"SaveTabWinPosSize : TabWin has no data !");
170 pData->SetPosition(aPos);
231 setEditable(!isEditable());
249 InvalidateFeature(_nId);
273 "OJoinController::SaveTabWinsPosSize : inconsistent state : should have as many TabWinDatas as TabWins !");
275 for (
auto const& tabWin : *pTabWinList)
286 OJoinController_BASE::describeSupportedFeatures();
287 implDescribeSupportedFeature(
".uno:Redo",
ID_BROWSER_REDO, CommandGroup::EDIT );
288 implDescribeSupportedFeature(
".uno:Save",
ID_BROWSER_SAVEDOC, CommandGroup::DOCUMENT );
289 implDescribeSupportedFeature(
".uno:Undo",
ID_BROWSER_UNDO, CommandGroup::EDIT );
291 implDescribeSupportedFeature(
".uno:EditDoc",
ID_BROWSER_EDITDOC, CommandGroup::EDIT );
292 implDescribeSupportedFeature(
".uno:GetUndoStrings", SID_GETUNDOSTRINGS );
293 implDescribeSupportedFeature(
".uno:GetRedoStrings", SID_GETREDOSTRINGS );
298 if ( getBroadcastHelper().bInDispose || getBroadcastHelper().bDisposed )
302 ::osl::MutexGuard aGuard(
getMutex() );
310 OSingleDocumentController::suspend(_bSuspend);
322 aWindowData = i_rViewSettings.getOrDefault(
"Tables", aWindowData );
324 const PropertyValue* pTablesIter = aWindowData.getConstArray();
325 const PropertyValue* pTablesEnd = pTablesIter + aWindowData.getLength();
326 for ( ; pTablesIter != pTablesEnd; ++pTablesIter )
339 sal_Int32 nX = -1, nY = -1, nHeight = -1, nWidth = -1;
342 bool bShowAll =
false;
345 sTableName = i_rTableWindowSettings.getOrDefault(
"TableName", sTableName );
346 sWindowName = i_rTableWindowSettings.getOrDefault(
"WindowName", sWindowName );
347 nY = i_rTableWindowSettings.getOrDefault(
"WindowTop", nY );
348 nX = i_rTableWindowSettings.getOrDefault(
"WindowLeft", nX );
349 nWidth = i_rTableWindowSettings.getOrDefault(
"WindowWidth", nWidth );
350 nHeight = i_rTableWindowSettings.getOrDefault(
"WindowHeight", nHeight );
351 bShowAll = i_rTableWindowSettings.getOrDefault(
"ShowAll", bShowAll );
357 pData->SetSize(
Size( nWidth, nHeight ) );
358 pData->ShowAll(bShowAll);
378 aWindowData.
put(
"ComposedName", elem->GetComposedName() );
379 aWindowData.
put(
"TableName", elem->GetTableName() );
380 aWindowData.
put(
"WindowName", elem->GetWinName() );
381 aWindowData.
put(
"WindowTop",
static_cast<sal_Int32
>(elem->GetPosition().Y()) );
382 aWindowData.
put(
"WindowLeft",
static_cast<sal_Int32
>(elem->GetPosition().X()) );
383 aWindowData.
put(
"WindowWidth",
static_cast<sal_Int32
>(elem->GetSize().Width()) );
384 aWindowData.
put(
"WindowHeight",
static_cast<sal_Int32
>(elem->GetSize().Height()) );
385 aWindowData.
put(
"ShowAll", elem->IsShowAll() );
387 const OUString sTableName(
"Table" + OUString::number(
i++ ) );
399 OSL_FAIL(
"We should never ever reach this point!");
401 return TTableWindowData::value_type();
OptionalString sComposedName
#define ID_BROWSER_EDITDOC
#define ID_BROWSER_ADDTABLE
#define ID_BROWSER_SAVEDOC
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
bool put(const OUString &_rValueName, const VALUE_TYPE &_rValue)
css::uno::Sequence< css::beans::PropertyValue > getPropertyValues() const
virtual void addTableWindow(const OUString &_rQualifiedTableName, const OUString &_rAliasName) override
virtual bool allowAddition() const override
AddTableDialogContext(OJoinController &_rController)
OJoinTableView * getTableView() const
virtual bool allowQueries() const override
virtual void onWindowClosing() override
virtual ~AddTableDialogContext()
virtual bool allowViews() const override
OJoinController & m_rController
virtual css::uno::Reference< css::sdbc::XConnection > getConnection() const override
static OUString getDialogTitleForContext(IAddTableDialogContext const &_rContext)
std::unique_ptr< AddTableDialogContext > m_pDialogContext
void removeConnectionData(const TTableConnectionData::value_type &_pData)
erase the data in the data vector
void loadTableWindows(const ::comphelper::NamedValueCollection &i_rViewSettings)
loads the information for the windows.
virtual void Execute(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
std::shared_ptr< OAddTableDlg > m_xAddTableDialog
TTableWindowData::value_type createTableWindowData(const OUString &_sComposedName, const OUString &_sTableName, const OUString &_sWindowName)
virtual ~OJoinController() override
Point m_aMinimumTableViewSize
void loadTableWindow(const ::comphelper::NamedValueCollection &i_rTableWindowSettings)
loads the information for one window.
OJoinController(const css::uno::Reference< css::uno::XComponentContext > &_rM)
virtual bool allowQueries() const =0
determines whether or not it's allowed for queries to participate in the game
virtual short saveModified()=0
void saveTableWindows(::comphelper::NamedValueCollection &o_rViewSettings) const
saves the TableWindows structure in a sequence of property values
virtual void reconnect(bool _bUI) override
void SaveTabWinsPosSize(OJoinTableView::OTableWindowMap *pTabWinList, tools::Long nOffsetX, tools::Long nOffsetY)
virtual FeatureState GetState(sal_uInt16 nId) const override
virtual void impl_onModifyChanged() override
static void SaveTabWinPosSize(OTableWindow const *pTabWin, tools::Long nOffsetX, tools::Long nOffsetY)
virtual void describeSupportedFeatures() override
virtual void SAL_CALL disposing() override
AddTableDialogContext & impl_getDialogContext() const
TTableConnectionData m_vTableConnectionData
virtual OJoinDesignView * getJoinView()
provides access to the OJoinDesignView belonging to the controller, which might or might not be the d...
virtual bool allowViews() const =0
determines whether or not it's allowed for database views to participate in the game
virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) override
TTableWindowData m_vTableData
OScrollWindowHelper * getScrollHelper() const
OJoinTableView * getTableView() const
virtual void setReadOnly(bool _bReadOnly)
TTableWindowData::value_type createTableWindowData(const OUString &_rComposedName, const OUString &_sTableName, const OUString &_rWinName)
std::map< OUString, VclPtr< OTableWindow > > OTableWindowMap
virtual bool IsAddAllowed()
virtual void AddTabWin(const OUString &_rComposedName, const OUString &rWinName, bool bNewTable=false)
virtual void SAL_CALL disposing() override
virtual void Execute(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
virtual FeatureState GetState(sal_uInt16 nId) const override
const TTableWindowData::value_type & GetData() const
virtual Point GetPosPixel() const
virtual Size GetSizePixel() const
static bool runAsync(const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &)
std::unique_ptr< sal_Int32[]> pData
::osl::Mutex & getMutex()
SwView * getView(const uno::Reference< frame::XModel > &xModel)
describes the state of a feature
std::optional< bool > bChecked
std::optional< OUString > sTitle