LibreOffice Module vcl (master)  1
fontcharmap.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 #ifndef INCLUDED_FONTCHARMAP_HXX
21 #define INCLUDED_FONTCHARMAP_HXX
22 
23 #include <vcl/dllapi.h>
24 #include <tools/ref.hxx>
25 
26 class ImplFontCharMap;
27 class CmapResult;
28 class FontCharMap;
30 
31 typedef sal_uInt32 sal_UCS4;
34 
36 {
37 public:
41  FontCharMap();
42  FontCharMap( const CmapResult& rCR );
43  virtual ~FontCharMap() override;
44 
49  static FontCharMapRef GetDefaultMap( bool bSymbols );
50 
56  bool IsDefaultMap() const;
57 
62  bool HasChar( sal_UCS4 ) const;
63 
73  int CountCharsInRange( sal_UCS4 cMin, sal_UCS4 cMax ) const;
74 
79  int GetCharCount() const;
80 
85  sal_UCS4 GetFirstChar() const;
86 
91  sal_UCS4 GetLastChar() const;
92 
101  sal_UCS4 GetNextChar( sal_UCS4 cChar ) const;
102 
111  sal_UCS4 GetPrevChar( sal_UCS4 cChar ) const;
112 
122  int GetIndexFromChar( sal_UCS4 cChar ) const;
123 
133  sal_UCS4 GetCharFromIndex( int nCharIndex ) const;
134 
135  int GetGlyphIndex( sal_UCS4 ) const;
136 
137 private:
139 
140  friend class ::OutputDevice;
141 
142  int findRangeIndex( sal_UCS4 ) const;
143 
144  FontCharMap( ImplFontCharMapRef const & pIFCMap );
145 
146  // prevent assignment and copy construction
147  FontCharMap( const FontCharMap& ) = delete;
148  void operator=( const FontCharMap& ) = delete;
149 };
150 
151 // CmapResult is a normalized version of the many CMAP formats
153 {
154 public:
155  explicit CmapResult( bool bSymbolic = false,
156  const sal_UCS4* pRangeCodes = nullptr, int nRangeCount = 0 );
157 
159  const int* mpStartGlyphs;
160  const sal_uInt16* mpGlyphIds;
163  bool mbRecoded;
164 };
165 
166 #endif // INCLUDED_FONTCHARMAP_HXX
167 
168 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools::SvRef< FontCharMap > FontCharMapRef
Definition: fontcharmap.hxx:33
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
ImplFontCharMapRef mpImplFontCharMap
const sal_uInt16 * mpGlyphIds
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:304
const sal_UCS4 * mpRangeCodes
tools::SvRef< ImplFontCharMap > ImplFontCharMapRef
Definition: fontcharmap.hxx:32
#define VCL_PLUGIN_PUBLIC
Definition: dllapi.h:40
SvRefBase & operator=(const SvRefBase &)
sal_uInt32 sal_UCS4
Definition: fontcharmap.hxx:29
const int * mpStartGlyphs