README
[n9profile] / profilesmanager.h
1 #ifndef PROFILESMANAGER_H
2 #define PROFILESMANAGER_H
3
4 #include <QObject>
5 #include <QtCore/QFile>
6 #include <QtXml/QDomDocument>
7 #include <QtCore/QStringList>
8 #include <QtCore/QDir>
9 class ProfileDeamon;
10 class Profil;
11 class QStandardItemModel;
12 class QFileInfo;
13 class ProfilesManager : public QObject
14 {
15     Q_OBJECT
16 public:
17     explicit ProfilesManager(QObject *parent = 0);
18
19     bool Init();
20
21     QStringList GetProfilesNames();
22     bool GetProfile(Profil * profil);
23     QStandardItemModel * GetModel();
24     bool  CreateProfile(Profil *Data);
25     void UpdateProfile(Profil * Data );
26     void SetProfile(QString str_profile);
27     void DeleteProfile(QString profile_name);
28     void TestPrint();
29     QDomElement GetRootElement() const;
30     void SaveProfilesToXml();
31
32 signals:
33     void s_profiles_name_change(QStringList Profiles_names);
34     void s_profile_update(QString Profil_name);
35     void s_profile_delete(QString profile_name);
36     void s_delete_Profiles_Name_From_Models(QString profile_name);
37
38 public slots:
39
40 private:
41     ProfileDeamon * profile_deamon;
42     QStandardItemModel *model_of_files;
43     QFile file;
44
45     QDomDocument domDocument;
46     bool InitFile();
47     bool CreateFile();
48     bool ReadFile();
49     bool CheckDomDoc();
50     QString CreateXmlText();
51     QDomElement CreateNewProfile( Profil *Data);
52     void CreateNode(QDomElement * profil, QString name, QString attribute, QString text);
53
54
55 };
56
57 #endif // PROFILESMANAGER_H