LibreOffice Module writerfilter (master) 1
FontTable.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 <memory>
23#include <vector>
24#include "LoggedResources.hxx"
25#include <com/sun/star/io/XInputStream.hpp>
26
28{
29
30struct FontTable_Impl;
31struct FontEntry : public virtual SvRefBase
32{
34
35 OUString sFontName;
36 sal_Int32 nTextEncoding;
38 nTextEncoding( RTL_TEXTENCODING_DONTKNOW )
39 {}
40};
41
43 /*,public BinaryObj*/, public LoggedStream
44{
45 std::unique_ptr<FontTable_Impl> m_pImpl;
46
47 public:
48 FontTable();
49 virtual ~FontTable() override;
50
51 sal_uInt32 size();
52 FontEntry::Pointer_t getFontEntry(sal_uInt32 nIndex);
53
54 void addEmbeddedFont(const css::uno::Reference<css::io::XInputStream>& stream,
55 const OUString& fontName, std::u16string_view extra,
56 std::vector<unsigned char> const & key);
57
58 private:
59 // Properties
60 virtual void lcl_attribute(Id Name, Value & val) override;
61 virtual void lcl_sprm(Sprm & sprm) override;
62 void resolveSprm(Sprm & r_sprm);
63
64 // Table
66
67 // Stream
68 virtual void lcl_startSectionGroup() override;
69 virtual void lcl_endSectionGroup() override;
70 virtual void lcl_startParagraphGroup() override;
71 virtual void lcl_endParagraphGroup() override;
72 virtual void lcl_startCharacterGroup() override;
73 virtual void lcl_endCharacterGroup() override;
74 virtual void lcl_text(const sal_uInt8 * data, size_t len) override;
75 virtual void lcl_utext(const sal_uInt8 * data, size_t len) override;
77 virtual void lcl_table(Id name,
79 virtual void lcl_substream(Id name,
81 virtual void lcl_startShape(css::uno::Reference<css::drawing::XShape> const& xShape) override;
82 virtual void lcl_endShape( ) override;
83 virtual void lcl_startTextBoxContent() override {};
84 virtual void lcl_endTextBoxContent() override {};
85};
87
89{
90public:
91 EmbeddedFontHandler(FontTable& rFontTable, OUString fontName, std::u16string_view style);
92 virtual ~EmbeddedFontHandler() override;
93private:
94 virtual void lcl_attribute( Id name, Value& val ) override;
95 virtual void lcl_sprm( Sprm& rSprm ) override;
97 OUString m_fontName;
98 std::u16string_view m_style;
99 OUString m_fontKey;
100 css::uno::Reference<css::io::XInputStream> m_inputStream;
101};
102
103
104}
105
106/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void sprm(Sprm &sprm) override
Receives a SPRM.
An SPRM: Section, Paragraph and Run Modifier.
EmbeddedFontHandler(FontTable &rFontTable, OUString fontName, std::u16string_view style)
Definition: FontTable.cxx:237
virtual void lcl_sprm(Sprm &rSprm) override
Definition: FontTable.cxx:293
css::uno::Reference< css::io::XInputStream > m_inputStream
Definition: FontTable.hxx:100
virtual void lcl_attribute(Id name, Value &val) override
Definition: FontTable.cxx:272
virtual void lcl_startCharacterGroup() override
Definition: FontTable.cxx:180
virtual ~FontTable() override
Definition: FontTable.cxx:51
virtual void lcl_sprm(Sprm &sprm) override
Definition: FontTable.cxx:100
virtual void lcl_attribute(Id Name, Value &val) override
Definition: FontTable.cxx:55
void addEmbeddedFont(const css::uno::Reference< css::io::XInputStream > &stream, const OUString &fontName, std::u16string_view extra, std::vector< unsigned char > const &key)
Definition: FontTable.cxx:228
virtual void lcl_startParagraphGroup() override
Definition: FontTable.cxx:172
FontEntry::Pointer_t getFontEntry(sal_uInt32 nIndex)
Definition: FontTable.cxx:216
virtual void lcl_startShape(css::uno::Reference< css::drawing::XShape > const &xShape) override
Definition: FontTable.cxx:208
virtual void lcl_props(writerfilter::Reference< Properties >::Pointer_t ref) override
Definition: FontTable.cxx:196
void resolveSprm(Sprm &r_sprm)
Definition: FontTable.cxx:146
std::unique_ptr< FontTable_Impl > m_pImpl
Definition: FontTable.hxx:45
virtual void lcl_text(const sal_uInt8 *data, size_t len) override
Definition: FontTable.cxx:188
virtual void lcl_endSectionGroup() override
Definition: FontTable.cxx:168
virtual void lcl_endParagraphGroup() override
Definition: FontTable.cxx:176
virtual void lcl_endShape() override
Definition: FontTable.cxx:212
virtual void lcl_endCharacterGroup() override
Definition: FontTable.cxx:184
virtual void lcl_table(Id name, writerfilter::Reference< Table >::Pointer_t ref) override
Definition: FontTable.cxx:200
virtual void lcl_endTextBoxContent() override
Definition: FontTable.hxx:84
virtual void lcl_entry(writerfilter::Reference< Properties >::Pointer_t ref) override
Definition: FontTable.cxx:153
virtual void lcl_startSectionGroup() override
Definition: FontTable.cxx:164
virtual void lcl_utext(const sal_uInt8 *data, size_t len) override
Definition: FontTable.cxx:192
virtual void lcl_substream(Id name, ::writerfilter::Reference< Stream >::Pointer_t ref) override
Definition: FontTable.cxx:204
virtual void lcl_startTextBoxContent() override
Definition: FontTable.hxx:83
const char * name
tools::SvRef< FontTable > FontTablePtr
Definition: FontTable.hxx:86
sal_uInt32 Id
tools::SvRef< FontEntry > Pointer_t
Definition: FontTable.hxx:33
unsigned char sal_uInt8