Line data Source code
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_WRITERFILTER_SOURCE_DMAPPER_FONTTABLE_HXX
21 : #define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FONTTABLE_HXX
22 :
23 : #include <memory>
24 : #include "LoggedResources.hxx"
25 : #include <com/sun/star/lang/XComponent.hpp>
26 : #include <com/sun/star/io/XInputStream.hpp>
27 :
28 : namespace writerfilter {
29 : namespace dmapper
30 : {
31 :
32 : struct FontTable_Impl;
33 12691 : struct FontEntry
34 : {
35 : typedef std::shared_ptr<FontEntry> Pointer_t;
36 :
37 : OUString sFontName;
38 : OUString sFontName1;
39 : bool bTrueType;
40 : sal_Int16 nPitchRequest;
41 : sal_Int32 nTextEncoding;
42 : sal_Int32 nFontFamilyId;
43 : sal_Int32 nBaseWeight;
44 : sal_Int32 nAltFontIndex;
45 : OUString sFontSignature;
46 12691 : FontEntry() :
47 : bTrueType(false),
48 : nPitchRequest( 0 ),
49 : nTextEncoding( RTL_TEXTENCODING_DONTKNOW ),
50 : nFontFamilyId( 0 ),
51 : nBaseWeight( 0 ),
52 12691 : nAltFontIndex( 0 )
53 12691 : {}
54 : };
55 :
56 : class FontTable : public LoggedProperties, public LoggedTable
57 : /*,public BinaryObj*/, public LoggedStream
58 : {
59 : FontTable_Impl *m_pImpl;
60 :
61 : public:
62 : FontTable();
63 : virtual ~FontTable();
64 :
65 : sal_uInt32 size();
66 : const FontEntry::Pointer_t getFontEntry(sal_uInt32 nIndex);
67 :
68 : private:
69 : // Properties
70 : virtual void lcl_attribute(Id Name, Value & val) SAL_OVERRIDE;
71 : virtual void lcl_sprm(Sprm & sprm) SAL_OVERRIDE;
72 : void resolveSprm(Sprm & r_sprm);
73 :
74 : // Table
75 : virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref) SAL_OVERRIDE;
76 :
77 : // Stream
78 : virtual void lcl_startSectionGroup() SAL_OVERRIDE;
79 : virtual void lcl_endSectionGroup() SAL_OVERRIDE;
80 : virtual void lcl_startParagraphGroup() SAL_OVERRIDE;
81 : virtual void lcl_endParagraphGroup() SAL_OVERRIDE;
82 : virtual void lcl_startCharacterGroup() SAL_OVERRIDE;
83 : virtual void lcl_endCharacterGroup() SAL_OVERRIDE;
84 : virtual void lcl_text(const sal_uInt8 * data, size_t len) SAL_OVERRIDE;
85 : virtual void lcl_utext(const sal_uInt8 * data, size_t len) SAL_OVERRIDE;
86 : virtual void lcl_props(writerfilter::Reference<Properties>::Pointer_t ref) SAL_OVERRIDE;
87 : virtual void lcl_table(Id name,
88 : writerfilter::Reference<Table>::Pointer_t ref) SAL_OVERRIDE;
89 : virtual void lcl_substream(Id name,
90 : ::writerfilter::Reference<Stream>::Pointer_t ref) SAL_OVERRIDE;
91 : virtual void lcl_info(const std::string & info) SAL_OVERRIDE;
92 : virtual void lcl_startShape(css::uno::Reference<css::drawing::XShape> const& xShape) SAL_OVERRIDE;
93 : virtual void lcl_endShape( ) SAL_OVERRIDE;
94 :
95 : };
96 : typedef std::shared_ptr< FontTable > FontTablePtr;
97 :
98 : class EmbeddedFontHandler : public LoggedProperties
99 : {
100 : public:
101 : EmbeddedFontHandler( const OUString& fontName, const char* style );
102 : virtual ~EmbeddedFontHandler();
103 : private:
104 : virtual void lcl_attribute( Id name, Value& val ) SAL_OVERRIDE;
105 : virtual void lcl_sprm( Sprm& rSprm ) SAL_OVERRIDE;
106 : OUString fontName;
107 : const char* const style;
108 : OUString id;
109 : OUString fontKey;
110 : css::uno::Reference<css::io::XInputStream> inputStream;
111 : };
112 :
113 :
114 : }}
115 :
116 : #endif
117 :
118 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|