ReactOS  0.4.15-dev-2153-g62b4c61
CFontCache.hpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Font Shell Extension
3  * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE: font list cache handling
5  * COPYRIGHT: Copyright 2019,2020 Mark Jansen (mark.jansen@reactos.org)
6  */
7 
8 #pragma once
9 
10 
11 class CFontInfo
12 {
13 private:
16  bool m_FileRead;
17 public:
18  CFontInfo(LPCWSTR name = L"");
19 
20  const CStringW& Name() const;
21  const CStringW& File();
22  const bool Valid() const;
23 };
24 
25 
27 {
28 private:
29  CAtlArray<CFontInfo> m_Fonts;
31 
32 protected:
33  CFontCache();
34 
35  void Insert(CAtlList<CFontInfo>& fonts, const CStringW& KeyName);
36  void Read();
37 
38 public:
39  void SetFontDir(const LPCWSTR Path);
40  const CStringW& FontPath() const { return m_FontFolderPath; }
41 
42  size_t Size();
43  CStringW Name(size_t Index);
44  CStringW Filename(const FontPidlEntry* fontEntry, bool alwaysFullPath = false);
45 
46  friend class CFontExtModule;
47 };
48 
49 
50 extern CFontCache* g_FontCache;
51 
52 
CStringW m_File
Definition: CFontCache.hpp:15
const bool Valid() const
Definition: CFontCache.cpp:25
void Insert(CAtlList< CFontInfo > &fonts, const CStringW &KeyName)
Definition: CFontCache.cpp:126
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
CStringW m_Name
Definition: CFontCache.hpp:14
CFontCache * g_FontCache
Definition: CFontCache.cpp:12
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2697
void SetFontDir(const LPCWSTR Path)
Definition: CFontCache.cpp:71
CStringW m_FontFolderPath
Definition: CFontCache.hpp:30
_In_ WDFCOLLECTION _In_ ULONG Index
CAtlArray< CFontInfo > m_Fonts
Definition: CFontCache.hpp:29
static const WCHAR L[]
Definition: oid.c:1250
const CStringW & FontPath() const
Definition: CFontCache.hpp:40
void Read()
Definition: CFontCache.cpp:142
CStringW Name(size_t Index)
Definition: CFontCache.cpp:85
PRTL_UNICODE_STRING_BUFFER Path
CStringW Filename(const FontPidlEntry *fontEntry, bool alwaysFullPath=false)
Definition: CFontCache.cpp:96
const CStringW & File()
Definition: CFontCache.cpp:30
bool m_FileRead
Definition: CFontCache.hpp:16
size_t Size()
Definition: CFontCache.cpp:77
Definition: name.c:38
CAtlStringW CStringW
Definition: atlstr.h:130
const CStringW & Name() const
Definition: CFontCache.cpp:20
CFontInfo(LPCWSTR name=L"")
Definition: CFontCache.cpp:14