Attica

category.cpp
1/*
2 This file is part of KDE.
3
4 SPDX-FileCopyrightText: 2008 Cornelius Schumacher <schumacher@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7*/
8
9#include "category.h"
10
11#include <QDebug>
12#include <QString>
13
14using namespace Attica;
15
16class Q_DECL_HIDDEN Category::Private : public QSharedData
17{
18public:
19 QString m_id;
20 QString m_name;
21 QString m_displayName;
22};
23
25 : d(new Private)
26{
27}
28
30 : d(other.d)
31{
32}
33
35{
36 d = other.d;
37 return *this;
38}
39
43
45{
46 d->m_id = u;
47}
48
50{
51 return d->m_id;
52}
53
54void Category::setName(const QString &name)
55{
56 d->m_name = name;
57}
58
60{
61 return d->m_name;
62}
63
65{
66 d->m_displayName = name;
67}
68
70{
71 return d->m_displayName;
72}
73
75{
76 return !(d->m_id.isEmpty());
77}
Represents a single content category.
Definition category.h:24
Category & operator=(const Category &other)
Assignment operator.
Definition category.cpp:34
void setName(const QString &name)
Sets the name of the Category.
Definition category.cpp:54
void setDisplayName(const QString &name)
Sets the display name of the Category.
Definition category.cpp:64
QString displayName() const
Gets the display name of the Category.
Definition category.cpp:69
bool isValid() const
Checks whether this Category has an id.
Definition category.cpp:74
QString name() const
Gets the name of the Category.
Definition category.cpp:59
~Category()
Destructor.
Definition category.cpp:40
QString id() const
Gets the id of the Category.
Definition category.cpp:49
void setId(const QString &)
Sets the id of the Category.
Definition category.cpp:44
Category()
Creates an empty Category.
Definition category.cpp:24
The Attica namespace,.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:48 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.