ReactOS 0.4.16-dev-1028-g8602629
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
11{
12private:
13 CStringW m_Name;
14 CStringW m_File;
16
21
22 void ReadAttrs();
23
24public:
26
27 const CStringW& Name() const; // Font display name stored in the registry
28 const bool Valid() const;
29
30 const CStringW& File(); // Full path or file, depending on how it's stored in the registry
31 const LARGE_INTEGER& FileSize();
32 const FILETIME& FileWriteTime();
34};
35
37{
38private:
39 CAtlArray<CFontInfo> m_Fonts;
41
42protected:
43 CFontCache();
44
45 void Insert(CAtlList<CFontInfo>& fonts, const CStringW& KeyName);
46
47public:
48 void Read();
49
50 void SetFontDir(const LPCWSTR Path);
51 const CStringW& FontPath() const { return m_FontFolderPath; }
52
53 size_t Size();
54 CStringW Name(size_t Index); // Font display name stored in the registry
55
56 CFontInfo* Find(const FontPidlEntry* fontEntry);
57 CStringW Filename(CFontInfo* info, bool alwaysFullPath = false);
58
59 friend class CFontExtModule;
60};
61
CFontCache * g_FontCache
Definition: CFontCache.cpp:12
PRTL_UNICODE_STRING_BUFFER Path
CStringW m_FontFolderPath
Definition: CFontCache.hpp:40
CFontInfo * Find(const FontPidlEntry *fontEntry)
Definition: CFontCache.cpp:145
void Read()
Definition: CFontCache.cpp:200
CAtlArray< CFontInfo > m_Fonts
Definition: CFontCache.hpp:39
void Insert(CAtlList< CFontInfo > &fonts, const CStringW &KeyName)
Definition: CFontCache.cpp:184
const CStringW & FontPath() const
Definition: CFontCache.hpp:51
size_t Size()
Definition: CFontCache.cpp:126
void SetFontDir(const LPCWSTR Path)
Definition: CFontCache.cpp:120
CStringW m_Name
Definition: CFontCache.hpp:13
FILETIME m_FileWriteTime
Definition: CFontCache.hpp:19
LARGE_INTEGER m_FileSize
Definition: CFontCache.hpp:18
CStringW m_File
Definition: CFontCache.hpp:14
const CStringW & Name() const
Definition: CFontCache.cpp:24
bool m_FileRead
Definition: CFontCache.hpp:15
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:20
void ReadAttrs()
Definition: CFontCache.cpp:69
DWORD FileAttributes()
Definition: CFontCache.cpp:108
bool m_AttrsRead
Definition: CFontCache.hpp:17
LPWSTR Name
Definition: desk.c:124
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:940
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