summaryrefslogtreecommitdiff
path: root/src/history.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-07-29 16:40:07 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-07-29 16:40:19 +0300
commit72e095cf987d6bb2bc2212035a8c5498f3b6d329 (patch)
tree75e1191db056794d252ff6c6384f3763f2a0ad4b /src/history.h
parent67750111c420fcf97e31289bb4770cb7f69c426e (diff)
Moved History to its own type
Diffstat (limited to 'src/history.h')
-rw-r--r--src/history.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/history.h b/src/history.h
new file mode 100644
index 00000000..15a179d6
--- /dev/null
+++ b/src/history.h
@@ -0,0 +1,41 @@
1#pragma once
2
3#include <the_Foundation/array.h>
4#include <the_Foundation/string.h>
5#include <the_Foundation/time.h>
6
7iDeclareType(History)
8iDeclareType(HistoryItem)
9
10struct Impl_HistoryItem {
11 iTime when;
12 iString url;
13};
14
15iDeclareTypeConstruction(HistoryItem)
16
17struct Impl_History {
18 iArray history;
19 size_t historyPos; /* zero at the latest item */
20};
21
22iDeclareTypeConstruction(History)
23
24void clear_History (iHistory *);
25
26void load_History (iHistory *, const iString *path);
27void save_History (const iHistory *, const iString *path);
28
29iHistoryItem * itemAtPos_History (iHistory *, size_t pos);
30const iString * url_History (iHistory *, size_t pos);
31iTime urlVisitTime_History(const iHistory *, const iString *url);
32void print_History (const iHistory *);
33
34iLocalDef iHistoryItem *item_History(iHistory *d) {
35 return itemAtPos_History(d, d->historyPos);
36}
37
38void addUrl_History (iHistory *, const iString *url);
39
40iBool goBack_History (iHistory *);
41iBool goForward_History (iHistory *);