-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrowserHistory.h
69 lines (57 loc) · 2.18 KB
/
browserHistory.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef BROWSERHISTORYMANAGER_BROWSERHISTORY_H
#define BROWSERHISTORYMANAGER_BROWSERHISTORY_H
#include "browserHistoryItem.h"
// Constants
/*
* @brief the maximum length of the browser history
*/
#define MAX_BROWSER_HISTORY_LENGTH 100
// BrowserHistory struct
/*
* @brief BrowserHistory struct to represent a browser history
*
* @var pHead - a pointer to the head of the browser history
* @var pTail - a pointer to the tail of the browser history
* @var numberOfItems - the number of items in the browser history
*/
typedef struct BrowserHistory {
BrowserHistoryItem* pHead;
BrowserHistoryItem* pTail;
int numberOfItems;
} BrowserHistory;
// BrowserHistory function prototypes
/*
* @brief creates a BrowserHistory object
*
* @returns a BrowserHistory object pointer
*/
BrowserHistory* createBrowserHistory();
/*
* @brief destroys the given BrowserHistory object
*
* @param pBrowserHistory - the pointer to the BrowserHistory object to destroy
*/
void destroyBrowserHistory(BrowserHistory* pBrowserHistory);
/*
* @brief pushes the given BrowserHistoryItem object to the given BrowserHistory object
*
* @param pBrowserHistory - the pointer to the BrowserHistory object to use
* @param pBrowserHistoryItem - the pointer to the BrowserHistoryItem object to push
*/
void pushBrowserHistoryItem(BrowserHistory* pBrowserHistory, BrowserHistoryItem* pBrowserHistoryItem);
/*
* @brief deletes the BrowserHistoryItem object with the given ID from the given BrowserHistory object
*
* @param pBrowserHistory - the pointer to the BrowserHistory object to be used
* @param browserHistoryItemId - the ID of the BrowserHistoryItem object to delete
*/
void deleteBrowserHistoryItem(BrowserHistory* pBrowserHistory, int browserHistoryItemId);
/*
* @brief prints the given BrowserHistory object
*
* @param pBrowserHistory - the pointer to the BrowserHistory object to print
* @param reversed - whether to print the browser history in reverse order
* @param bookmarkedOnly - whether to print only bookmarked items
*/
void printBrowserHistory(BrowserHistory* pBrowserHistory, bool reversed, bool bookmarkedOnly);
#endif //BROWSERHISTORYMANAGER_BROWSERHISTORY_H