1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_FONTTABLE_HXX
25 #define INCLUDED_FONTTABLE_HXX
26 
27 #include <boost/shared_ptr.hpp>
28 #include <WriterFilterDllApi.hxx>
29 #include <resourcemodel/LoggedResources.hxx>
30 #include <com/sun/star/lang/XComponent.hpp>
31 
32 namespace writerfilter {
33 namespace dmapper
34 {
35 
36 struct FontTable_Impl;
37 struct FontEntry
38 {
39     typedef boost::shared_ptr<FontEntry> Pointer_t;
40 
41     ::rtl::OUString sFontName;
42     ::rtl::OUString sFontName1;
43     bool            bTrueType;
44     sal_Int16       nPitchRequest;
45     sal_Int32       nTextEncoding;
46     sal_Int32       nFontFamilyId;
47     sal_Int32       nBaseWeight;
48     sal_Int32       nAltFontIndex;
49     ::rtl::OUString sPanose;
50     ::rtl::OUString sFontSignature;
51     ::rtl::OUString sAlternativeFont;
FontEntrywriterfilter::dmapper::FontEntry52     FontEntry() :
53         bTrueType(false),
54         nPitchRequest( 0 ),
55         nTextEncoding( 0 ),
56         nFontFamilyId( 0 ),
57         nBaseWeight( 0 ),
58         nAltFontIndex( 0 )
59         {}
60 };
61 
62 class WRITERFILTER_DLLPRIVATE FontTable : public LoggedProperties, public LoggedTable
63     /*,public BinaryObj*/, public LoggedStream
64 {
65     FontTable_Impl   *m_pImpl;
66 
67  public:
68     FontTable();
69     virtual ~FontTable();
70 
71     sal_uInt32          size();
72     const FontEntry::Pointer_t  getFontEntry(sal_uInt32 nIndex);
73 
74  private:
75     // Properties
76     virtual void lcl_attribute(Id Name, Value & val);
77     virtual void lcl_sprm(Sprm & sprm);
78 
79     // Table
80     virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
81 
82     // Stream
83     virtual void lcl_startSectionGroup();
84     virtual void lcl_endSectionGroup();
85     virtual void lcl_startParagraphGroup();
86     virtual void lcl_endParagraphGroup();
87     virtual void lcl_startCharacterGroup();
88     virtual void lcl_endCharacterGroup();
89     virtual void lcl_text(const sal_uInt8 * data, size_t len);
90     virtual void lcl_utext(const sal_uInt8 * data, size_t len);
91     virtual void lcl_props(writerfilter::Reference<Properties>::Pointer_t ref);
92     virtual void lcl_table(Id name,
93                            writerfilter::Reference<Table>::Pointer_t ref);
94     virtual void lcl_substream(Id name,
95                                ::writerfilter::Reference<Stream>::Pointer_t ref);
96     virtual void lcl_info(const string & info);
97     virtual void lcl_startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
98     virtual void lcl_endShape( );
99 
100 };
101 typedef boost::shared_ptr< FontTable >          FontTablePtr;
102 }}
103 
104 #endif //
105