connectivity: add neutral context parser
[LibreOffice.git] / include / sfx2 / ipclient.hxx
blob3e219514a6f1e980f0eeebe890b372f6e383a102
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/errcode.hxx>
30 #include <vcl/vclptr.hxx>
32 namespace com::sun::star::embed { class XEmbeddedObject; }
33 namespace com::sun::star::uno { template <typename > class Reference; }
34 namespace vcl { class Window; }
36 class SfxInPlaceClient_Impl;
37 class SfxViewShell;
38 class SfxObjectShell;
39 class Fraction;
42 class SFX2_DLLPUBLIC SfxInPlaceClient
44 friend class SfxInPlaceClient_Impl;
46 rtl::Reference<SfxInPlaceClient_Impl> m_xImp;
47 SfxViewShell* m_pViewSh;
48 VclPtr<vcl::Window> m_pEditWin;
50 // called after the requested new object area was negotiated
51 SAL_DLLPRIVATE virtual void ObjectAreaChanged();
53 // an active object was resized by the user and now asks for the new space
54 SAL_DLLPRIVATE virtual void RequestNewObjectArea( tools::Rectangle& );
56 // notify the client that an active object has changed its VisualAreaSize
57 SAL_DLLPRIVATE virtual void ViewChanged();
59 public:
60 SfxInPlaceClient( SfxViewShell* pViewShell, vcl::Window* pDraw, sal_Int64 nAspect );
61 virtual ~SfxInPlaceClient();
63 SfxInPlaceClient(const SfxInPlaceClient &) = delete;
64 SfxInPlaceClient& operator=(const SfxInPlaceClient &) = delete;
66 SfxViewShell* GetViewShell() const { return m_pViewSh; }
67 vcl::Window* GetEditWin() const { return m_pEditWin; }
68 const css::uno::Reference < css::embed::XEmbeddedObject >& GetObject() const;
69 void SetObject( const css::uno::Reference < css::embed::XEmbeddedObject >& rObject );
70 void SetObjectState( sal_Int32 );
71 bool IsObjectUIActive() const;
72 bool IsObjectInPlaceActive() const;
73 void DeactivateObject();
74 bool SetObjArea( const tools::Rectangle & );
75 const tools::Rectangle& GetObjArea() const;
76 tools::Rectangle GetScaledObjArea() const;
77 void SetSizeScale( const Fraction & rScaleWidth, const Fraction & rScaleHeight );
78 void SetObjAreaAndScale( const tools::Rectangle&, const Fraction&, const Fraction& );
79 const Fraction& GetScaleWidth() const;
80 const Fraction& GetScaleHeight() const;
81 void Invalidate();
82 static SfxInPlaceClient* GetClient( SfxObjectShell const * pDoc, const css::uno::Reference < css::embed::XEmbeddedObject >& xObject );
83 sal_Int64 GetAspect() const;
84 sal_Int64 GetObjectMiscStatus() const;
85 ErrCode DoVerb(sal_Int32 nVerb);
86 void VisAreaChanged();
87 void ResetObject();
88 bool IsUIActive() const;
90 virtual void FormatChanged(); // object format was changed (used for StarMath formulas aligning)
92 virtual bool IsProtected() const;
95 #endif
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */