1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SFX2_FRAME_HXX
#define INCLUDED_SFX2_FRAME_HXX
#ifndef TF_NEWDESKTOP
#define TF_NEWDESKTOP 1
#endif
#include <sal/config.h>
#include <sfx2/dllapi.h>
#include <sal/types.h>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <vcl/vclptr.hxx>
namespace com
{
namespace sun
{
namespace star
{
namespace awt
{
class XWindow;
}
namespace frame
{
class XFrame;
class XFrameLoader;
class XController;
class XDispatchProviderInterceptor;
}
namespace beans
{
struct PropertyValue;
}
}
}
}
#include <comphelper/namedvaluecollection.hxx>
#include <rtl/ustring.hxx>
#include <svl/poolitem.hxx>
#include <tools/ref.hxx>
#include <vector>
class SvBorder;
class SfxWorkWindow;
namespace vcl { class Window; }
class SfxFrame;
class SfxFrame_Impl;
class SfxObjectShell;
class SfxObjectFactory;
class SfxViewFrame;
class SfxFrameDescriptor;
class SfxFrameSetDescriptor;
class SfxDispatcher;
class Rectangle;
class SfxRequest;
class SfxUnoControllerItem;
class SystemWindow;
class SfxFrameArr_Impl;
typedef ::std::vector<OUString> TargetList;
#define SFXFRAME_HASTITLE 0x0001
// SfxFrame is a management class for windows and their content.
// A SfxApplication represent a hierarchy of SfxFrames, with which the actual
// content in the derived classes is defined. The base class SfxFrame
// implements two aspects of frames: naming and control of its lifespan.
// Inside a frame hierarchy the parent frame always controls the lifespan of
// its child frames, even though they usually are not even produced by the
// parent. By calling DoCloser() on any frame in the hierarchy,
// a part of the "framework" can be removed, where frames unsubscribe
// from their parent frames.
class SFX2_DLLPUBLIC SfxFrame : public SvCompatWeakBase<SfxFrame>
{
friend class SfxFrameIterator;
friend class SfxFrameWindow_Impl;
private:
SfxFrame* pParentFrame;
SfxFrameArr_Impl* pChildArr;
SfxFrame_Impl* pImp;
VclPtr<vcl::Window> pWindow;
protected:
bool Close();
virtual ~SfxFrame();
SAL_DLLPRIVATE void RemoveChildFrame_Impl( SfxFrame* );
SfxFrame( ); // not implemented
SAL_DLLPRIVATE SfxFrame( vcl::Window& i_rContainerWindow, bool bHidden );
public:
static SfxFrame* Create( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame );
static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
CreateBlankFrame();
static SfxFrame* Create( SfxObjectShell& rDoc, vcl::Window& rWindow, sal_uInt16 nViewId, bool bHidden );
vcl::Window& GetWindow() const { return *pWindow;}
void CancelTransfers( bool bCancelLoadEnv = true );
bool DoClose();
sal_uInt16 GetChildFrameCount() const;
SfxFrame* GetChildFrame( sal_uInt16 nPos ) const;
SfxFrame* GetParentFrame() const
{ return pParentFrame; }
void SetPresentationMode( bool bSet );
SystemWindow* GetSystemWindow() const;
static SfxFrame* GetFirst();
static SfxFrame* GetNext( SfxFrame& );
static const SfxPoolItem*
OpenDocumentSynchron( SfxItemSet& aSet, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rTargetFrame );
SfxObjectShell* GetCurrentDocument() const;
SfxViewFrame* GetCurrentViewFrame() const;
SfxFrame& GetTopFrame() const;
bool IsParent( SfxFrame* ) const;
sal_uInt32 GetFrameType() const;
static void GetDefaultTargetList( TargetList& );
void GetTargetList( TargetList& ) const;
SAL_DLLPRIVATE SfxFrame* GetContainingDocFrame_Impl( SfxFrame* pSelf );
void UpdateDescriptor( SfxObjectShell *pDoc );
void Resize();
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
GetComponent() const;
void ReleaseComponent();
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
GetFrameInterface() const;
void Appear();
void AppearWithUpdate();
::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >
GetController() const;
bool IsInPlace() const;
SAL_DLLPRIVATE bool DoClose_Impl();
SAL_DLLPRIVATE void SetFrameInterface_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
SAL_DLLPRIVATE void ReleasingComponent_Impl( bool bSet );
SAL_DLLPRIVATE void GetViewData_Impl();
SAL_DLLPRIVATE void SetFrameType_Impl( sal_uInt32 );
SAL_DLLPRIVATE bool PrepareClose_Impl( bool bUI );
SAL_DLLPRIVATE bool DocIsModified_Impl();
SAL_DLLPRIVATE void SetCurrentViewFrame_Impl( SfxViewFrame* );
SAL_DLLPRIVATE bool IsClosing_Impl() const;
SAL_DLLPRIVATE void SetIsClosing_Impl();
// Methods for accessing the current set
SAL_DLLPRIVATE SfxFrameDescriptor* GetDescriptor() const;
SAL_DLLPRIVATE void Lock_Impl( bool bLock );
SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl() const;
SAL_DLLPRIVATE bool IsAutoLoadLocked_Impl() const;
SAL_DLLPRIVATE static void InsertTopFrame_Impl( SfxFrame* pFrame );
SAL_DLLPRIVATE static void RemoveTopFrame_Impl( SfxFrame* pFrame );
SAL_DLLPRIVATE void SetOwnsBindings_Impl( bool bSet );
SAL_DLLPRIVATE bool OwnsBindings_Impl() const;
SAL_DLLPRIVATE void InvalidateUnoControllers_Impl();
SAL_DLLPRIVATE void RegisterUnoController_Impl( SfxUnoControllerItem* );
SAL_DLLPRIVATE void ReleaseUnoController_Impl( SfxUnoControllerItem* );
SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl() const;
SAL_DLLPRIVATE void SetToolSpaceBorderPixel_Impl( const SvBorder& );
SAL_DLLPRIVATE Rectangle GetTopOuterRectPixel_Impl() const;
SAL_DLLPRIVATE void CreateWorkWindow_Impl();
SAL_DLLPRIVATE void GrabFocusOnComponent_Impl();
SAL_DLLPRIVATE void SetInPlace_Impl( bool );
SAL_DLLPRIVATE void PrepareForDoc_Impl( SfxObjectShell& i_rDoc );
SAL_DLLPRIVATE void LockResize_Impl( bool bLock );
SAL_DLLPRIVATE void SetMenuBarOn_Impl( bool bOn );
SAL_DLLPRIVATE bool IsMenuBarOn_Impl() const;
SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const;
SAL_DLLPRIVATE bool IsMarkedHidden_Impl() const;
private:
SAL_DLLPRIVATE void Construct_Impl();
};
typedef SvCompatWeakRef<SfxFrame> SfxFrameWeakRef;
class SfxFrameIterator
{
const SfxFrame* pFrame;
bool bRecursive;
SfxFrame* NextSibling_Impl( SfxFrame& rPrev );
public:
SfxFrameIterator( const SfxFrame& rFrame, bool bRecursive=true );
SfxFrame* FirstFrame();
SfxFrame* NextFrame( SfxFrame& rPrev );
};
class SFX2_DLLPUBLIC SfxFrameItem: public SfxPoolItem
{
SfxFrame* pFrame;
SfxFrameWeakRef wFrame;
SAL_DLLPRIVATE void SetFramePtr_Impl( SfxFrame* /*pFrameP*/ ) { pFrame = wFrame; }
public:
TYPEINFO_OVERRIDE();
SfxFrameItem( sal_uInt16 nWhich, SfxViewFrame *p );
SfxFrameItem( SfxFrame *p=0 );
SfxFrameItem( sal_uInt16 nWhich, SfxFrame *p );
virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
bool FrameKilled() const { return &wFrame != pFrame; }
SfxFrame* GetFrame() const
{ return wFrame; }
};
class SFX2_DLLPUBLIC SfxUsrAnyItem : public SfxPoolItem
{
::com::sun::star::uno::Any aValue;
public:
TYPEINFO_OVERRIDE();
SfxUsrAnyItem( sal_uInt16 nWhich, const ::com::sun::star::uno::Any& rAny );
::com::sun::star::uno::Any GetValue() const
{ return aValue; }
virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
};
class SFX2_DLLPUBLIC SfxUnoFrameItem : public SfxPoolItem
{
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
m_xFrame;
public:
TYPEINFO_OVERRIDE();
SfxUnoFrameItem();
SfxUnoFrameItem( sal_uInt16 nWhich, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame );
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&
GetFrame() const
{ return m_xFrame; }
virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
};
typedef SfxUsrAnyItem SfxUnoAnyItem;
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|