LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / sc / source / filter / inc / stylesfragment.hxx
blobbd590f2a61c3714600a5c3a69c65dcc730b78517
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include "excelhandlers.hxx"
23 #include "stylesbuffer.hxx"
25 namespace oox::xls {
27 class IndexedColorsContext : public WorkbookContextBase
29 public:
30 explicit IndexedColorsContext( WorkbookFragmentBase& rFragment );
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;
37 class FontContext : public WorkbookContextBase
39 public:
40 template< typename ParentType >
41 explicit FontContext( ParentType& rParent, const FontRef& rxFont ) :
42 WorkbookContextBase( rParent ), mxFont( rxFont ) {}
44 protected:
45 virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
47 private:
48 FontRef mxFont;
51 class BorderContext : public WorkbookContextBase
53 public:
54 template< typename ParentType >
55 explicit BorderContext( ParentType& rParent, const BorderRef& rxBorder ) :
56 WorkbookContextBase( rParent ), mxBorder( rxBorder ) {}
58 protected:
59 virtual void onStartElement( const AttributeList& rAttribs ) override;
60 virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
62 private:
63 BorderRef mxBorder;
66 class FillContext : public WorkbookContextBase
68 public:
69 template< typename ParentType >
70 explicit FillContext( ParentType& rParent, const FillRef& rxFill ) :
71 WorkbookContextBase( rParent ), mxFill( rxFill ), mfGradPos( -1.0 ) {}
73 protected:
74 virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
76 private:
77 FillRef mxFill;
78 double mfGradPos; /// Gradient color position.
81 class XfContext : public WorkbookContextBase
83 public:
84 template< typename ParentType >
85 explicit XfContext( ParentType& rParent, const XfRef& rxXf, bool bCellXf ) :
86 WorkbookContextBase( rParent ), mxXf( rxXf ), mbCellXf( bCellXf ) {}
88 protected:
89 virtual void onStartElement( const AttributeList& rAttribs ) override;
90 virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
92 private:
93 XfRef mxXf;
94 bool mbCellXf; /// True = cell XF, false = style XF.
97 class DxfContext : public WorkbookContextBase
99 public:
100 template< typename ParentType >
101 explicit DxfContext( ParentType& rParent, const DxfRef& rxDxf ) :
102 WorkbookContextBase( rParent ), mxDxf( rxDxf ), mxExtDxf( rxDxf ) {}
104 protected:
105 virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
107 private:
108 DxfRef mxDxf;
109 DxfRef mxExtDxf;
112 class StylesFragment : public WorkbookFragmentBase
114 public:
115 explicit StylesFragment(
116 const WorkbookHelper& rHelper,
117 const OUString& rFragmentPath );
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;
123 virtual const ::oox::core::RecordInfo* getRecordInfos() const override;
124 virtual void finalizeImport() override;
127 } // namespace oox::xls
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */