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 <stack>
25#include "xeroot.hxx"
26#include <unotools/tempfile.hxx>
27
28namespace com::sun::star::awt { class XControlModel; }
29
31{
32public:
33 explicit XclEscherExGlobal( const XclExpRoot& rRoot );
34
35private:
37 virtual SvStream* ImplQueryPictureStream() override;
38
39private:
40 ::std::unique_ptr< ::utl::TempFileFast > mxPicTempFile;
42};
43
44class XclObj;
51class XclExpShapeObj;
53{
54public:
55 static XclExpShapeObj* CreateShapeObj( XclExpObjectManager& rObjMgr, const css::uno::Reference<
56 css::drawing::XShape >& xShape, ScDocument* pDoc );
57 static void PopulateShapeInteractionInfo( const XclExpObjectManager& rObjMgr, const css::uno::Reference< css::drawing::XShape >& xShape, EscherExHostAppData& rHostAppData );
58};
59
60class XclEscherEx : public EscherEx, protected XclExpRoot
61{
62public:
63 explicit XclEscherEx(
64 const XclExpRoot& rRoot,
65 XclExpObjectManager& rObjMgr,
67 const XclEscherEx* pParent = nullptr );
68 virtual ~XclEscherEx() override;
69
72 sal_uInt32 InitNextDffFragment();
76
78 sal_uInt32 GetDffFragmentPos( sal_uInt32 nFragmentKey );
80 sal_uInt32 GetDffFragmentSize( sal_uInt32 nFragmentKey );
83 bool HasPendingDffData();
84
87 XclExpDffAnchorBase* CreateDffAnchor( const SdrObject& rSdrObj ) const;
88
90 const css::uno::Reference< css::drawing::XShape>& rxShape,
91 const tools::Rectangle* pChildAnchor ) override;
92 virtual void EndShape( sal_uInt16 nShapeType, sal_uInt32 nShapeID ) override;
94
96 void EndDocument();
99 std::unique_ptr<XclExpOcxControlObj> CreateOCXCtrlObj(
100 css::uno::Reference< css::drawing::XShape > const & xShape,
101 const tools::Rectangle* pChildAnchor );
102
103private:
106 std::unique_ptr<XclExpTbxControlObj> CreateTBXCtrlObj(
107 css::uno::Reference< css::drawing::XShape > const & xShape,
108 const tools::Rectangle* pChildAnchor );
109
110private:
112 void ConvertTbxMacro(
113 XclExpTbxControlObj& rTbxCtrlObj,
114 css::uno::Reference< css::awt::XControlModel > const & xCtrlModel );
115
116 void DeleteCurrAppData();
117
118private:
120 std::stack< std::pair< XclObj*, std::unique_ptr<XclEscherHostAppData> > > aStack;
122 std::unique_ptr<XclEscherHostAppData> pCurrAppData;
123 std::unique_ptr<XclEscherClientData> pTheClientData; // always the same
125 sal_uInt16 nAdditionalText;
126 sal_uInt32 mnNextKey;
128};
129
130// --- class XclEscherHostAppData ------------------------------------
131
133{
134private:
136
137public:
139 {}
140 void SetStackedGroup( bool b ) { bStackedGroup = b; }
141 bool IsStackedGroup() const { return bStackedGroup; }
142};
143
144// --- class XclEscherClientData -------------------------------------
145
147{
148public:
150 virtual void WriteData( EscherEx& rEx ) const override;
151};
152
153// --- class XclEscherClientTextbox ----------------------------------
154
155class SdrTextObj;
156
158{
159private:
162
163public:
165 const XclExpRoot& rRoot,
166 const SdrTextObj& rObj,
167 XclObj* pObj );
168
170 void SetXclObj( XclObj* p ) { pXclObj = p; }
171
172 virtual void WriteData( EscherEx& rEx ) const override;
173};
174
175/* 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:170
XclEscherClientTextbox(const XclExpRoot &rRoot, const SdrTextObj &rObj, XclObj *pObj)
Definition: xcl97esc.cxx:517
const SdrTextObj & rTextObj
Definition: xcl97esc.hxx:160
virtual SvStream * ImplQueryPictureStream() override
Override to create a new temporary file and return its stream.
Definition: xcl97esc.cxx:76
::std::unique_ptr< ::utl::TempFileFast > mxPicTempFile
Definition: xcl97esc.hxx:40
SvStream * mpPicStrm
Definition: xcl97esc.hxx:41
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:123
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:122
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:121
std::stack< std::pair< XclObj *, std::unique_ptr< XclEscherHostAppData > > > aStack
Definition: xcl97esc.hxx:120
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:126
bool mbIsRootDff
Definition: xcl97esc.hxx:127
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:119
sal_uInt16 nAdditionalText
Definition: xcl97esc.hxx:125
XclEscherClientTextbox * pAdditionalText
Definition: xcl97esc.hxx:124
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:104
virtual EscherExHostAppData * EnterAdditionalTextGroup() override
Definition: xcl97esc.cxx:381
bool IsStackedGroup() const
Definition: xcl97esc.hxx:141
void SetStackedGroup(bool b)
Definition: xcl97esc.hxx:140
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