workaround segfault in compiler on macos-clang-intel
[LibreOffice.git] / include / sfx2 / frame.hxx
blobb2b7159e9256ac220ed43e4f8f251cc188de4dd9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SFX2_FRAME_HXX
20 #define INCLUDED_SFX2_FRAME_HXX
22 #include <sal/config.h>
23 #include <sfx2/dllapi.h>
24 #include <sfx2/shell.hxx>
25 #include <sal/types.h>
26 #include <com/sun/star/uno/Reference.h>
27 #include <com/sun/star/uno/Any.hxx>
28 #include <vcl/vclptr.hxx>
29 #include <rtl/ustring.hxx>
30 #include <svl/poolitem.hxx>
31 #include <tools/ref.hxx>
32 #include <memory>
33 #include <vector>
36 namespace com::sun::star::frame
38 class XFrame;
39 class XController;
42 class SvBorder;
43 class SfxWorkWindow;
44 namespace vcl { class Window; }
45 class SfxFrame_Impl;
46 class SfxObjectShell;
47 class SfxViewFrame;
48 class SfxFrameDescriptor;
49 namespace tools { class Rectangle; }
50 class SystemWindow;
52 typedef ::std::vector<OUString> TargetList;
55 // SfxFrame is a management class for windows and their content.
56 // A SfxApplication represent a hierarchy of SfxFrames, with which the actual
57 // content in the derived classes is defined. The base class SfxFrame
58 // implements two aspects of frames: naming and control of its lifespan.
59 // Inside a frame hierarchy the parent frame always controls the lifespan of
60 // its child frames, even though they usually are not even produced by the
61 // parent. By calling DoCloser() on any frame in the hierarchy,
62 // a part of the "framework" can be removed, where frames unsubscribe
63 // from their parent frames.
66 class SFX2_DLLPUBLIC SfxFrame final : public SvCompatWeakBase<SfxFrame>
68 friend class SfxFrameIterator;
69 friend class SfxFrameWindow_Impl;
71 private:
72 std::unique_ptr< SfxFrame_Impl > m_pImpl;
73 VclPtr<vcl::Window> m_pWindow;
75 virtual ~SfxFrame();
77 SAL_DLLPRIVATE SfxFrame( vcl::Window& i_rContainerWindow );
79 public:
80 static SfxFrame* Create( const css::uno::Reference< css::frame::XFrame >& xFrame );
81 static css::uno::Reference< css::frame::XFrame >
82 CreateBlankFrame();
83 static SfxFrame* CreateHidden( SfxObjectShell const & rDoc, vcl::Window& rWindow, SfxInterfaceId nViewId );
85 vcl::Window& GetWindow() const { return *m_pWindow;}
86 void CancelTransfers();
87 bool DoClose();
89 void SetPresentationMode( bool bSet );
90 SystemWindow* GetSystemWindow() const;
92 SAL_WARN_UNUSED_RESULT static SfxFrame* GetFirst();
93 SAL_WARN_UNUSED_RESULT static SfxFrame* GetNext( SfxFrame& );
95 SAL_WARN_UNUSED_RESULT SfxObjectShell* GetCurrentDocument() const;
96 SAL_WARN_UNUSED_RESULT SfxViewFrame* GetCurrentViewFrame() const;
98 bool GetHasTitle() const;
99 static void GetDefaultTargetList( TargetList& );
100 void UpdateDescriptor( SfxObjectShell const *pDoc );
101 void Resize();
102 const css::uno::Reference< css::frame::XFrame >&
103 GetFrameInterface() const;
104 void Appear();
105 void AppearWithUpdate();
106 css::uno::Reference< css::frame::XController >
107 GetController() const;
109 bool IsInPlace() const;
111 SAL_DLLPRIVATE void DoClose_Impl();
112 SAL_DLLPRIVATE void SetFrameInterface_Impl( const css::uno::Reference< css::frame::XFrame >& rFrame );
113 SAL_DLLPRIVATE void ReleasingComponent_Impl();
114 SAL_DLLPRIVATE void GetViewData_Impl();
115 SAL_DLLPRIVATE void SetHasTitle( bool );
116 SAL_DLLPRIVATE bool PrepareClose_Impl( bool bUI );
117 SAL_DLLPRIVATE bool DocIsModified_Impl();
118 SAL_DLLPRIVATE void SetCurrentViewFrame_Impl( SfxViewFrame* );
119 bool IsClosing_Impl() const;
120 SAL_DLLPRIVATE void SetIsClosing_Impl();
122 // Methods for accessing the current set
123 SAL_DLLPRIVATE SfxFrameDescriptor* GetDescriptor() const;
125 SAL_DLLPRIVATE bool IsAutoLoadLocked_Impl() const;
127 SAL_DLLPRIVATE static void InsertTopFrame_Impl( SfxFrame* pFrame );
128 SAL_DLLPRIVATE static void RemoveTopFrame_Impl( SfxFrame* pFrame );
129 SAL_DLLPRIVATE void SetOwnsBindings_Impl( bool bSet );
130 SAL_DLLPRIVATE bool OwnsBindings_Impl() const;
131 SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl() const;
132 SAL_DLLPRIVATE void SetToolSpaceBorderPixel_Impl( const SvBorder& );
133 SAL_DLLPRIVATE tools::Rectangle GetTopOuterRectPixel_Impl() const;
134 SAL_DLLPRIVATE void CreateWorkWindow_Impl();
135 SAL_DLLPRIVATE void GrabFocusOnComponent_Impl();
137 SAL_DLLPRIVATE void PrepareForDoc_Impl( const SfxObjectShell& i_rDoc );
138 SAL_DLLPRIVATE void LockResize_Impl( bool bLock );
139 SAL_DLLPRIVATE void SetMenuBarOn_Impl( bool bOn );
140 SAL_DLLPRIVATE bool IsMenuBarOn_Impl() const;
141 SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const;
142 SAL_DLLPRIVATE bool IsMarkedHidden_Impl() const;
143 private:
144 SAL_DLLPRIVATE void Construct_Impl();
147 typedef SvCompatWeakRef<SfxFrame> SfxFrameWeakRef;
149 class SFX2_DLLPUBLIC SfxFrameItem final : public SfxPoolItem
151 SfxFrame* pFrame;
152 SfxFrameWeakRef wFrame;
154 public:
156 SfxFrameItem( sal_uInt16 nWhich, SfxViewFrame const *p );
157 SfxFrameItem( sal_uInt16 nWhich, SfxFrame *p );
159 virtual bool operator==( const SfxPoolItem& ) const override;
160 virtual SfxFrameItem* Clone( SfxItemPool *pPool = nullptr ) const override;
162 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
163 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
165 SfxFrame* GetFrame() const { return wFrame; }
168 class SFX2_DLLPUBLIC SfxUnoAnyItem final : public SfxPoolItem
170 css::uno::Any aValue;
171 public:
172 static SfxPoolItem* CreateDefault();
173 SfxUnoAnyItem( sal_uInt16 nWhich, const css::uno::Any& rAny );
174 const css::uno::Any& GetValue() const
175 { return aValue; }
176 virtual bool operator==( const SfxPoolItem& ) const override;
177 virtual SfxUnoAnyItem* Clone( SfxItemPool *pPool = nullptr ) const override;
178 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
179 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
182 class SFX2_DLLPUBLIC SfxUnoFrameItem final : public SfxPoolItem
184 css::uno::Reference< css::frame::XFrame >
185 m_xFrame;
187 public:
188 static SfxPoolItem* CreateDefault();
189 SfxUnoFrameItem();
190 SfxUnoFrameItem( sal_uInt16 nWhich, css::uno::Reference< css::frame::XFrame > i_xFrame );
191 const css::uno::Reference< css::frame::XFrame >&
192 GetFrame() const
193 { return m_xFrame; }
194 virtual bool operator==( const SfxPoolItem& ) const override;
195 virtual SfxUnoFrameItem* Clone( SfxItemPool *pPool = nullptr ) const override;
196 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
197 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
200 #endif
202 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */