42 lines
938 B
C++
42 lines
938 B
C++
#pragma once
|
|
#include "ListE.hpp"
|
|
#include "Record.hpp"
|
|
#define ASCENT true
|
|
#define DESCENT false
|
|
|
|
enum SortBy {
|
|
RecordID,
|
|
RecordDate,
|
|
RecordCourseName,
|
|
RecordStudentID,
|
|
RecordStudentName,
|
|
RecordType
|
|
};
|
|
|
|
class ListDisplay {
|
|
private:
|
|
const List<BaseRecord*> &allRecordsPtrList;
|
|
List<BaseRecord*> filteredRecordsPtrList;
|
|
Date fromDate;
|
|
Date toDate;
|
|
Student searchForStu;
|
|
int recordNumPerPage;
|
|
// The current page index, starting from 0
|
|
int currentPageIndex;
|
|
int maxPageIndex;
|
|
bool sortOrder;
|
|
SortBy sortByProp;
|
|
const std::string tableTitleRow;
|
|
|
|
public:
|
|
ListDisplay(const List<BaseRecord*> &_allRecordsPtrList);
|
|
bool hasNext();
|
|
bool hasPrev();
|
|
void displayNext();
|
|
void displayPrev();
|
|
void display();
|
|
void setSortBy(SortBy _propName);
|
|
void setSortOrder(bool newOrder);
|
|
void reapplyFilter();
|
|
void setRecordNumPerPage(int count);
|
|
}; |