File indexing completed on 2024-12-01 03:37:35

0001 /*
0002     This file is part of KDE.
0003 
0004     SPDX-FileCopyrightText: 2009 Marco Martin <notmart@gmail.com>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef ATTICA_KNOWLEDGEBASEENTRY_H
0010 #define ATTICA_KNOWLEDGEBASEENTRY_H
0011 
0012 #include "attica_export.h"
0013 
0014 #include <QDateTime>
0015 #include <QMap>
0016 #include <QSharedDataPointer>
0017 
0018 #include <QUrl>
0019 
0020 namespace Attica
0021 {
0022 
0023 /**
0024  * @class KnowledgeBaseEntry knowledgebaseentry.h <Attica/KnowledgeBaseEntry>
0025  *
0026  * Represents a knowledge base entry.
0027  */
0028 class ATTICA_EXPORT KnowledgeBaseEntry
0029 {
0030 public:
0031     typedef QList<KnowledgeBaseEntry> List;
0032     class Parser;
0033 
0034     KnowledgeBaseEntry();
0035     KnowledgeBaseEntry(const KnowledgeBaseEntry &other);
0036     KnowledgeBaseEntry &operator=(const KnowledgeBaseEntry &other);
0037     ~KnowledgeBaseEntry();
0038 
0039     void setId(QString id);
0040     QString id() const;
0041 
0042     void setContentId(int id);
0043     int contentId() const;
0044 
0045     void setUser(const QString &user);
0046     QString user() const;
0047 
0048     void setStatus(const QString &status);
0049     QString status() const;
0050 
0051     void setChanged(const QDateTime &changed);
0052     QDateTime changed() const;
0053 
0054     void setName(const QString &name);
0055     QString name() const;
0056 
0057     void setDescription(const QString &description);
0058     QString description() const;
0059 
0060     void setAnswer(const QString &answer);
0061     QString answer() const;
0062 
0063     void setComments(int comments);
0064     int comments() const;
0065 
0066     void setDetailPage(const QUrl &detailPage);
0067     QUrl detailPage() const;
0068 
0069     void addExtendedAttribute(const QString &key, const QString &value);
0070     QString extendedAttribute(const QString &key) const;
0071 
0072     QMap<QString, QString> extendedAttributes() const;
0073 
0074     bool isValid() const;
0075 
0076 private:
0077     class Private;
0078     QSharedDataPointer<Private> d;
0079 };
0080 
0081 }
0082 
0083 #endif