LibreOffice Module sfx2 (master) 1
frame.hxx
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#ifndef INCLUDED_SFX2_FRAME_HXX
20#define INCLUDED_SFX2_FRAME_HXX
21
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>
34
35
37{
38 class XFrame;
39 class XController;
40}
41
42class SvBorder;
43class SfxWorkWindow;
44namespace vcl { class Window; }
45class SfxFrame_Impl;
46class SfxObjectShell;
47class SfxViewFrame;
49namespace tools { class Rectangle; }
50class SystemWindow;
51
52typedef ::std::vector<OUString> TargetList;
53
54
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.
64
65
66class SFX2_DLLPUBLIC SfxFrame final : public SvCompatWeakBase<SfxFrame>
67{
68 friend class SfxFrameIterator;
69 friend class SfxFrameWindow_Impl;
70
71private:
72 std::unique_ptr< SfxFrame_Impl > m_pImpl;
74
75 virtual ~SfxFrame();
76
77 SAL_DLLPRIVATE SfxFrame( vcl::Window& i_rContainerWindow );
78
79public:
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 );
84
85 vcl::Window& GetWindow() const { return *m_pWindow;}
86 void CancelTransfers();
87 bool DoClose();
88
89 void SetPresentationMode( bool bSet );
91
92 SAL_WARN_UNUSED_RESULT static SfxFrame* GetFirst();
93 SAL_WARN_UNUSED_RESULT static SfxFrame* GetNext( SfxFrame& );
94
95 SAL_WARN_UNUSED_RESULT SfxObjectShell* GetCurrentDocument() const;
96 SAL_WARN_UNUSED_RESULT SfxViewFrame* GetCurrentViewFrame() const;
97
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;
108
109 bool IsInPlace() const;
110
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();
121
122 // Methods for accessing the current set
123 SAL_DLLPRIVATE SfxFrameDescriptor* GetDescriptor() const;
124
125 SAL_DLLPRIVATE bool IsAutoLoadLocked_Impl() const;
126
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();
136
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;
143private:
144 SAL_DLLPRIVATE void Construct_Impl();
145};
146
148
150{
153
154public:
155
156 SfxFrameItem( sal_uInt16 nWhich, SfxViewFrame const *p );
158 SfxFrameItem( sal_uInt16 nWhich, SfxFrame *p );
159
160 virtual bool operator==( const SfxPoolItem& ) const override;
161 virtual SfxFrameItem* Clone( SfxItemPool *pPool = nullptr ) const override;
162
163 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
164 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
165
166 SfxFrame* GetFrame() const { return wFrame; }
167};
168
170{
171 css::uno::Any aValue;
172public:
173 static SfxPoolItem* CreateDefault();
174 SfxUnoAnyItem( sal_uInt16 nWhich, const css::uno::Any& rAny );
175 const css::uno::Any& GetValue() const
176 { return aValue; }
177 virtual bool operator==( const SfxPoolItem& ) const override;
178 virtual SfxUnoAnyItem* Clone( SfxItemPool *pPool = nullptr ) const override;
179 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
180 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
181};
182
184{
185 css::uno::Reference< css::frame::XFrame >
187
188public:
189 static SfxPoolItem* CreateDefault();
191 SfxUnoFrameItem( sal_uInt16 nWhich, css::uno::Reference< css::frame::XFrame > i_xFrame );
192 const css::uno::Reference< css::frame::XFrame >&
193 GetFrame() const
194 { return m_xFrame; }
195 virtual bool operator==( const SfxPoolItem& ) const override;
196 virtual SfxUnoFrameItem* Clone( SfxItemPool *pPool = nullptr ) const override;
197 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
198 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
199};
200
201#endif
202
203/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::lang::XComponent > m_xFrame
SfxFrame * GetFrame() const
Definition: frame.hxx:166
SfxFrameWeakRef wFrame
Definition: frame.hxx:152
SfxFrame * pFrame
Definition: frame.hxx:151
virtual void Resize() override
Definition: frame2.cxx:177
VclPtr< vcl::Window > m_pWindow
Definition: frame.hxx:73
std::unique_ptr< SfxFrame_Impl > m_pImpl
Definition: frame.hxx:72
vcl::Window & GetWindow() const
Definition: frame.hxx:85
const css::uno::Any & GetValue() const
Definition: frame.hxx:175
css::uno::Any aValue
Definition: frame.hxx:171
const css::uno::Reference< css::frame::XFrame > & GetFrame() const
Definition: frame.hxx:193
css::uno::Reference< css::frame::XFrame > m_xFrame
Definition: frame.hxx:186
SystemWindow * GetSystemWindow() const
virtual std::shared_ptr< SfxDialogController > GetController() override
#define SFX2_DLLPUBLIC
Definition: dllapi.h:29
::std::vector< OUString > TargetList
Definition: frame.hxx:50
SvCompatWeakRef< SfxFrame > SfxFrameWeakRef
Definition: frame.hxx:147
::std::vector< OUString > TargetList
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
unsigned char sal_uInt8
#define SAL_WARN_UNUSED_RESULT
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)