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