Subversion Repositories tpanel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 andreas 1
/*
21 andreas 2
 * Copyright (C) 2020, 2021 by Andreas Theofilu <andreas@theosys.at>
3 andreas 3
 *
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software Foundation,
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
17
 */
18
#ifndef __TPAGELIST_H__
19
#define __TPAGELIST_H__
20
 
21
#include <string>
22
#include <vector>
23
#include "tvalidatefile.h"
24
 
25
typedef struct PAGELIST_T
26
{
27
    std::string name;
28
    int pageID{0};
29
    std::string file;
30
    int isValid{-1};
31
 
32
    void clear()
33
    {
34
        name.clear();
35
        pageID = 0;
36
        file.clear();
37
        isValid = -1;
38
    }
39
}PAGELIST_T;
40
 
41
typedef struct SUBPAGELIST_T
42
{
43
    std::string name;
44
    int pageID{0};
45
    std::string file;
46
    std::string group;
47
    int isValid{-1};
48
    int popupType{0};
49
 
50
    void clear()
51
    {
52
        name.clear();
53
        pageID = 0;
54
        file.clear();
55
        group.clear();
56
        isValid = -1;
57
        popupType = 0;
58
    }
59
}SUBPAGELIST_T;
60
 
61
class TPageList : public TValidateFile
62
{
63
    public:
64
        TPageList();
65
        ~TPageList();
66
 
67
        void initialize();
68
 
69
        PAGELIST_T findPage(const std::string& name);
70
        PAGELIST_T findPage(int pageID);
71
        SUBPAGELIST_T findSubPage(const std::string& name);
72
        SUBPAGELIST_T findSubPage(int pageID);
73
 
74
        std::vector<PAGELIST_T>& getPagelist() { return mPageList; }
75
        std::vector<SUBPAGELIST_T>& getSupPageList() { return mSubPageList; }
76
 
77
    private:
78
        std::string mProject;
79
        std::vector<PAGELIST_T> mPageList;
80
        std::vector<SUBPAGELIST_T> mSubPageList;
81
};
82
 
83
#endif