LibreOffice Module sw (master)
1
sw
source
uibase
shells
mediash.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 <
cmdid.h
>
21
#include <
sfx2/request.hxx
>
22
#include <
svx/svdview.hxx
>
23
#include <view.hxx>
24
#include <
wrtsh.hxx
>
25
#include <mediash.hxx>
26
27
#include <
sfx2/objface.hxx
>
28
#include <
vcl/EnumContext.hxx
>
29
#include <
svx/MediaShellHelpers.hxx
>
30
31
#define ShellClass_SwMediaShell
32
#include <swslots.hxx>
33
34
using namespace
svx
;
35
36
SFX_IMPL_INTERFACE
(
SwMediaShell
,
SwBaseShell
)
37
38
void
SwMediaShell
::InitInterface_Impl()
39
{
40
GetStaticInterface()->RegisterPopupMenu(
"media"
);
41
42
GetStaticInterface()->RegisterObjectBar(
SFX_OBJECTBAR_OBJECT
, SfxVisibilityFlags::Invisible,
43
ToolbarId::Media_Toolbox);
44
}
45
46
void
SwMediaShell::ExecMedia
(
SfxRequest
const
& rReq)
47
{
48
SwWrtShell
* pSh = &
GetShell
();
49
SdrView
* pSdrView = pSh->
GetDrawView
();
50
51
if
(!pSdrView)
52
return
;
53
54
const
bool
bChanged = pSdrView->
GetModel
().
IsChanged
();
55
pSdrView->
GetModel
().
SetChanged
(
false
);
56
57
switch
(rReq.
GetSlot
())
58
{
59
case
SID_DELETE:
60
if
(pSh->
IsObjSelected
())
61
{
62
pSh->
SetModified
();
63
pSh->
DelSelectedObj
();
64
65
if
(pSh->
IsSelFrameMode
())
66
pSh->
LeaveSelFrameMode
();
67
68
GetView
().AttrChangedNotify(
nullptr
);
69
}
70
break
;
71
72
case
SID_AVMEDIA_TOOLBOX:
73
if
(pSh->
IsObjSelected
())
74
MediaShellHelpers::Execute(pSdrView, rReq);
75
break
;
76
77
default
:
78
break
;
79
}
80
81
if
(pSdrView->
GetModel
().
IsChanged
())
82
GetShell
().
SetModified
();
83
else
if
(bChanged)
84
pSdrView->
GetModel
().
SetChanged
();
85
}
86
87
void
SwMediaShell::GetMediaState
(
SfxItemSet
& rSet)
88
{
89
MediaShellHelpers::GetState(
GetShell
().GetDrawView(),
rSet
);
90
}
91
92
SwMediaShell::SwMediaShell
(
SwView
& _rView)
93
:
SwBaseShell
(_rView)
94
{
95
SetName
(
"Media Playback"
);
96
SfxShell::SetContextName
(
vcl::EnumContext::GetContextName
(
vcl::EnumContext::Context::Media
));
97
}
98
99
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
EnumContext.hxx
MediaShellHelpers.hxx
SdrModel::SetChanged
virtual void SetChanged(bool bFlg=true)
SdrModel::IsChanged
bool IsChanged() const
SdrPaintView::GetModel
SdrModel & GetModel() const
SdrView
SfxItemSet
SfxRequest
SfxRequest::GetSlot
sal_uInt16 GetSlot() const
SfxShell::SetContextName
void SetContextName(const OUString &rsContextName)
SfxShell::SetName
void SetName(const OUString &rName)
SwBaseShell
Definition:
basesh.hxx:40
SwBaseShell::GetShell
SwWrtShell & GetShell()
Definition:
basesh.cxx:3001
SwBaseShell::GetView
SwView & GetView()
Definition:
basesh.hxx:59
SwEditShell::SetModified
void SetModified()
Definition:
edws.cxx:70
SwFEShell::DelSelectedObj
void DelSelectedObj()
Definition:
feshview.cxx:2257
SwFEShell::IsObjSelected
size_t IsObjSelected() const
Definition:
feshview.cxx:1125
SwMediaShell
Definition:
mediash.hxx:29
SwMediaShell::GetMediaState
void GetMediaState(SfxItemSet &)
Definition:
mediash.cxx:87
SwMediaShell::SwMediaShell
SwMediaShell(SwView &rView)
Definition:
mediash.cxx:92
SwMediaShell::ExecMedia
void ExecMedia(SfxRequest const &)
Definition:
mediash.cxx:46
SwViewShell::GetDrawView
SdrView * GetDrawView()
Definition:
vnew.cxx:386
SwView
Definition:
view.hxx:146
SwWrtShell
Used by the UI to modify the document model.
Definition:
wrtsh.hxx:97
SwWrtShell::IsSelFrameMode
bool IsSelFrameMode() const
Definition:
wrtsh.hxx:177
SwWrtShell::LeaveSelFrameMode
void LeaveSelFrameMode()
Definition:
select.cxx:729
vcl::EnumContext::Context::Media
@ Media
vcl::EnumContext::GetContextName
static const OUString & GetContextName(const Context eContext)
cmdid.h
svx
objface.hxx
SFX_OBJECTBAR_OBJECT
#define SFX_OBJECTBAR_OBJECT
request.hxx
rSet
static SfxItemSet & rSet
SFX_IMPL_INTERFACE
#define SFX_IMPL_INTERFACE(Class, SuperClass)
svdview.hxx
wrtsh.hxx
Generated on Sun Jul 30 2023 04:30:00 for LibreOffice Module sw (master) by
1.9.3