File indexing completed on 2024-04-21 03:51:27

0001 /*
0002     This file is part of KDE.
0003 
0004     SPDX-FileCopyrightText: 2008 Cornelius Schumacher <schumacher@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 #ifndef ATTICA_CATEGORY_H
0009 #define ATTICA_CATEGORY_H
0010 
0011 #include <QList>
0012 #include <QSharedDataPointer>
0013 
0014 #include "attica_export.h"
0015 
0016 namespace Attica
0017 {
0018 /**
0019  * @class Category category.h <Attica/Category>
0020  *
0021  * Represents a single content category
0022  */
0023 class ATTICA_EXPORT Category
0024 {
0025 public:
0026     typedef QList<Category> List;
0027     class Parser;
0028 
0029     /**
0030      * Creates an empty Category
0031      */
0032     Category();
0033 
0034     /**
0035      * Copy constructor.
0036      * @param other the Category to copy from
0037      */
0038     Category(const Category &other);
0039 
0040     /**
0041      * Assignment operator.
0042      * @param other the Category to assign from
0043      * @return pointer to this Category
0044      */
0045     Category &operator=(const Category &other);
0046 
0047     /**
0048      * Destructor.
0049      */
0050     ~Category();
0051 
0052     /**
0053      * Sets the id of the Category.
0054      * The id uniquely identifies a Category with the OCS API.
0055      * @param id the new id
0056      */
0057     void setId(const QString &);
0058 
0059     /**
0060      * Gets the id of the Category.
0061      * The id uniquely identifies a Category with the OCS API.
0062      * @return the id
0063      */
0064     QString id() const;
0065 
0066     /**
0067      * Sets the name of the Category.
0068      * @param name the new name
0069      */
0070     void setName(const QString &name);
0071 
0072     /**
0073      * Gets the name of the Category.
0074      * @return the name
0075      */
0076     QString name() const;
0077 
0078     /**
0079      * Checks whether this Category has an id
0080      * @return @c true if an id has been set, @c false otherwise
0081      */
0082     bool isValid() const;
0083 
0084     /**
0085      * Sets the display name of the Category.
0086      * This name is guaranteed to be user friendly, while name may be
0087      * internal for the server
0088      * @param name the new name
0089      * @since 5.31
0090      */
0091     void setDisplayName(const QString &name);
0092 
0093     /**
0094      * Gets the display name of the Category.
0095      * This name is guaranteed to be user friendly, while name may be
0096      * internal for the server
0097      * @return the name
0098      * @since 5.31
0099      */
0100     QString displayName() const;
0101 
0102 private:
0103     class Private;
0104     QSharedDataPointer<Private> d;
0105 };
0106 
0107 }
0108 
0109 #endif