fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / sfx2 / frame.hxx
blob63220cae1325d26af967077d7690af0ade8dfff9
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 _SFXFRAME_HXX
20 #define _SFXFRAME_HXX
22 #ifndef TF_NEWDESKTOP
23 #define TF_NEWDESKTOP 1
24 #endif
26 #include "sal/config.h"
27 #include "sfx2/dllapi.h"
28 #include "sal/types.h"
29 #include <com/sun/star/uno/Reference.h>
30 #include <com/sun/star/uno/Any.hxx>
31 #include <com/sun/star/uno/Sequence.hxx>
33 namespace com
35 namespace sun
37 namespace star
39 namespace awt
41 class XWindow;
43 namespace frame
45 class XFrame;
46 class XFrameLoader;
47 class XController;
48 class XDispatchProviderInterceptor;
50 namespace beans
52 struct PropertyValue;
57 #include <tools/ref.hxx>
58 #include <tools/string.hxx>
59 #include <svl/brdcst.hxx>
60 #include <svl/poolitem.hxx>
61 #include <comphelper/namedvaluecollection.hxx>
62 #include <vector>
64 class SvBorder;
65 class SfxWorkWindow;
66 class Window;
67 class SfxFrame;
68 class SfxFrame_Impl;
69 class SfxObjectShell;
70 class SfxObjectFactory;
71 class SfxViewFrame;
72 class SfxFrameDescriptor;
73 class SfxFrameSetDescriptor;
74 class SfxDispatcher;
75 class Rectangle;
76 class SfxRequest;
77 class SfxUnoControllerItem;
78 class SvCompatWeakHdl;
79 class SystemWindow;
81 class SfxFrame;
82 typedef ::std::vector<SfxFrame*> SfxFrameArr_Impl;
84 typedef ::std::vector< String* > TargetList;
86 #define SFXFRAME_HASTITLE 0x0001
88 //==========================================================================
89 // SfxFrame is a management class for windows and their content.
90 // A SfxApplication represent a hierarchy of SfxFrames, with which the actual
91 // content in the derived classes is defined. The base class SfxFrame
92 // implements two aspects of frames: naming and control of its lifespan.
93 // Inside a frame hierarchy the parent frame always controls the lifespan of
94 // its child frames, even though they usually are not even produced by the
95 // parent. By calling DoCloser() on any frame in the hierarchy,
96 // a part of the "framework" can be removed, where frames unsubscribe
97 // from their parent frames.
98 //==========================================================================
100 class SFX2_DLLPUBLIC SfxFrame
102 friend class SfxFrameIterator;
103 friend class SfxFrameWindow_Impl;
105 private:
106 SfxFrame* pParentFrame;
107 SfxFrameArr_Impl* pChildArr;
108 SfxFrame_Impl* pImp;
109 Window* pWindow;
111 protected:
112 sal_Bool Close();
113 virtual ~SfxFrame();
115 SAL_DLLPRIVATE void RemoveChildFrame_Impl( SfxFrame* );
117 SfxFrame( ); // not implemented
118 SAL_DLLPRIVATE SfxFrame( Window& i_rContainerWindow, bool bHidden );
120 public:
121 TYPEINFO();
123 static SfxFrame* Create( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame );
124 static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
125 CreateBlankFrame();
126 static SfxFrame* Create( SfxObjectShell& rDoc, Window& rWindow, sal_uInt16 nViewId, bool bHidden );
128 SvCompatWeakHdl* GetHdl();
129 Window& GetWindow() const;
130 void CancelTransfers( sal_Bool bCancelLoadEnv = sal_True );
131 sal_Bool DoClose();
132 sal_uInt16 GetChildFrameCount() const;
133 SfxFrame* GetChildFrame( sal_uInt16 nPos ) const;
134 SfxFrame* GetParentFrame() const
135 { return pParentFrame; }
137 void SetPresentationMode( sal_Bool bSet );
138 SystemWindow* GetSystemWindow() const;
140 static SfxFrame* GetFirst();
141 static SfxFrame* GetNext( SfxFrame& );
143 static const SfxPoolItem*
144 OpenDocumentSynchron( SfxItemSet& aSet, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rTargetFrame );
146 SfxObjectShell* GetCurrentDocument() const;
147 SfxViewFrame* GetCurrentViewFrame() const;
148 SfxFrame& GetTopFrame() const;
149 sal_Bool IsParent( SfxFrame* ) const;
151 sal_uInt32 GetFrameType() const;
152 void GetTargetList( TargetList& ) const;
153 SAL_DLLPRIVATE SfxFrame* GetContainingDocFrame_Impl( SfxFrame* pSelf );
154 void UpdateDescriptor( SfxObjectShell *pDoc );
155 void Resize();
156 sal_Bool HasComponent() const;
157 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
158 GetComponent() const;
159 void ReleaseComponent();
160 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
161 GetFrameInterface() const;
162 void Appear();
163 void AppearWithUpdate();
164 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >
165 GetController() const;
167 sal_Bool IsInPlace() const;
169 SAL_DLLPRIVATE sal_Bool DoClose_Impl();
170 SAL_DLLPRIVATE void SetFrameInterface_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
171 SAL_DLLPRIVATE void ReleasingComponent_Impl( sal_Bool bSet );
172 SAL_DLLPRIVATE void GetViewData_Impl();
173 SAL_DLLPRIVATE void SetFrameType_Impl( sal_uInt32 );
174 SAL_DLLPRIVATE sal_uInt16 PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing=sal_False );
175 SAL_DLLPRIVATE sal_Bool DocIsModified_Impl();
176 SAL_DLLPRIVATE void SetCurrentViewFrame_Impl( SfxViewFrame* );
177 SAL_DLLPRIVATE sal_Bool IsClosing_Impl() const;
178 SAL_DLLPRIVATE void SetIsClosing_Impl();
180 // Methods for accessing the current set
181 SAL_DLLPRIVATE SfxFrameDescriptor* GetDescriptor() const;
183 SAL_DLLPRIVATE void Lock_Impl( sal_Bool bLock );
184 SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl() const;
185 SAL_DLLPRIVATE sal_Bool IsAutoLoadLocked_Impl() const;
187 SAL_DLLPRIVATE static void InsertTopFrame_Impl( SfxFrame* pFrame );
188 SAL_DLLPRIVATE static void RemoveTopFrame_Impl( SfxFrame* pFrame );
189 SAL_DLLPRIVATE void SetOwnsBindings_Impl( sal_Bool bSet );
190 SAL_DLLPRIVATE sal_Bool OwnsBindings_Impl() const;
191 SAL_DLLPRIVATE void InvalidateUnoControllers_Impl();
192 SAL_DLLPRIVATE void RegisterUnoController_Impl( SfxUnoControllerItem* );
193 SAL_DLLPRIVATE void ReleaseUnoController_Impl( SfxUnoControllerItem* );
194 SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl() const;
195 SAL_DLLPRIVATE void SetToolSpaceBorderPixel_Impl( const SvBorder& );
196 SAL_DLLPRIVATE Rectangle GetTopOuterRectPixel_Impl() const;
197 SAL_DLLPRIVATE void CreateWorkWindow_Impl();
198 SAL_DLLPRIVATE void GrabFocusOnComponent_Impl();
199 SAL_DLLPRIVATE void SetInPlace_Impl( sal_Bool );
201 SAL_DLLPRIVATE void PrepareForDoc_Impl( SfxObjectShell& i_rDoc );
202 SAL_DLLPRIVATE void LockResize_Impl( sal_Bool bLock );
203 SAL_DLLPRIVATE void SetMenuBarOn_Impl( sal_Bool bOn );
204 SAL_DLLPRIVATE sal_Bool IsMenuBarOn_Impl() const;
205 SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const;
206 SAL_DLLPRIVATE bool IsMarkedHidden_Impl() const;
207 private:
208 SAL_DLLPRIVATE void Construct_Impl();
211 SV_DECL_COMPAT_WEAK( SfxFrame )
213 class SfxFrameIterator
215 const SfxFrame* pFrame;
216 sal_Bool bRecursive;
218 SfxFrame* NextSibling_Impl( SfxFrame& rPrev );
220 public:
221 SfxFrameIterator( const SfxFrame& rFrame, sal_Bool bRecursive=sal_True );
222 SfxFrame* FirstFrame();
223 SfxFrame* NextFrame( SfxFrame& rPrev );
226 //--------------------------------------------------------------------
228 class SFX2_DLLPUBLIC SfxFrameItem: public SfxPoolItem
230 SfxFrame* pFrame;
231 SfxFrameWeak wFrame;
232 SAL_DLLPRIVATE void SetFramePtr_Impl( SfxFrame* /*pFrameP*/ ) { pFrame = wFrame; }
234 public:
235 TYPEINFO();
237 SfxFrameItem( sal_uInt16 nWhich, SfxViewFrame *p );
238 SfxFrameItem( SfxFrame *p=0 );
239 SfxFrameItem( sal_uInt16 nWhich, SfxFrame *p );
241 virtual int operator==( const SfxPoolItem& ) const;
242 virtual String GetValueText() const;
243 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
245 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
246 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
248 sal_Bool FrameKilled() const { return &wFrame != pFrame; }
250 SfxFrame* GetFrame() const
251 { return wFrame; }
254 class SFX2_DLLPUBLIC SfxUsrAnyItem : public SfxPoolItem
256 ::com::sun::star::uno::Any aValue;
257 public:
258 TYPEINFO();
259 SfxUsrAnyItem( sal_uInt16 nWhich, const ::com::sun::star::uno::Any& rAny );
260 ::com::sun::star::uno::Any GetValue() const
261 { return aValue; }
262 virtual int operator==( const SfxPoolItem& ) const;
263 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
264 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
265 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
268 class SFX2_DLLPUBLIC SfxUnoFrameItem : public SfxPoolItem
270 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
271 m_xFrame;
273 public:
274 TYPEINFO();
275 SfxUnoFrameItem();
276 SfxUnoFrameItem( sal_uInt16 nWhich, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame );
277 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&
278 GetFrame() const
279 { return m_xFrame; }
280 virtual int operator==( const SfxPoolItem& ) const;
281 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
282 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
283 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
286 typedef SfxUsrAnyItem SfxUnoAnyItem;
288 #endif
290 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */