ReactOS 0.4.15-dev-7942-gd23573b
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-2021 Mark Jansen <mark.jansen@reactos.org>
6 */
7
8#pragma once
9
10
12{
13private:
14 CStringW m_Name;
15 CStringW m_File;
17
22
23 void ReadAttrs();
24
25public:
27
28 const CStringW& Name() const; // Font display name stored in the registry
29 const bool Valid() const;
30
31 const CStringW& File(); // Full path or file, depending on how it's stored in the registry
32 const LARGE_INTEGER& FileSize();
33 const FILETIME& FileWriteTime();
35};
36
37
39{
40private:
41 CAtlArray<CFontInfo> m_Fonts;
43
44protected:
45 CFontCache();
46
47 void Insert(CAtlList<CFontInfo>& fonts, const CStringW& KeyName);
48
49public:
50 void Read();
51
52 void SetFontDir(const LPCWSTR Path);
53 const CStringW& FontPath() const { return m_FontFolderPath; }
54
55 size_t Size();
56 CStringW Name(size_t Index); // Font display name stored in the registry
57
58 CFontInfo* Find(const FontPidlEntry* fontEntry);
59 CStringW Filename(CFontInfo* info, bool alwaysFullPath = false);
60
61 friend class CFontExtModule;
62};
63
64
66
67
CFontCache * g_FontCache
Definition: CFontCache.cpp:12
PRTL_UNICODE_STRING_BUFFER Path
struct NameRec_ * Name
Definition: cdprocs.h:460
CStringW m_FontFolderPath
Definition: CFontCache.hpp:42
CFontInfo * Find(const FontPidlEntry *fontEntry)
Definition: CFontCache.cpp:145
void Read()
Definition: CFontCache.cpp:200
CAtlArray< CFontInfo > m_Fonts
Definition: CFontCache.hpp:41
void Insert(CAtlList< CFontInfo > &fonts, const CStringW &KeyName)
Definition: CFontCache.cpp:184
const CStringW & FontPath() const
Definition: CFontCache.hpp:53
size_t Size()
Definition: CFontCache.cpp:126
void SetFontDir(const LPCWSTR Path)
Definition: CFontCache.cpp:120
CStringW m_Name
Definition: CFontCache.hpp:14
FILETIME m_FileWriteTime
Definition: CFontCache.hpp:20
LARGE_INTEGER m_FileSize
Definition: CFontCache.hpp:19
CStringW m_File
Definition: CFontCache.hpp:15
const CStringW & Name() const
Definition: CFontCache.cpp:24
bool m_FileRead
Definition: CFontCache.hpp:16
const bool Valid() const
Definition: CFontCache.cpp:29
const CStringW & File()
Definition: CFontCache.cpp:34
const FILETIME & FileWriteTime()
Definition: CFontCache.cpp:100
const LARGE_INTEGER & FileSize()
Definition: CFontCache.cpp:92
DWORD m_dwFileAttributes
Definition: CFontCache.hpp:21
void ReadAttrs()
Definition: CFontCache.cpp:69
DWORD FileAttributes()
Definition: CFontCache.cpp:108
bool m_AttrsRead
Definition: CFontCache.hpp:18
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:939
unsigned long DWORD
Definition: ntddk_ex.h:95
#define L(x)
Definition: ntvdm.h:50
Definition: name.c:39
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2699
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185