27#include <sfx2/sfxsids.hrc>
31#include <com/sun/star/awt/XWindow2.hpp>
32#include <com/sun/star/beans/XPropertySet.hpp>
33#include <com/sun/star/frame/Desktop.hpp>
34#include <com/sun/star/frame/XComponentLoader.hpp>
35#include <com/sun/star/frame/Frame.hpp>
36#include <com/sun/star/frame/XLayoutManager.hpp>
52using ::com::sun::star::frame::XComponentLoader;
66 virtual void Resize()
override;
68 virtual void dispose()
override;
87 Window::DataChanged( rDCEvt );
89 if (rDCEvt.
GetType() == DataChangedEventType::PRINTER)
103 return Window::EventNotify( rNEvt );
105 if ( rNEvt.
GetType() == NotifyEventType::GETFOCUS )
109 SAL_INFO(
"sfx",
"SfxFrame: GotFocus");
118 else if( rNEvt.
GetType() == NotifyEventType::KEYINPUT )
124 return Window::EventNotify( rNEvt );
138 if (
nType == NotifyEventType::KEYINPUT ||
nType == NotifyEventType::KEYUP )
145 else if (
nType == NotifyEventType::MOUSEBUTTONUP ||
nType == NotifyEventType::MOUSEBUTTONDOWN )
156 if (
nType == NotifyEventType::MOUSEBUTTONDOWN )
166 return Window::PreNotify( rNEvt );
185 if ( nStateChange == StateChangedType::InitShow )
200 Window::StateChanged( nStateChange );
211 Reference < XFrame >
xFrame;
214 Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() );
215 xFrame.set( xDesktop->findFrame(
"_blank", 0 ), UNO_SET_THROW );
230 Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
231 Reference < XDesktop2 > xDesktop = Desktop::create( xContext );
232 Reference < XFrame2 >
xFrame = Frame::create( xContext );
235 xFrame->initialize( xWin );
236 xDesktop->getFrames()->append(
xFrame );
238 if ( xWin->isActive() )
242 Sequence< PropertyValue > aLoadArgs;
247 aArgs.
put(
"Hidden",
true );
249 aArgs.
put(
"ViewId",
static_cast<sal_uInt16
>(nViewId) );
254 Reference< XComponentLoader > xLoader(
xFrame, UNO_QUERY_THROW );
255 xLoader->loadComponentFromURL(
271 OSL_ENSURE( pFrame,
"SfxFrame::Create: load succeeded, but no SfxFrame was created during this!" );
286 ENSURE_OR_THROW( pWindow,
"frame without container window not allowed" );
295 ,m_pWindow( nullptr )
301 m_pImpl->pExternalContainerWindow = &i_rContainerWindow;
317 Reference< css::beans::XPropertySet > xPropSet(
GetFrameInterface(), UNO_QUERY );
318 Reference< css::frame::XLayoutManager > xLayoutManager;
322 Any aValue = xPropSet->getPropertyValue(
"LayoutManager");
323 aValue >>= xLayoutManager;
326 if ( xLayoutManager.is() )
327 xLayoutManager->setVisible( !bSet );
343 if (
m_pImpl->pExternalContainerWindow->IsSystemWindow() )
359 Reference< css::beans::XPropertySet > xPropSet(
GetFrameInterface(), UNO_QUERY );
360 Reference< css::frame::XLayoutManager > xLayoutManager;
364 Any aValue = xPropSet->getPropertyValue(
"LayoutManager");
365 aValue >>= xLayoutManager;
368 if ( xLayoutManager.is() )
370 OUString aMenuBarURL(
"private:resource/menubar/menubar" );
373 xLayoutManager->showElement( aMenuBarURL );
375 xLayoutManager->hideElement( aMenuBarURL );
386 const ::comphelper::NamedValueCollection aDocumentArgs( i_rDoc.
GetModel()->getArgs2( {
"Hidden",
"PluginMode" } ) );
389 OSL_ENSURE( !
m_pImpl->bHidden,
"when does this happen?" );
390 m_pImpl->bHidden = aDocumentArgs.getOrDefault(
"Hidden",
m_pImpl->bHidden );
396 sal_Int16 nPluginMode = aDocumentArgs.getOrDefault(
"PluginMode", sal_Int16( 0 ) );
397 if ( nPluginMode && ( nPluginMode != 2 ) )
void TransformItems(sal_uInt16 nSlotId, const SfxItemSet &rSet, uno::Sequence< beans::PropertyValue > &rArgs, const SfxSlot *pSlot)
DataChangedEventType GetType() const
const Point & GetPosPixel() const
const KeyEvent * GetKeyEvent() const
vcl::Window * GetWindow() const
const MouseEvent * GetMouseEvent() const
NotifyEventType GetType() const
SAL_DLLPRIVATE SfxWorkWindow * GetWorkWindow_Impl() const
void Invalidate(sal_uInt16 nId)
SAL_DLLPRIVATE void Update_Impl(bool bForce=false)
DECL_LINK(ModalHierarchyHdl, bool, void)
virtual void GetFocus() override
virtual void Resize() override
virtual bool EventNotify(NotifyEvent &rEvt) override
SfxFrameWindow_Impl(SfxFrame *pF, vcl::Window &i_rContainerWindow)
virtual bool PreNotify(NotifyEvent &rNEvt) override
virtual void dispose() override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual void StateChanged(StateChangedType nStateChange) override
static SfxFrame * Create(const css::uno::Reference< css::frame::XFrame > &xFrame)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
SAL_DLLPRIVATE void PrepareForDoc_Impl(const SfxObjectShell &i_rDoc)
SystemWindow * GetSystemWindow() const
VclPtr< vcl::Window > m_pWindow
SAL_DLLPRIVATE SystemWindow * GetTopWindow_Impl() const
bool IsClosing_Impl() const
SAL_DLLPRIVATE void SetMenuBarOn_Impl(bool bOn)
SAL_DLLPRIVATE void SetFrameInterface_Impl(const css::uno::Reference< css::frame::XFrame > &rFrame)
void UpdateDescriptor(SfxObjectShell const *pDoc)
SAL_DLLPRIVATE SfxFrame(vcl::Window &i_rContainerWindow)
void SetPresentationMode(bool bSet)
SAL_DLLPRIVATE bool IsMenuBarOn_Impl() const
static css::uno::Reference< css::frame::XFrame > CreateBlankFrame()
SAL_DLLPRIVATE SfxWorkWindow * GetWorkWindow_Impl() const
SAL_DLLPRIVATE bool IsMarkedHidden_Impl() const
SAL_DLLPRIVATE void Construct_Impl()
static SAL_DLLPRIVATE void InsertTopFrame_Impl(SfxFrame *pFrame)
std::unique_ptr< SfxFrame_Impl > m_pImpl
static SfxFrame * CreateHidden(SfxObjectShell const &rDoc, vcl::Window &rWindow, SfxInterfaceId nViewId)
static SAL_WARN_UNUSED_RESULT SfxFrame * GetNext(SfxFrame &)
static SAL_WARN_UNUSED_RESULT SfxFrame * GetFirst()
SAL_WARN_UNUSED_RESULT SfxViewFrame * GetCurrentViewFrame() const
SAL_DLLPRIVATE void LockResize_Impl(bool bLock)
SfxItemSet & GetItemSet() const
SfxMedium * GetMedium() const
css::uno::Reference< css::frame::XModel3 > GetModel() const
SfxViewShell * GetViewShell() const
Returns the SfxViewShell in which they are located in the subshells.
vcl::Window & GetWindow() const
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
virtual SfxObjectShell * GetObjectShell() override
SAL_DLLPRIVATE void MakeActive_Impl(bool bActivate)
One SfxViewShell more or less represents one edit window for a document, there can be multiple ones f...
SAL_DLLPRIVATE bool HasMouseClickListeners_Impl() const
SAL_DLLPRIVATE bool HasKeyListeners_Impl() const
SAL_DLLPRIVATE bool HandleNotifyEvent_Impl(NotifyEvent const &rEvent)
virtual bool KeyInput(const KeyEvent &rKeyEvent)
vcl::Window * GetWindow() const
SAL_DLLPRIVATE SfxInPlaceClient * GetUIActiveIPClient_Impl() const
void EndAutoShow_Impl(Point aPos)
void SetDockingAllowed(bool bSet)
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
static VclPtr< reference_type > Create(Arg &&... arg)
bool put(const OUString &_rValueName, const VALUE_TYPE &_rValue)
css::uno::Sequence< css::beans::PropertyValue > getPropertyValues() const
Point OutputToScreenPixel(const Point &rPos) const
virtual void dispose() override
bool IsReallyVisible() const
vcl::Window * GetParent() const
bool IsChild(const vcl::Window *pWindow) const
virtual void SetSizePixel(const Size &rNewSize)
bool IsReallyShown() const
Size GetOutputSizePixel() const
void SetBorderStyle(WindowBorderStyle nBorderStyle)
void SetModalHierarchyHdl(const Link< bool, void > &rLink)
#define ENSURE_OR_THROW(c, m)
#define DBG_UNHANDLED_EXCEPTION(...)
IMPL_LINK(SfxFrameWindow_Impl, ModalHierarchyHdl, bool, bSetModal, void)
#define LINK(Instance, Class, Member)
#define SAL_INFO(area, stream)
constexpr auto SFX_INTERFACE_NONE
Reference< XFrame > xFrame
WinBits const WB_NODIALOGCONTROL
WinBits const WB_CLIPCHILDREN