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