-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist.h
77 lines (55 loc) · 1.33 KB
/
list.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
70
71
72
73
74
75
76
77
#ifndef LIST_H
#define LIST_H
#include "song.h"
#include <QTableWidget>
#include <QTableWidgetItem>
class list
{
private:
class Node{
public:
Node();
Node(song&);
song data;
Node* next;
Node* prev;
int id;
QTableWidgetItem* itemName;
QTableWidgetItem* itemAuthor;
QTableWidgetItem* itemAddress;
};
Node* head;
Node* currentSong;
QTableWidget* table;
bool isValidPos(Node*);
void updateIndexes();
void copyAll(list);
int rows;
public:
typedef Node* position;
list();
~list();
int id;
void setTable(QTableWidget*);
bool isEmpty();
void insertElem(Node*, song&);
void deleteElem(Node*);
void deleteFirstElem();
void deleteLastElem();
song getCurrentSong();
void nextSong();
void prevSong();
Node* getFirstPos();
Node* getLastPos();
Node* getPrevPos(Node*);
Node* getNextPos(Node*);
Node* findElem(song&);
Node* findElemByAtribute(std::string, int);
void reverse();
void modify(int,song);
song retrieve(Node*);
std::string toString();
void deleteAll();
list& operator = (list&);
};
#endif // LIST_H