-
Notifications
You must be signed in to change notification settings - Fork 0
/
FileHistory.h
31 lines (26 loc) · 1.18 KB
/
FileHistory.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* Copyright 2021 the SumatraPDF project authors (see AUTHORS file).
License: GPLv3 */
// number of most recently used files that will be shown in the menu
// (and remembered in the preferences file, if just filenames are
// to be remembered and not individual view settings per document)
#define kFileHistoryMaxRecent 10
// maximum number of most frequently used files that will be shown on the
// Frequent Read list (space permitting)
#define kFileHistoryMaxFrequent 10
struct FileHistory {
// owned by gGlobalPrefs->fileStates
Vec<FileState*>* states = nullptr;
FileHistory() = default;
~FileHistory() = default;
void Clear(bool keepFavorites) const;
void Append(FileState* state) const;
void Remove(FileState* state) const;
[[nodiscard]] FileState* Get(size_t index) const;
FileState* Find(const char* filePath, size_t* idxOut) const;
FileState* MarkFileLoaded(const char* filePath) const;
bool MarkFileInexistent(const char* filePath, bool hide = false) const;
void GetFrequencyOrder(Vec<FileState*>& list) const;
void Purge(bool alwaysUseDefaultState = false) const;
void UpdateStatesSource(Vec<FileState*>* states);
void FixPath();
};