mirror of
https://github.com/reactos/reactos.git
synced 2024-10-30 11:35:58 +00:00
c09636f946
CORE-16476
53 lines
1 KiB
C++
53 lines
1 KiB
C++
/*
|
|
* PROJECT: ReactOS Font Shell Extension
|
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
|
* PURPOSE: font list cache handling
|
|
* COPYRIGHT: Copyright 2019,2020 Mark Jansen (mark.jansen@reactos.org)
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
class CFontInfo
|
|
{
|
|
private:
|
|
CStringW m_Name;
|
|
CStringW m_File;
|
|
bool m_FileRead;
|
|
public:
|
|
CFontInfo(LPCWSTR name = L"");
|
|
|
|
const CStringW& Name() const;
|
|
const CStringW& File();
|
|
const bool Valid() const;
|
|
};
|
|
|
|
|
|
class CFontCache
|
|
{
|
|
private:
|
|
CAtlArray<CFontInfo> m_Fonts;
|
|
CStringW m_FontFolderPath;
|
|
|
|
protected:
|
|
CFontCache();
|
|
|
|
void Insert(CAtlList<CFontInfo>& fonts, const CStringW& KeyName);
|
|
void Read();
|
|
|
|
public:
|
|
void SetFontDir(const LPCWSTR Path);
|
|
const CStringW& FontPath() const { return m_FontFolderPath; }
|
|
|
|
size_t Size();
|
|
CStringW Name(size_t Index);
|
|
CStringW Filename(const FontPidlEntry* fontEntry, bool alwaysFullPath = false);
|
|
|
|
friend class CFontExtModule;
|
|
};
|
|
|
|
|
|
extern CFontCache* g_FontCache;
|
|
|
|
|