LibreOffice Module sc (master) 1
xcl97esc.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
20#pragma once
21
22#include <memory>
23#include <optional>
24#include <stack>
26#include "xeroot.hxx"
27#include <unotools/tempfile.hxx>
28
29namespace com::sun::star::awt { class XControlModel; }
30
32{
33public:
34 explicit XclEscherExGlobal( const XclExpRoot& rRoot );
35
36private:
38 virtual SvStream* ImplQueryPictureStream() override;
39
40private:
41 ::std::optional< ::utl::TempFileFast > moPicTempFile;
43};
44
45class XclObj;
52class XclExpShapeObj;
54{
55public:
56 static XclExpShapeObj* CreateShapeObj( XclExpObjectManager& rObjMgr, const css::uno::Reference<
57 css::drawing::XShape >& xShape, ScDocument* pDoc );
58 static void PopulateShapeInteractionInfo( const XclExpObjectManager& rObjMgr, const css::uno::Reference< css::drawing::XShape >& xShape, EscherExHostAppData& rHostAppData );
59};
60
61class XclEscherEx : public EscherEx, protected XclExpRoot
62{
63public:
64 explicit XclEscherEx(
65 const XclExpRoot& rRoot,
66 XclExpObjectManager& rObjMgr,
68 const XclEscherEx* pParent = nullptr );
69 virtual ~XclEscherEx() override;
70
73 sal_uInt32 InitNextDffFragment();
77
79 sal_uInt32 GetDffFragmentPos( sal_uInt32 nFragmentKey );
81 sal_uInt32 GetDffFragmentSize( sal_uInt32 nFragmentKey );
84 bool HasPendingDffData();
85
88 XclExpDffAnchorBase* CreateDffAnchor( const SdrObject& rSdrObj ) const;
89
91 const css::uno::Reference< css::drawing::XShape>& rxShape,
92 const tools::Rectangle* pChildAnchor ) override;
93 virtual void EndShape( sal_uInt16 nShapeType, sal_uInt32 nShapeID ) override;
95
97 void EndDocument();
100 std::unique_ptr<XclExpOcxControlObj> CreateOCXCtrlObj(
101 css::uno::Reference< css::drawing::XShape > const & xShape,
102 const tools::Rectangle* pChildAnchor );
103
104private:
107 std::unique_ptr<XclExpTbxControlObj> CreateTBXCtrlObj(
108 css::uno::Reference< css::drawing::XShape > const & xShape,
109 const tools::Rectangle* pChildAnchor );
110
111private:
113 void ConvertTbxMacro(
114 XclExpTbxControlObj& rTbxCtrlObj,
115 css::uno::Reference< css::awt::XControlModel > const & xCtrlModel );
116
117 void DeleteCurrAppData();
118
119private:
121 std::stack< std::pair< XclObj*, std::unique_ptr<XclEscherHostAppData> > > aStack;
123 std::unique_ptr<XclEscherHostAppData> pCurrAppData;
124 std::unique_ptr<XclEscherClientData> pTheClientData; // always the same
126 sal_uInt16 nAdditionalText;
127 sal_uInt32 mnNextKey;
129};
130
131// --- class XclEscherHostAppData ------------------------------------
132
134{
135private:
137
138public:
140 {}
141 void SetStackedGroup( bool b ) { bStackedGroup = b; }
142 bool IsStackedGroup() const { return bStackedGroup; }
143};
144
145// --- class XclEscherClientData -------------------------------------
146
148{
149public:
151 virtual void WriteData( EscherEx& rEx ) const override;
152};
153
154// --- class XclEscherClientTextbox ----------------------------------
155
156class SdrTextObj;
157
159{
160private:
163
164public:
166 const XclExpRoot& rRoot,
167 const SdrTextObj& rObj,
168 XclObj* pObj );
169
171 void SetXclObj( XclObj* p ) { pXclObj = p; }
172
173 virtual void WriteData( EscherEx& rEx ) const override;
174};
175
176/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static void PopulateShapeInteractionInfo(const XclExpObjectManager &rObjMgr, const css::uno::Reference< css::drawing::XShape > &xShape, EscherExHostAppData &rHostAppData)
Definition: xcl97esc.cxx:537
static XclExpShapeObj * CreateShapeObj(XclExpObjectManager &rObjMgr, const css::uno::Reference< css::drawing::XShape > &xShape, ScDocument *pDoc)
Definition: xcl97esc.cxx:532
virtual void WriteData(EscherEx &rEx) const override
Definition: xcl97esc.cxx:510
virtual void WriteData(EscherEx &rEx) const override
Definition: xcl97esc.cxx:526
void SetXclObj(XclObj *p)
ONLY for the AdditionalText mimic.
Definition: xcl97esc.hxx:171
XclEscherClientTextbox(const XclExpRoot &rRoot, const SdrTextObj &rObj, XclObj *pObj)
Definition: xcl97esc.cxx:517
const SdrTextObj & rTextObj
Definition: xcl97esc.hxx:161
virtual SvStream * ImplQueryPictureStream() override
Override to create a new temporary file and return its stream.
Definition: xcl97esc.cxx:76
::std::optional< ::utl::TempFileFast > moPicTempFile
Definition: xcl97esc.hxx:41
SvStream * mpPicStrm
Definition: xcl97esc.hxx:42
XclEscherExGlobal(const XclExpRoot &rRoot)
Definition: xcl97esc.cxx:69
bool HasPendingDffData()
Returns true, if there is more data left in the DFF stream than owned by the last MSODRAWING record.
Definition: xcl97esc.cxx:144
std::unique_ptr< XclEscherClientData > pTheClientData
Definition: xcl97esc.hxx:124
virtual void EndShape(sal_uInt16 nShapeType, sal_uInt32 nShapeID) override
Definition: xcl97esc.cxx:335
XclEscherEx(const XclExpRoot &rRoot, XclExpObjectManager &rObjMgr, SvStream &rStrm, const XclEscherEx *pParent=nullptr)
Definition: xcl97esc.cxx:84
sal_uInt32 InitNextDffFragment()
Called by MSODRAWING record constructors to initialize the DFF stream fragment they will own.
Definition: xcl97esc.cxx:105
std::unique_ptr< XclEscherHostAppData > pCurrAppData
Definition: xcl97esc.hxx:123
std::unique_ptr< XclExpOcxControlObj > CreateOCXCtrlObj(css::uno::Reference< css::drawing::XShape > const &xShape, const tools::Rectangle *pChildAnchor)
Creates an OCX form control OBJ record from the passed form control.
Definition: xcl97esc.cxx:398
virtual ~XclEscherEx() override
Definition: xcl97esc.cxx:98
sal_uInt32 GetDffFragmentPos(sal_uInt32 nFragmentKey)
Returns the position of the specified DFF stream fragment.
Definition: xcl97esc.cxx:130
XclObj * pCurrXclObj
Definition: xcl97esc.hxx:122
std::stack< std::pair< XclObj *, std::unique_ptr< XclEscherHostAppData > > > aStack
Definition: xcl97esc.hxx:121
sal_uInt32 GetDffFragmentSize(sal_uInt32 nFragmentKey)
Returns the size of the specified DFF stream fragment.
Definition: xcl97esc.cxx:137
virtual EscherExHostAppData * StartShape(const css::uno::Reference< css::drawing::XShape > &rxShape, const tools::Rectangle *pChildAnchor) override
Definition: xcl97esc.cxx:178
void EndDocument()
Flush and merge PicStream into EscherStream.
Definition: xcl97esc.cxx:389
void DeleteCurrAppData()
Definition: xcl97esc.cxx:497
void UpdateDffFragmentEnd()
Called after some data has been written to the DFF stream, to update the end position of the DFF frag...
Definition: xcl97esc.cxx:124
sal_uInt32 mnNextKey
Definition: xcl97esc.hxx:127
bool mbIsRootDff
Definition: xcl97esc.hxx:128
std::unique_ptr< XclExpTbxControlObj > CreateTBXCtrlObj(css::uno::Reference< css::drawing::XShape > const &xShape, const tools::Rectangle *pChildAnchor)
The 'Ctls' stream.
Definition: xcl97esc.cxx:428
XclExpObjectManager & mrObjMgr
Definition: xcl97esc.hxx:120
sal_uInt16 nAdditionalText
Definition: xcl97esc.hxx:126
XclEscherClientTextbox * pAdditionalText
Definition: xcl97esc.hxx:125
void ConvertTbxMacro(XclExpTbxControlObj &rTbxCtrlObj, css::uno::Reference< css::awt::XControlModel > const &xCtrlModel)
Tries to get the name of a Basic macro from a control.
Definition: xcl97esc.cxx:442
XclExpDffAnchorBase * CreateDffAnchor(const SdrObject &rSdrObj) const
Creates a new DFF client anchor object and calculates the anchor position of the passed object.
Definition: xcl97esc.cxx:151
tools::SvRef< SotStorageStream > mxCtlsStrm
Definition: xcl97esc.hxx:105
virtual EscherExHostAppData * EnterAdditionalTextGroup() override
Definition: xcl97esc.cxx:381
bool IsStackedGroup() const
Definition: xcl97esc.hxx:142
void SetStackedGroup(bool b)
Definition: xcl97esc.hxx:141
Base class for DFF client anchor atoms used in spreadsheets.
Definition: xeescher.hxx:43
Represents an OBJ record for an OCX form control.
Definition: xeescher.hxx:229
Access to global data from other classes.
Definition: xeroot.hxx:113
Represents an OBJ record for a TBX form control.
Definition: xeescher.hxx:251
void * p
void SvStream & rStrm