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 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_EXTERNALLINKFRAGMENT_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_EXTERNALLINKFRAGMENT_HXX
22 
23 #include "excelhandlers.hxx"
24 #include "externallinkbuffer.hxx"
25 
26 namespace oox::xls {
27 
34 {
35 public:
36  explicit ExternalSheetDataContext(
37  WorkbookFragmentBase& rFragment,
38  const css::uno::Reference< css::sheet::XExternalSheetCache >& rxSheetCache );
39 
40 protected:
41  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
42  virtual void onCharacters( const OUString& rChars ) override;
43 
44  virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) override;
45 
46 private:
48  void importCell( const AttributeList& rAttribs );
49 
60 
62  void setCellValue( const css::uno::Any& rValue );
63 
64 private:
65  css::uno::Reference< css::sheet::XExternalSheetCache >
68  sal_Int32 mnCurrType;
69 };
70 
72 {
73 public:
74  explicit ExternalLinkFragment(
75  const WorkbookHelper& rHelper,
76  const OUString& rFragmentPath,
77  ExternalLink& rExtLink );
78 
79 protected:
80  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
81  virtual void onCharacters( const OUString& rChars ) override;
82  virtual void onEndElement() override;
83 
84  virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) override;
85 
86  virtual const ::oox::core::RecordInfo* getRecordInfos() const override;
87 
88 private:
90 
91 private:
94  OUString maResultValue;
95  sal_Int32 mnResultType;
96 };
97 
98 } // namespace oox::xls
99 
100 #endif
101 
102 /* 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
css::uno::Any const & rValue
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