26#include <com/sun/star/frame/XStorable.hpp>
27#include <com/sun/star/sdb/CommandType.hpp>
28#include <com/sun/star/sdbc/SQLException.hpp>
35#include <osl/diagnose.h>
58 using namespace ::
svx;
65 std::unique_ptr<weld::TreeIter> xRootEntry(
m_pTreeView->GetRootLevelParent(&rApplyTo));
81 catch(
const SQLException& )
96 std::unique_ptr<weld::TreeIter> xHitEntry(rTreeView.
make_iterator());
120 std::unique_ptr<weld::TreeIter> xHitEntry(rTreeView.
make_iterator());
127 OSL_FAIL(
"SbaTableQueryBrowser::executeDrop: what the hell did queryDrop do?");
149 if ( ODataAccessObjectTransferable::canExtractObjectDescriptor(aDroppedData.
GetDataFlavorExVector()) )
162 && xDestConnection.
is()
191 std::unique_ptr<weld::TreeIter> xSelected = rTreeView.
make_iterator();
192 if (rTreeView.
get_selected(xSelected.get()) && isEntryCopyAllowed(*xSelected))
193 copyEntry(*xSelected);
207 xTransfer->CopyToClipboard(
getView());
212 m_nAsyncDrop =
nullptr;
214 ::osl::MutexGuard aGuard(
getMutex() );
216 if ( m_aAsyncDrop.nType ==
E_TABLE )
219 if ( ensureConnection(m_aAsyncDrop.xDroppedAt.get(), xDestConnection) && xDestConnection.
is())
221 std::unique_ptr<weld::TreeIter> xDataSourceEntry =
222 m_pTreeView->GetRootLevelParent(m_aAsyncDrop.xDroppedAt.get());
223 m_aTableCopyHelper.asyncCopyTagTable(m_aAsyncDrop, getDataSourceAccessor(*xDataSourceEntry), xDestConnection);
227 m_aAsyncDrop.aDroppedData.
clear();
238 rTreeView.
set_id(rEntryLoop, OUString());
241 xContainer->removeContainerListener(
this);
243 if (
pData->xConnection.is())
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
const DataFlavorExVector & GetDataFlavorExVector() const
void Update(const OUString &_rDatasource, const sal_Int32 _nCommandType, const OUString &_rCommand, const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const css::uno::Reference< css::util::XNumberFormatter > &_rxFormatter, const css::uno::Reference< css::uno::XComponentContext > &_rxORB)
bool copyTagTable(DropDescriptor const &_rDesc, bool _bCheck, const SharedConnection &_xConnection)
copies a table which was constructed by tags like HTML or RTF
void clearTreeModel()
clears the tree list box
virtual sal_Int8 executeDrop(const ExecuteDropEvent &_rEvt) override
execute a drop request
bool ensureConnection(const weld::TreeIter *pDSEntry, void *pDSData, SharedConnection &rConnection)
static bool isObject(EntryType _eType)
VclPtr< InterimDBTreeListBox > m_pTreeView
bool isEntryCopyAllowed(const weld::TreeIter &rEntry) const
void impl_releaseConnection(SharedConnection &_rxConnection)
flushes and disposes the given connection, and de-registers as listener
OTableCopyHelper::DropDescriptor m_aAsyncDrop
std::unique_ptr< weld::TreeIter > m_xCurrentlyDisplayed
bool implCopyObject(ODataClipboard &rExchange, const weld::TreeIter &rApplyTo, sal_Int32 nCommandType)
OUString getDataSourceAccessor(const weld::TreeIter &rDataSourceEntry) const
retrieves the data source URL/name for the given entry representing a data source
virtual sal_Int8 queryDrop(const AcceptDropEvent &_rEvt, const DataFlavorExVector &_rFlavors) override
check whether or not a drop request should be accepted
virtual bool requestDrag(const weld::TreeIter &rEntry) override
handler for StartDrag requests
OUString GetEntryText(const weld::TreeIter &rEntry) const
ImplSVEvent * m_nAsyncDrop
static bool isContainer(EntryType _eType)
void copyEntry(const weld::TreeIter &rEntry)
EntryType getEntryType(const weld::TreeIter &rEntry) const
OTableCopyHelper m_aTableCopyHelper
const css::uno::Reference< css::util::XNumberFormatter > & getNumberFormatter() const
virtual std::unique_ptr< TreeIter > make_iterator(const TreeIter *pOrig=nullptr) const=0
virtual bool get_selected(TreeIter *pIter) const=0
virtual bool get_dest_row_at_pos(const Point &rPos, weld::TreeIter *pResult, bool bDnDMode, bool bAutoScroll=true)=0
virtual void set_id(int row, const OUString &rId)=0
virtual void all_foreach(const std::function< bool(TreeIter &)> &func)=0
virtual OUString get_id(int pos) const=0
#define DBG_UNHANDLED_EXCEPTION(...)
::std::vector< DataFlavorEx > DataFlavorExVector
#define LINK(Instance, Class, Member)
std::unique_ptr< sal_Int32[]> pData
IMPL_LINK_NOARG(OApplicationController, OnClipboardChanged, TransferableDataHelper *, void)
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...
::osl::Mutex & getMutex()
SwView * getView(const uno::Reference< frame::XModel > &xModel)
const css::datatransfer::dnd::DropTargetDropEvent maDropEvent
svx::ODataAccessDescriptor aDroppedData
std::unique_ptr< weld::TreeIter > xDroppedAt
Functor object for class DataFlavorExVector::value_type returntype is bool.