LibreOffice Module sc (master) 1
stylesfragment.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 <utility>
23
24#include "excelhandlers.hxx"
25#include "stylesbuffer.hxx"
26
27namespace oox::xls {
28
30{
31public:
32 explicit IndexedColorsContext( WorkbookFragmentBase& rFragment );
33
34protected:
35 virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
36 virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) override;
37};
38
40{
41public:
42 template< typename ParentType >
43 explicit FontContext( ParentType& rParent, FontRef xFont ) :
44 WorkbookContextBase( rParent ), mxFont(std::move( xFont )) {}
45
46protected:
47 virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
48
49private:
51};
52
54{
55public:
56 template< typename ParentType >
57 explicit BorderContext( ParentType& rParent, BorderRef xBorder ) :
58 WorkbookContextBase( rParent ), mxBorder(std::move( xBorder )) {}
59
60protected:
61 virtual void onStartElement( const AttributeList& rAttribs ) override;
62 virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
63
64private:
66};
67
69{
70public:
71 template< typename ParentType >
72 explicit FillContext( ParentType& rParent, FillRef xFill ) :
73 WorkbookContextBase( rParent ), mxFill(std::move( xFill )), mfGradPos( -1.0 ) {}
74
75protected:
76 virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
77
78private:
80 double mfGradPos;
81};
82
84{
85public:
86 template< typename ParentType >
87 explicit XfContext( ParentType& rParent, XfRef xXf, bool bCellXf ) :
88 WorkbookContextBase( rParent ), mxXf(std::move( xXf )), mbCellXf( bCellXf ) {}
89
90protected:
91 virtual void onStartElement( const AttributeList& rAttribs ) override;
92 virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
93
94private:
96 bool mbCellXf;
97};
98
100{
101public:
102 template< typename ParentType >
103 explicit DxfContext( ParentType& rParent, const DxfRef& rxDxf ) :
104 WorkbookContextBase( rParent ), mxDxf( rxDxf ), mxExtDxf( rxDxf ) {}
105
106protected:
107 virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
108
109private:
112};
113
115{
116public:
117 explicit StylesFragment(
118 const WorkbookHelper& rHelper,
119 const OUString& rFragmentPath );
120
121protected:
122 virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
123 virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) override;
124
125 virtual const ::oox::core::RecordInfo* getRecordInfos() const override;
126 virtual void finalizeImport() override;
127};
128
129} // namespace oox::xls
130
131/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
BorderContext(ParentType &rParent, BorderRef xBorder)
virtual void onStartElement(const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
DxfContext(ParentType &rParent, const DxfRef &rxDxf)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
FillContext(ParentType &rParent, FillRef xFill)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
FontContext(ParentType &rParent, FontRef xFont)
IndexedColorsContext(WorkbookFragmentBase &rFragment)
virtual ::oox::core::ContextHandlerRef onCreateRecordContext(sal_Int32 nRecId, SequenceInputStream &rStrm) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
StylesFragment(const WorkbookHelper &rHelper, const OUString &rFragmentPath)
virtual void finalizeImport() override
virtual const ::oox::core::RecordInfo * getRecordInfos() const override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateRecordContext(sal_Int32 nRecId, SequenceInputStream &rStrm) override
Context handler derived from the WorkbookHelper helper class.
Fragment handler derived from the WorkbookHelper helper class.
Helper class to provide access to global workbook data.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
XfContext(ParentType &rParent, XfRef xXf, bool bCellXf)
virtual void onStartElement(const AttributeList &rAttribs) override
void SvStream & rStrm
std::shared_ptr< Font > FontRef
std::shared_ptr< Border > BorderRef
std::shared_ptr< Dxf > DxfRef
std::shared_ptr< Fill > FillRef
std::shared_ptr< Xf > XfRef