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 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_STYLESFRAGMENT_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_STYLESFRAGMENT_HXX
22 
23 #include "excelhandlers.hxx"
24 #include "stylesbuffer.hxx"
25 
26 namespace oox::xls {
27 
29 {
30 public:
31  explicit IndexedColorsContext( WorkbookFragmentBase& rFragment );
32 
33 protected:
34  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
35  virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) override;
36 };
37 
39 {
40 public:
41  template< typename ParentType >
42  explicit FontContext( ParentType& rParent, const FontRef& rxFont ) :
43  WorkbookContextBase( rParent ), mxFont( rxFont ) {}
44 
45 protected:
46  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
47 
48 private:
50 };
51 
53 {
54 public:
55  template< typename ParentType >
56  explicit BorderContext( ParentType& rParent, const BorderRef& rxBorder ) :
57  WorkbookContextBase( rParent ), mxBorder( rxBorder ) {}
58 
59 protected:
60  virtual void onStartElement( const AttributeList& rAttribs ) override;
61  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
62 
63 private:
65 };
66 
68 {
69 public:
70  template< typename ParentType >
71  explicit FillContext( ParentType& rParent, const FillRef& rxFill ) :
72  WorkbookContextBase( rParent ), mxFill( rxFill ), mfGradPos( -1.0 ) {}
73 
74 protected:
75  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
76 
77 private:
79  double mfGradPos;
80 };
81 
83 {
84 public:
85  template< typename ParentType >
86  explicit XfContext( ParentType& rParent, const XfRef& rxXf, bool bCellXf ) :
87  WorkbookContextBase( rParent ), mxXf( rxXf ), mbCellXf( bCellXf ) {}
88 
89 protected:
90  virtual void onStartElement( const AttributeList& rAttribs ) override;
91  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
92 
93 private:
95  bool mbCellXf;
96 };
97 
99 {
100 public:
101  template< typename ParentType >
102  explicit DxfContext( ParentType& rParent, const DxfRef& rxDxf ) :
103  WorkbookContextBase( rParent ), mxDxf( rxDxf ), mxExtDxf( rxDxf ) {}
104 
105 protected:
106  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
107 
108 private:
111 };
112 
114 {
115 public:
116  explicit StylesFragment(
117  const WorkbookHelper& rHelper,
118  const OUString& rFragmentPath );
119 
120 protected:
121  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
122  virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) override;
123 
124  virtual const ::oox::core::RecordInfo* getRecordInfos() const override;
125  virtual void finalizeImport() override;
126 };
127 
128 } // namespace oox::xls
129 
130 #endif
131 
132 /* 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)