LibreOffice Module sd (master) 1
MediaObjectBar.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <MediaObjectBar.hxx>
21#include <avmedia/mediaitem.hxx>
22#include <sfx2/sfxsids.hrc>
23#include <sfx2/objface.hxx>
25
26#include <strings.hrc>
27#include <DrawDocShell.hxx>
28#include <ViewShell.hxx>
29#include <sdresid.hxx>
30#include <drawdoc.hxx>
31
32using namespace sd;
33using namespace svx;
34
35#define ShellClass_MediaObjectBar
36#include <sdslots.hxx>
37
38namespace sd
39{
41
42void MediaObjectBar::InitInterface_Impl() {}
43
45 : SfxShell(pSdViewShell->GetViewShell())
46 , mpView(pSdView)
47{
48 DrawDocShell* pDocShell = pSdViewShell->GetDocSh();
49
50 SetPool(&pDocShell->GetPool());
51 SetUndoManager(pDocShell->GetUndoManager());
53 SetName(SdResId(RID_DRAW_MEDIA_TOOLBOX));
54}
55
57
58void MediaObjectBar::GetState(SfxItemSet& rSet) { MediaShellHelpers::GetState(mpView, rSet); }
59
61{
62 const ::avmedia::MediaItem* pMediaItem = MediaShellHelpers::Execute(mpView, rReq);
63 if (!pMediaItem)
64 return;
65
66 //if only changing state then don't set modified flag (e.g. playing a video)
67 if (!(pMediaItem->getMaskSet() & AVMediaSetMask::STATE))
68 {
69 //fdo #32598: after changing playback opts, set document's modified flag
70 SdDrawDocument& rDoc = mpView->GetDoc();
71 rDoc.SetChanged();
72 }
73}
74
75} // end of namespace sd
76
77/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SAL_DLLPRIVATE void SetChanged(bool bFlag=true) override
Definition: drawdoc.cxx:658
void SetUndoManager(SfxUndoManager *pNewUndoMgr)
SfxItemPool & GetPool() const
void SetRepeatTarget(SfxRepeatTarget *pTarget)
void SetPool(SfxItemPool *pNewPool)
void SetName(const OUString &rName)
virtual SfxUndoManager * GetUndoManager() override
Definition: docshell.cxx:363
MediaObjectBar(const ViewShell *pSdViewShell, ::sd::View *pSdView)
virtual ~MediaObjectBar() override
void Execute(SfxRequest const &rReq)
void GetState(SfxItemSet &rSet)
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
SD_DLLPUBLIC DrawDocShell * GetDocSh() const
Definition: viewshel.cxx:1407
SdDrawDocument & GetDoc() const
Definition: View.hxx:293
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
static SfxItemSet & rSet
#define SFX_IMPL_INTERFACE(Class, SuperClass)
UnoViewSharedPtr mpView