lok: calc - send other views our selection in their co-ordinates.
[LibreOffice.git] / include / sfx2 / ipclient.hxx
blob62c421c3c7832b1280c11eec99908d8993681faa
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_IPCLIENT_HXX
20 #define INCLUDED_SFX2_IPCLIENT_HXX
22 #include <sal/config.h>
23 #include <sfx2/dllapi.h>
24 #include <sal/types.h>
25 #include <rtl/ref.hxx>
27 #include <tools/gen.hxx>
29 #include <vcl/window.hxx>
30 #include <vcl/errcode.hxx>
32 namespace com::sun::star::embed { class XEmbeddedObject; }
33 namespace com::sun::star::uno { template <typename > class Reference; }
35 class SfxInPlaceClient_Impl;
36 class SfxViewShell;
37 class SfxObjectShell;
38 class Fraction;
41 class SFX2_DLLPUBLIC SfxInPlaceClient
43 friend class SfxInPlaceClient_Impl;
45 rtl::Reference<SfxInPlaceClient_Impl> m_xImp;
46 SfxViewShell* m_pViewSh;
47 VclPtr<vcl::Window> m_pEditWin;
49 // called after the requested new object area was negotiated
50 SAL_DLLPRIVATE virtual void ObjectAreaChanged();
52 // an active object was resized by the user and now asks for the new space
53 SAL_DLLPRIVATE virtual void RequestNewObjectArea( tools::Rectangle& );
55 // notify the client that an active object has changed its VisualAreaSize
56 SAL_DLLPRIVATE virtual void ViewChanged();
58 public:
59 SfxInPlaceClient( SfxViewShell* pViewShell, vcl::Window* pDraw, sal_Int64 nAspect );
60 virtual ~SfxInPlaceClient();
62 SfxInPlaceClient(const SfxInPlaceClient &) = delete;
63 SfxInPlaceClient& operator=(const SfxInPlaceClient &) = delete;
65 SfxViewShell* GetViewShell() const { return m_pViewSh; }
66 vcl::Window* GetEditWin() const { return m_pEditWin; }
67 const css::uno::Reference < css::embed::XEmbeddedObject >& GetObject() const;
68 void SetObject( const css::uno::Reference < css::embed::XEmbeddedObject >& rObject );
69 void SetObjectState( sal_Int32 );
70 bool IsObjectUIActive() const;
71 bool IsObjectInPlaceActive() const;
72 void DeactivateObject();
73 bool SetObjArea( const tools::Rectangle & );
74 const tools::Rectangle& GetObjArea() const;
75 tools::Rectangle GetScaledObjArea() const;
76 void SetSizeScale( const Fraction & rScaleWidth, const Fraction & rScaleHeight );
77 void SetObjAreaAndScale( const tools::Rectangle&, const Fraction&, const Fraction& );
78 const Fraction& GetScaleWidth() const;
79 const Fraction& GetScaleHeight() const;
80 void Invalidate();
81 static SfxInPlaceClient* GetClient( SfxObjectShell const * pDoc, const css::uno::Reference < css::embed::XEmbeddedObject >& xObject );
82 sal_Int64 GetAspect() const;
83 sal_Int64 GetObjectMiscStatus() const;
84 ErrCode DoVerb( long nVerb );
85 void VisAreaChanged();
86 void ResetObject();
87 bool IsUIActive() const;
89 virtual void FormatChanged(); // object format was changed (used for StarMath formulas aligning)
92 #endif
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */