-
Notifications
You must be signed in to change notification settings - Fork 0
/
XmlInterface.hpp
40 lines (32 loc) · 1007 Bytes
/
XmlInterface.hpp
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
#ifndef XMLINTERFACE_HPP
#define XMLINTERFACE_HPP
#include <QMessageBox>
#include <QInputDialog>
#include <QFileDialog>
#include "Economy/TicketContainer.hpp"
#include "Economy/Ticket.hpp"
#include "Persistence/XmlExporter.hpp"
#include "Persistence/XmlImporter.hpp"
#include "Config.hpp"
#include "TicketLoadedListener.hpp"
class XmlInterface
{
private:
TicketContainer *ticketContainer;
QWidget *parent;
Config *config;
bool noTicket();
QString askForATicketName();
QString askForSavePath(Ticket *ticket);
QString askForSaveFolder();
bool exportToXml(Ticket *ticket, const QString &path);
bool loadXml(const QString &fileName, TicketLoadedListener *listener);
QStringList loadPaths();
public:
XmlInterface(QWidget *parent, TicketContainer *ticketContainer, Config *config);
void askForTicketAndSave();
void saveTicket(Ticket *ticket);
void saveAllTickets();
void loadTicket(TicketLoadedListener *listener);
};
#endif // XMLINTERFACE_HPP