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 <vcl/vclenum.hxx>
25 #include <tools/ref.hxx>
26 
27 class ImplFontCharMap;
28 class CmapResult;
29 class FontCharMap;
31 
34 
36 {
37 public:
41  FontCharMap();
42 
45  FontCharMap( const CmapResult& rCR );
46 
47  virtual ~FontCharMap() override;
48 
53  static FontCharMapRef GetDefaultMap( bool bSymbols );
54 
60  bool IsDefaultMap() const;
61 
66  bool HasChar( sal_UCS4 ) const;
67 
77  int CountCharsInRange( sal_UCS4 cMin, sal_UCS4 cMax ) const;
78 
83  int GetCharCount() const;
84 
89  sal_UCS4 GetFirstChar() const;
90 
95  sal_UCS4 GetLastChar() const;
96 
105  sal_UCS4 GetNextChar( sal_UCS4 cChar ) const;
106 
115  sal_UCS4 GetPrevChar( sal_UCS4 cChar ) const;
116 
126  int GetIndexFromChar( sal_UCS4 cChar ) const;
127 
137  sal_UCS4 GetCharFromIndex( int nCharIndex ) const;
138 
139  int GetGlyphIndex( sal_UCS4 ) const;
140 
141  bool isSymbolic() const;
142 
143 private:
145 
146  friend class ::OutputDevice;
147 
148  int findRangeIndex( sal_UCS4 ) const;
149 
150  FontCharMap( ImplFontCharMapRef const & pIFCMap );
151 
152  // prevent assignment and copy construction
153  FontCharMap( const FontCharMap& ) = delete;
154  void operator=( const FontCharMap& ) = delete;
155 };
156 
157 // CmapResult is a normalized version of the many CMAP formats
159 {
160 public:
161  explicit CmapResult( bool bSymbolic = false,
162  const sal_UCS4* pRangeCodes = nullptr, int nRangeCount = 0 );
163 
165  const int* mpStartGlyphs;
166  const sal_uInt16* mpGlyphIds;
169  bool mbRecoded;
170 };
171 
172 #endif // INCLUDED_FONTCHARMAP_HXX
173 
174 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt32 sal_UCS4
Definition: vclenum.hxx:196
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:302
const sal_UCS4 * mpRangeCodes
tools::SvRef< ImplFontCharMap > ImplFontCharMapRef
Definition: fontcharmap.hxx:30
#define VCL_PLUGIN_PUBLIC
Definition: dllapi.h:40
SvRefBase & operator=(const SvRefBase &)
const int * mpStartGlyphs