30#include <rtl/ustring.hxx>
35#include <com/sun/star/uno/Any.hxx>
36#include <com/sun/star/uno/Sequence.hxx>
57 SvDDELinkEditDialog(
weld::Window* pParent, SvBaseLink
const*);
58 OUString GetCmd()
const;
63SvDDELinkEditDialog::SvDDELinkEditDialog(
weld::Window* pParent, SvBaseLink
const *
pLink)
64 : GenericDialogController(pParent,
"sfx/ui/linkeditdialog.ui",
"LinkEditDialog")
70 OUString sServer, sTopic, sItem;
77 m_xEdDdeApp->connect_changed(
LINK(
this, SvDDELinkEditDialog, EditHdl_Impl));
79 m_xEdDdeItem->connect_changed(
LINK(
this, SvDDELinkEditDialog, EditHdl_Impl));
81 m_xOKButton->set_sensitive(!sServer.isEmpty() && !sTopic.isEmpty() && !sItem.isEmpty());
84OUString SvDDELinkEditDialog::GetCmd()
const
98SvDDEObject::SvDDEObject()
113 const OUString & rMimeType,
160 rData <<= OUString();
185 OUString sServer, sTopic;
188 if( sServer.isEmpty() || sTopic.isEmpty() ||
sItem.isEmpty() )
195 bool bSysTopic =
false;
196 if (!sTopic.equalsIgnoreAsciiCase(
"SYSTEM"))
234 SvDDELinkEditDialog aDlg(pParent, pBaseLink);
237 OUString sCommand = aDlg.GetCmd();
238 rEndEditHdl.
Call( sCommand );
247 case SotClipboardFormatId::RTF:
248 nFmt = SotClipboardFormatId::STRING;
251 case SotClipboardFormatId::HTML_SIMPLE:
252 case SotClipboardFormatId::HTML:
253 nFmt = SotClipboardFormatId::RTF;
256 case SotClipboardFormatId::GDIMETAFILE:
257 nFmt = SotClipboardFormatId::BITMAP;
260 case SotClipboardFormatId::SVXB:
261 nFmt = SotClipboardFormatId::GDIMETAFILE;
267 if( nFmt != SotClipboardFormatId::NONE )
269 return SotClipboardFormatId::NONE != nFmt;
290 case SotClipboardFormatId::GDIMETAFILE:
293 case SotClipboardFormatId::BITMAP:
298 const char*
p =
static_cast<char const *
>(
pData->getData());
299 tools::Long nLen = SotClipboardFormatId::STRING == nFmt ? (
p ? strlen(
p ) : 0) :
pData->getSize();
312 pData->GetFormat() ), aVal );
313 bWaitForData =
false;
321 if( !bValid && ( pRequest ||
pLink ))
325 pReq = pRequest.get();
326 else if( pRequest && pRequest->IsBusy() )
331 if( ImplHasOtherFormat( *pReq ) )
335 else if( pReq == pRequest.get() )
337 bWaitForData =
false;
343 bWaitForData =
false;
tools::Long GetError() const
tools::Long GetError() const
void SetFormat(SotClipboardFormatId nFmt)
void SetDataHdl(const Link< const DdeData *, void > &rLink)
SotClipboardFormatId GetFormat() const
static OUString GetFormatMimeType(SotClipboardFormatId nFormat)
static SotClipboardFormatId GetFormatIdFromMimeType(std::u16string_view rMimeType)
static bool GetDisplayNames(const SvBaseLink *, OUString *pType, OUString *pFile=nullptr, OUString *pLink=nullptr, OUString *pFilter=nullptr)
SfxLinkUpdateMode GetUpdateMode() const
SotClipboardFormatId GetContentType() const
LinkManager * GetLinkManager()
virtual bool Connect(SvBaseLink *) override
virtual ~SvDDEObject() override
std::unique_ptr< DdeRequest > pRequest
std::unique_ptr< DdeLink > pLink
virtual bool IsDataComplete() const override
static bool ImplHasOtherFormat(DdeTransaction &)
std::unique_ptr< DdeConnection > pConnection
virtual bool GetData(css::uno::Any &rData, const OUString &aMimeType, bool bSynchron=false) override
virtual void Edit(weld::Window *pParent, sfx2::SvBaseLink *pBaseLink, const Link< const OUString &, void > &rEndEditHdl) override
virtual bool IsPending() const override
void AddDataAdvise(SvBaseLink *, const OUString &rMimeType, sal_uInt16 nAdviceMode)
void AddConnectAdvise(SvBaseLink *)
void SetUpdateTimeout(sal_uInt64 nTimeMs)
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
std::unique_ptr< weld::Entry > m_xEdDdeApp
std::unique_ptr< weld::Entry > m_xEdDdeItem
std::unique_ptr< weld::Button > m_xOKButton
std::unique_ptr< weld::Entry > m_xEdDdeTopic
#define LINK(Instance, Class, Member)
#define ADVISEMODE_ONLYONCE
Sequence< sal_Int8 > aSeq
std::unique_ptr< sal_Int32[]> pData
IMPL_LINK_NOARG(SvDDELinkEditDialog, EditHdl_Impl, weld::Entry &, void)
IMPL_LINK(SvDDEObject, ImplGetDDEData, const DdeData *, pData, void)
void MakeLnkName(OUString &rName, const OUString *pType, std::u16string_view rFile, std::u16string_view rLink, const OUString *pFilter)