File indexing completed on 2024-02-18 05:45:26

0001 /*******************************************************************************
0002  * Copyright (C) 2008-2013 Konstantinos Smanis <konstantinos.smanis@gmail.com> *
0003  *                                                                             *
0004  * This program is free software: you can redistribute it and/or modify it     *
0005  * under the terms of the GNU General Public License as published by the Free  *
0006  * Software Foundation, either version 3 of the License, or (at your option)   *
0007  * any later version.                                                          *
0008  *                                                                             *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT *
0010  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
0011  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
0012  * more details.                                                               *
0013  *                                                                             *
0014  * You should have received a copy of the GNU General Public License along     *
0015  * with this program. If not, see <http://www.gnu.org/licenses/>.              *
0016  *******************************************************************************/
0017 
0018 #ifndef ENTRY_H
0019 #define ENTRY_H
0020 
0021 //Qt
0022 #include <QList>
0023 #include <QString>
0024 
0025 class Entry
0026 {
0027 public:
0028     struct Title {
0029         QString str;
0030         int num;
0031     };
0032     enum Type {
0033         Invalid,
0034         Menuentry,
0035         Submenu
0036     };
0037 
0038     explicit Entry(const QString &strTitle = QString(), int numTitle = -1, Entry::Type type = Entry::Invalid, int level = -1);
0039 
0040     Entry::Title title() const;
0041     QString prettyTitle() const;
0042     QString fullTitle() const;
0043     QString fullNumTitle() const;
0044     Entry::Type type() const;
0045     int level() const;
0046     QList<Entry::Title> ancestors() const;
0047     QString kernel() const;
0048 
0049     void setTitle(const Entry::Title &title);
0050     void setTitle(const QString &strTitle, int numTitle);
0051     void setType(Entry::Type type);
0052     void setLevel(int level);
0053     void setAncestors(const QList<Entry::Title> &ancestors);
0054     void setKernel(const QString &kernel);
0055 
0056     void clear();
0057 private:
0058     Entry::Title m_title;
0059     Entry::Type m_type;
0060     int m_level;
0061     QList<Entry::Title> m_ancestors;
0062     QString m_kernel;
0063 };
0064 
0065 #endif