20#include <com/sun/star/uno/Reference.h>
21#include <com/sun/star/awt/XTopWindow.hpp>
22#include <com/sun/star/awt/XWindow.hpp>
23#include <com/sun/star/util/XCloseable.hpp>
24#include <com/sun/star/util/CloseVetoException.hpp>
25#include <com/sun/star/lang/DisposedException.hpp>
26#include <com/sun/star/container/XChild.hpp>
27#include <com/sun/star/embed/XEmbeddedObject.hpp>
43#include <sfx2/sfxsids.hrc>
102 Reference< XCloseable > xCloseable (
m_pImpl->xFrame, UNO_QUERY );
104 xCloseable->close(
true);
105 else if (
m_pImpl->xFrame.is() )
108 xFrame->setComponent( Reference < css::awt::XWindow >(), Reference < XController >() );
114 catch( css::util::CloseVetoException& )
119 catch( css::lang::DisposedException& )
130 if (
m_pImpl->pCurrentViewFrame )
131 pBindings = &
m_pImpl->pCurrentViewFrame->GetBindings();
135 m_pImpl->pWorkWin->DeleteControllers_Impl();
137 if (
m_pImpl->pCurrentViewFrame )
138 m_pImpl->pCurrentViewFrame->Close();
151 return m_pImpl->pCurrentViewFrame &&
m_pImpl->pCurrentViewFrame->GetObjectShell() &&
152 m_pImpl->pCurrentViewFrame->GetObjectShell()->IsModified();
173 bOther = ( &pFrame->GetFrame() != this );
189 if ( bRet &&
m_pImpl->pWorkWin )
191 bRet =
m_pImpl->pWorkWin->PrepareClose_Impl();
209 if(
m_pImpl->bInCancelTransfers )
212 m_pImpl->bInCancelTransfers =
true;
231 m_pImpl->bInCancelTransfers =
false;
236 return m_pImpl->pCurrentViewFrame;
252 return m_pImpl->pCurrentViewFrame ?
253 m_pImpl->pCurrentViewFrame->GetObjectShell() :
259 m_pImpl->pCurrentViewFrame = pFrame;
304 assert(pDoc &&
"NULL-Document inserted ?!");
312 const std::shared_ptr<const SfxFilter>& pFilter = pMed->
GetFilter();
315 aFilter = pFilter->GetFilterName();
327 pSet->Put( *pRefererItem );
332 pSet->Put( *pOptionsItem );
335 pSet->Put( *pTitle1Item );
348 DBG_ASSERT(
true,
"No TopLevel-Frame, but no Descriptor!" );
359 rList.emplace_back( );
360 rList.emplace_back(
"_top" );
361 rList.emplace_back(
"_parent" );
362 rList.emplace_back(
"_blank" );
363 rList.emplace_back(
"_self" );
369 rArr.push_back( pFrame );
375 auto it = std::find( rArr.begin(), rArr.end(), pFrame );
376 if ( it != rArr.end() )
381 :
SfxPoolItem( nWhichId ), pFrame(
p ? &
p->GetFrame() : nullptr )
388 pFrame(
p ), wFrame(
p )
394 pFrame(
p ), wFrame(
p )
416 rVal <<=
wFrame->GetFrameInterface();
425 Reference < XFrame >
xFrame;
454 assert(SfxPoolItem::operator==(rItem)); (void)rItem;
509 if (
m_pImpl->pCurrentViewFrame &&
m_pImpl->pCurrentViewFrame->GetViewShell() )
510 return m_pImpl->pCurrentViewFrame->GetViewShell()->GetController();
512 return css::uno::Reference< css::frame::XController > ();
523 css::uno::Reference< css::frame::XDispatchRecorder > xRecorder;
534 m_pImpl->xFrame->getContainerWindow()->setVisible(
true );
535 Reference < css::awt::XTopWindow > xTopWindow(
m_pImpl->xFrame->getContainerWindow(), UNO_QUERY );
536 if ( xTopWindow.is() )
537 xTopWindow->toFront();
568 if ( aSize.
Width() > nDeltaX )
574 if ( aSize.
Height() > nDeltaY )
605 Reference < XModel > xParent( xChild->getParent(), UNO_QUERY );
608 Reference< XController > xParentCtrler = xParent->getCurrentController();
609 if ( xParentCtrler.is() )
611 Reference < XFrame >
xFrame( xParentCtrler->getFrame() );
629 TOOLS_WARN_EXCEPTION(
"sfx.view",
"SfxFrame::CreateWorkWindow_Impl: Exception caught. Please try to submit a reproducible bug!");
638 if (
m_pImpl->bReleasingComponent )
654 m_pImpl->bReleasingComponent =
true;
699 else if (
m_pImpl->pCurrentViewFrame )
701 m_pImpl->pCurrentViewFrame->GetWindow().SetSizePixel(
GetWindow().GetOutputSizePixel() );
css::uno::Reference< css::lang::XComponent > m_xFrame
SfxApplication * SfxGetpApp()
static OUString GetEventName(GlobalEventId nID)
std::vector< SfxFrame * > vTopFrames
SAL_DLLPRIVATE SfxAppData_Impl * Get_Impl() const
void NotifyEvent(const SfxEventHint &rEvent, bool bSynchron=true)
SAL_DLLPRIVATE void SetRecorder_Impl(css::uno::Reference< css::frame::XDispatchRecorder > const &)
void Broadcast(const SfxHint &rHint)
SAL_DLLPRIVATE void Update_Impl(bool bForce=false)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual SfxFrameItem * Clone(SfxItemPool *pPool=nullptr) const override
virtual bool operator==(const SfxPoolItem &) const override
SfxFrameItem(sal_uInt16 nWhich, SfxViewFrame const *p)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
SAL_DLLPRIVATE void SetOwnsBindings_Impl(bool bSet)
SAL_DLLPRIVATE void GetViewData_Impl()
SAL_DLLPRIVATE void CreateWorkWindow_Impl()
static SAL_DLLPRIVATE void RemoveTopFrame_Impl(SfxFrame *pFrame)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
SAL_DLLPRIVATE void GrabFocusOnComponent_Impl()
SAL_DLLPRIVATE void SetIsClosing_Impl()
SAL_DLLPRIVATE tools::Rectangle GetTopOuterRectPixel_Impl() const
VclPtr< vcl::Window > m_pWindow
bool IsClosing_Impl() const
SAL_DLLPRIVATE void SetFrameInterface_Impl(const css::uno::Reference< css::frame::XFrame > &rFrame)
void UpdateDescriptor(SfxObjectShell const *pDoc)
SAL_DLLPRIVATE void SetHasTitle(bool)
SAL_DLLPRIVATE void ReleasingComponent_Impl()
SAL_DLLPRIVATE bool DocIsModified_Impl()
SAL_DLLPRIVATE void DoClose_Impl()
SAL_DLLPRIVATE SfxWorkWindow * GetWorkWindow_Impl() const
SAL_DLLPRIVATE bool IsAutoLoadLocked_Impl() const
SAL_DLLPRIVATE void Construct_Impl()
SAL_DLLPRIVATE SfxFrameDescriptor * GetDescriptor() const
static SAL_DLLPRIVATE void InsertTopFrame_Impl(SfxFrame *pFrame)
std::unique_ptr< SfxFrame_Impl > m_pImpl
SAL_DLLPRIVATE void SetCurrentViewFrame_Impl(SfxViewFrame *)
SAL_WARN_UNUSED_RESULT SfxObjectShell * GetCurrentDocument() const
static SAL_WARN_UNUSED_RESULT SfxFrame * GetNext(SfxFrame &)
SAL_DLLPRIVATE void SetToolSpaceBorderPixel_Impl(const SvBorder &)
static void GetDefaultTargetList(TargetList &)
css::uno::Reference< css::frame::XController > GetController() const
static SAL_WARN_UNUSED_RESULT SfxFrame * GetFirst()
vcl::Window & GetWindow() const
SAL_WARN_UNUSED_RESULT SfxViewFrame * GetCurrentViewFrame() const
SAL_DLLPRIVATE bool PrepareClose_Impl(bool bUI)
SAL_DLLPRIVATE bool OwnsBindings_Impl() const
const css::uno::Reference< css::embed::XEmbeddedObject > & GetObject() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const std::shared_ptr< const SfxFilter > & GetFilter() const
SfxItemSet & GetItemSet() const
virtual bool PrepareClose(bool bUI=true)
virtual void CancelTransfers()
bool IsAutoLoadLocked() const
static SfxObjectShell * GetShellFromComponent(const css::uno::Reference< css::uno::XInterface > &xComp)
SfxMedium * GetMedium() const
virtual bool operator==(const SfxPoolItem &) const=0
SfxViewShell * GetViewShell() const
Returns the SfxViewShell in which they are located in the subshells.
SfxUnoAnyItem(sal_uInt16 nWhich, const css::uno::Any &rAny)
virtual bool operator==(const SfxPoolItem &) const override
virtual SfxUnoAnyItem * Clone(SfxItemPool *pPool=nullptr) const override
static SfxPoolItem * CreateDefault()
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool operator==(const SfxPoolItem &) const override
css::uno::Reference< css::frame::XFrame > m_xFrame
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
static SfxPoolItem * CreateDefault()
virtual SfxUnoFrameItem * Clone(SfxItemPool *pPool=nullptr) const override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
vcl::Window & GetWindow() const
SfxBindings & GetBindings()
SfxInterfaceId GetCurViewId() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxDispatcher * GetDispatcher()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxFrame & GetFrame() const
virtual bool PrepareClose(bool bUI=true)
Initialize is called after the frame has been loaded and the controller has been set.
vcl::Window * GetWindow() const
SAL_DLLPRIVATE SfxInPlaceClient * GetUIActiveIPClient_Impl() const
void ArrangeChildren_Impl(bool bForce=true)
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
bool HasChildPathFocus(bool bSystemWindow=false) const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
static std::vector< SfxFrame * > gaFramesArr_Impl
::std::vector< OUString > TargetList
Reference< XFrame > xFrame