20#include <svx/svxids.hrc>
21#include <com/sun/star/presentation/ClickAction.hpp>
22#include <com/sun/star/embed/NeedsRunningStateException.hpp>
23#include <com/sun/star/embed/VerbDescriptor.hpp>
24#include <com/sun/star/embed/EmbedStates.hpp>
25#include <com/sun/star/embed/XEmbeddedObject.hpp>
27#include <com/sun/star/embed/VerbAttributes.hpp>
28#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
32#include <sfx2/strings.hrc>
46#include <osl/diagnose.h>
64#define DOCUMENT_TOKEN '#'
79 static_cast<SdTPAction*
>( xNewPage.get() )->SetView( pView );
80 static_cast<SdTPAction*
>( xNewPage.get() )->Construct();
89 :
SfxTabPage(pPage, pController,
"modules/simpress/ui/interactionpage.ui",
"InteractionPage", &rInAttrs)
93 , m_xLbAction(m_xBuilder->weld_combo_box(
"listbox"))
94 , m_xFtTree(m_xBuilder->weld_label(
"fttree"))
95 , m_xLbTree(new
SdPageObjsTLV(m_xBuilder->weld_tree_view(
"tree")))
96 , m_xLbTreeDocument(new
SdPageObjsTLV(m_xBuilder->weld_tree_view(
"treedoc")))
97 , m_xLbOLEAction(m_xBuilder->weld_tree_view(
"oleaction"))
98 ,
m_xFrame(m_xBuilder->weld_frame(
"frame"))
99 , m_xEdtSound(m_xBuilder->weld_entry(
"sound"))
100 , m_xEdtBookmark(m_xBuilder->weld_entry(
"bookmark"))
101 , m_xEdtDocument(m_xBuilder->weld_entry(
"document"))
102 , m_xEdtProgram(m_xBuilder->weld_entry(
"program"))
103 , m_xEdtMacro(m_xBuilder->weld_entry(
"macro"))
104 , m_xBtnSearch(m_xBuilder->weld_button(
"browse"))
105 , m_xBtnSeek(m_xBuilder->weld_button(
"find"))
150 OSL_FAIL(
"sd::SdTPAction::SetView(), no docshell or viewshell?");
159 bool bOLEAction =
false;
172 if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::OLE2)
176 else if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::Graphic)
191 const uno::Reference < embed::XEmbeddedObject >& xObj = pOleObj->
GetObjRef();
195 uno::Sequence < embed::VerbDescriptor > aVerbs;
198 aVerbs = xObj->getSupportedVerbs();
200 catch ( embed::NeedsRunningStateException& )
202 xObj->changeState( embed::EmbedStates::RUNNING );
203 aVerbs = xObj->getSupportedVerbs();
206 for(
const embed::VerbDescriptor& aVerb : std::as_const(aVerbs) )
208 if( aVerb.VerbAttributes & embed::VerbAttributes::MS_VERBATTR_ONCONTAINERMENU )
210 OUString aTmp( aVerb.VerbName );
243 bool bModified =
false;
244 presentation::ClickAction eCA = presentation::ClickAction_NONE;
258 if( aFileName.isEmpty() )
264 OUString aBaseURL =
mpDoc->
GetDocSh()->GetMedium()->GetBaseURL();
265 if( eCA == presentation::ClickAction_SOUND ||
266 eCA == presentation::ClickAction_DOCUMENT ||
267 eCA == presentation::ClickAction_PROGRAM )
277 OSL_FAIL(
"sd::SdTPAction::FillItemSet(), I need a medium!");
286 presentation::ClickAction eCA = presentation::ClickAction_NONE;
290 if( rAttrs->
GetItemState( ATTR_ACTION ) != SfxItemState::DONTCARE )
292 eCA =
static_cast<presentation::ClickAction
>( rAttrs->
293 Get( ATTR_ACTION ).GetValue());
300 if( rAttrs->
GetItemState( ATTR_ACTION_FILENAME ) != SfxItemState::DONTCARE )
302 aFileName = rAttrs->
Get( ATTR_ACTION_FILENAME ).GetValue();
308 case presentation::ClickAction_BOOKMARK:
315 case presentation::ClickAction_DOCUMENT:
340 return DeactivateRC::LeavePage;
345 return std::make_unique<SdTPAction>( pPage, pController, rAttrs );
361 bool bSound = ( eCA == presentation::ClickAction_SOUND );
362 bool bPage = ( eCA == presentation::ClickAction_BOOKMARK );
363 bool bDocument = ( eCA == presentation::ClickAction_DOCUMENT ||
364 eCA == presentation::ClickAction_PROGRAM );
365 bool bMacro = ( eCA == presentation::ClickAction_MACRO );
380 if( !aFile.isEmpty() )
394 if ( !aScriptURL.isEmpty() )
402 ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
432 presentation::ClickAction eCA = GetActualClickAction();
437 case presentation::ClickAction_NONE:
438 case presentation::ClickAction_INVISIBLE:
439 case presentation::ClickAction_PREVPAGE:
440 case presentation::ClickAction_NEXTPAGE:
441 case presentation::ClickAction_FIRSTPAGE:
442 case presentation::ClickAction_LASTPAGE:
443 case presentation::ClickAction_STOPPRESENTATION:
447 m_xLbTreeDocument->hide();
448 m_xLbOLEAction->hide();
452 m_xEdtBookmark->hide();
453 m_xEdtDocument->hide();
454 m_xEdtProgram->hide();
456 m_xBtnSearch->hide();
460 case presentation::ClickAction_SOUND:
461 case presentation::ClickAction_PROGRAM:
462 case presentation::ClickAction_MACRO:
465 m_xLbTreeDocument->hide();
466 m_xLbOLEAction->hide();
468 m_xEdtDocument->hide();
470 if( eCA == presentation::ClickAction_MACRO )
473 m_xEdtProgram->hide();
475 else if( eCA == presentation::ClickAction_PROGRAM )
480 else if( eCA == presentation::ClickAction_SOUND )
482 m_xEdtProgram->hide();
489 case presentation::ClickAction_DOCUMENT:
491 m_xLbOLEAction->hide();
494 m_xEdtProgram->hide();
496 m_xEdtBookmark->hide();
500 case presentation::ClickAction_BOOKMARK:
501 m_xLbTreeDocument->hide();
502 m_xLbOLEAction->hide();
504 m_xEdtDocument->hide();
505 m_xEdtProgram->hide();
507 m_xBtnSearch->hide();
510 case presentation::ClickAction_VERB:
512 m_xEdtDocument->hide();
513 m_xEdtProgram->hide();
514 m_xEdtBookmark->hide();
516 m_xBtnSearch->hide();
526 case presentation::ClickAction_NONE:
527 case presentation::ClickAction_INVISIBLE:
528 case presentation::ClickAction_PREVPAGE:
529 case presentation::ClickAction_NEXTPAGE:
530 case presentation::ClickAction_FIRSTPAGE:
531 case presentation::ClickAction_LASTPAGE:
532 case presentation::ClickAction_STOPPRESENTATION:
536 case presentation::ClickAction_SOUND:
539 m_xEdtSound->set_sensitive(
true);
540 m_xBtnSearch->show();
541 m_xBtnSearch->set_sensitive(
true);
545 case presentation::ClickAction_PROGRAM:
546 case presentation::ClickAction_MACRO:
548 m_xBtnSearch->show();
549 m_xBtnSearch->set_sensitive(
true);
550 if( eCA == presentation::ClickAction_MACRO )
557 m_xEdtProgram->show();
562 case presentation::ClickAction_DOCUMENT:
564 m_xLbTreeDocument->show();
567 m_xEdtDocument->show();
568 m_xBtnSearch->show();
569 m_xBtnSearch->set_sensitive(
true);
571 m_xFtTree->set_label(
SdResId( STR_EFFECTDLG_JUMP ) );
574 CheckFileHdl( *m_xEdtDocument );
577 case presentation::ClickAction_VERB:
579 m_xLbOLEAction->show();
581 m_xFtTree->set_label(
SdResId( STR_EFFECTDLG_ACTION ) );
584 case presentation::ClickAction_BOOKMARK:
591 m_xEdtBookmark->show();
594 m_xFtTree->set_label(
SdResId( STR_EFFECTDLG_JUMP ) );
604 m_xEdtBookmark->set_text( m_xLbTree->get_selected_text() );
609 OUString aFile( GetEditText() );
611 if( aFile == aLastFile )
614 bool bHideTreeDocument =
true;
620 StreamMode::READ | StreamMode::NOCREATE );
628 uno::Reference < embed::XStorage > xStorage = aMedium.
GetStorage();
641 m_xLbTreeDocument->clear();
642 m_xLbTreeDocument->Fill(pBookmarkDoc,
true, aFile);
643 mpDoc->CloseBookmarkDoc();
644 m_xLbTreeDocument->show();
645 bHideTreeDocument =
false;
656 if (bHideTreeDocument)
657 m_xLbTreeDocument->hide();
662 presentation::ClickAction eCA = presentation::ClickAction_NONE;
671 std::vector<css::presentation::ClickAction>::const_iterator pIter =
681 OUString aText(rStr);
686 case presentation::ClickAction_DOCUMENT:
691 case presentation::ClickAction_SOUND:
692 case presentation::ClickAction_PROGRAM:
697 OUString aTmpStr(
aURL.getFSysPath(FSysStyle::Detect));
699 if( !aTmpStr.isEmpty() )
710 case presentation::ClickAction_SOUND:
713 case presentation::ClickAction_VERB:
715 ::std::vector< tools::Long >::iterator aFound( ::std::find(
aVerbVector.begin(),
aVerbVector.end(), rStr.toInt32() ) );
720 case presentation::ClickAction_PROGRAM:
723 case presentation::ClickAction_MACRO:
726 case presentation::ClickAction_DOCUMENT:
729 case presentation::ClickAction_BOOKMARK:
744 case presentation::ClickAction_SOUND:
747 case presentation::ClickAction_VERB:
754 case presentation::ClickAction_DOCUMENT:
758 case presentation::ClickAction_PROGRAM:
762 case presentation::ClickAction_MACRO:
767 case presentation::ClickAction_BOOKMARK:
780 if( !
aStr.isEmpty() &&
aURL.GetProtocol() == INetProtocol::NotValid )
786 if( bFullDocDestination &&
787 eCA == presentation::ClickAction_DOCUMENT &&
792 if( !aTmpStr.isEmpty() )
css::uno::Reference< css::lang::XComponent > m_xFrame
static OUString EraseAllMnemonicChars(const OUString &rStr)
SdActionDlg(weld::Window *pParent, const SfxItemSet *pAttr, ::sd::View const *pView)
Constructor of the Tab dialog: appends the pages to the dialog.
SdDrawDocument * OpenBookmarkDoc(const OUString &rBookmarkFile)
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
The class SdOpenSoundFileDialog wraps the FileDialogHelper, displaying the FILEOPEN_PLAY dialog templ...
void SetPath(const OUString &rPath)
void SetView(const ::sd::View *pSdView)
virtual ~SdTPAction() override
std::unique_ptr< SdPageObjsTLV > m_xLbTree
virtual void ActivatePage(const SfxItemSet &rSet) override
css::presentation::ClickAction GetActualClickAction()
std::unique_ptr< weld::Entry > m_xEdtMacro
std::unique_ptr< weld::Button > m_xBtnSearch
std::unique_ptr< weld::Entry > m_xEdtProgram
::std::vector< tools::Long > aVerbVector
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &)
std::unique_ptr< weld::ComboBox > m_xLbAction
std::unique_ptr< SdPageObjsTLV > m_xLbTreeDocument
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::Entry > m_xEdtBookmark
SdTPAction(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
Action-TabPage.
std::unique_ptr< weld::Button > m_xBtnSeek
virtual bool FillItemSet(SfxItemSet *) override
virtual void Reset(const SfxItemSet *) override
std::unique_ptr< weld::Entry > m_xEdtSound
void SetActualClickAction(css::presentation::ClickAction eCA)
OUString GetEditText(bool bURL=false)
void SetEditText(OUString const &rStr)
std::vector< css::presentation::ClickAction > maCurrentActions
static SD_DLLPUBLIC TranslateId GetClickActionSdResId(css::presentation::ClickAction eCA)
std::unique_ptr< weld::TreeView > m_xLbOLEAction
std::unique_ptr< weld::Entry > m_xEdtDocument
const ::sd::View * mpView
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
const SdrMarkList & GetMarkedObjectList() const
bool AreObjectsMarked() const
SdrObject * GetMarkedSdrObj() const
virtual SdrInventor GetObjInventor() const
virtual SdrObjKind GetObjIdentifier() const
css::uno::Reference< css::embed::XEmbeddedObject > const & GetObjRef() const
static OUString ChooseScript(weld::Window *pParent)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void InvalidateItem(sal_uInt16 nWhich)
css::uno::Reference< css::embed::XStorage > GetStorage(bool bCreateTempFile=true)
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
void SetTabPage(std::unique_ptr< SfxTabPage > xTabPage)
weld::Container * get_content_area()
void SetExchangeSupport()
weld::Window * GetFrameWeld() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
sd::ViewShell * GetViewShell()
SdDrawDocument * GetDoc()
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
DrawDocShell * GetDocSh() const
void AddFilter(const OUString &rFilterName, const OUString &rExtension)
void SetContext(Context _eNewContext)
#define DBG_ASSERT(sCon, aError)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
#define LINK(Instance, Class, Member)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
sal_Int32 getTokenCount(std::string_view rIn, char cTok)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
Reference< XNameAccess > m_xContainer
OUString SdResId(TranslateId aId)
SFX2_DLLPUBLIC OUString SfxResId(TranslateId aId)
constexpr OUStringLiteral pStarDrawXMLContent(u"content.xml")
IMPL_LINK_NOARG(SdTPAction, ClickSearchHdl, weld::Button &, void)