LibreOffice Module sc (master)  1
externallinkfragment.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 "excelhandlers.hxx"
23 #include "externallinkbuffer.hxx"
24 
25 namespace oox::xls {
26 
33 {
34 public:
35  explicit ExternalSheetDataContext(
36  WorkbookFragmentBase& rFragment,
37  const css::uno::Reference< css::sheet::XExternalSheetCache >& rxSheetCache );
38 
39 protected:
40  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
41  virtual void onCharacters( const OUString& rChars ) override;
42 
43  virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) override;
44 
45 private:
47  void importCell( const AttributeList& rAttribs );
48 
59 
61  void setCellValue( const css::uno::Any& rValue );
62 
63 private:
64  css::uno::Reference< css::sheet::XExternalSheetCache >
67  sal_Int32 mnCurrType;
68 };
69 
71 {
72 public:
73  explicit ExternalLinkFragment(
74  const WorkbookHelper& rHelper,
75  const OUString& rFragmentPath,
76  ExternalLink& rExtLink );
77 
78 protected:
79  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
80  virtual void onCharacters( const OUString& rChars ) override;
81  virtual void onEndElement() override;
82 
83  virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) override;
84 
85  virtual const ::oox::core::RecordInfo* getRecordInfos() const override;
86 
87 private:
89 
90 private:
93  OUString maResultValue;
94  sal_Int32 mnResultType;
95 };
96 
97 } // namespace oox::xls
98 
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Helper class to provide access to global workbook data.
ExternalLinkFragment(const WorkbookHelper &rHelper, const OUString &rFragmentPath, ExternalLink &rExtLink)
void importExtCellString(SequenceInputStream &rStrm)
Imports the EXTCELL_STRING from the passed stream.
virtual void onEndElement() override
sal_Int32 mnCurrType
Position of current cell.
virtual void onCharacters(const OUString &rChars) override
virtual void onCharacters(const OUString &rChars) override
void setCellValue(const css::uno::Any &rValue)
Sets the passed cell value to the current position in the sheet cache.
::oox::core::ContextHandlerRef createSheetDataContext(sal_Int32 nSheetId)
void importExtCellDouble(SequenceInputStream &rStrm)
Imports the EXTCELL_DOUBLE from the passed stream.
ScAddress maCurrPos
The sheet cache used to store external cell values.
virtual ::oox::core::ContextHandlerRef onCreateRecordContext(sal_Int32 nRecId, SequenceInputStream &rStrm) override
Fragment handler derived from the WorkbookHelper helper class.
void importExtCellBlank(SequenceInputStream &rStrm)
Imports the EXTCELL_BLANK from the passed stream.
void importCell(const AttributeList &rAttribs)
Imports cell settings from a c element.
virtual const ::oox::core::RecordInfo * getRecordInfos() const override
ExternalSheetDataContext(WorkbookFragmentBase &rFragment, const css::uno::Reference< css::sheet::XExternalSheetCache > &rxSheetCache)
Context handler derived from the WorkbookHelper helper class.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateRecordContext(sal_Int32 nRecId, SequenceInputStream &rStrm) override
void importExtCellError(SequenceInputStream &rStrm)
Imports the EXTCELL_ERROR from the passed stream.
css::uno::Reference< css::sheet::XExternalSheetCache > mxSheetCache
This class implements importing the sheetData element in external sheets.
void importExtCellBool(SequenceInputStream &rStrm)
Imports the EXTCELL_BOOL from the passed stream.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
void SvStream & rStrm
std::shared_ptr< ExternalName > ExternalNameRef