Attica

achievement.h
1 /*
2  This file is part of KDE.
3 
4  SPDX-FileCopyrightText: 2011 Laszlo Papp <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8 
9 #ifndef ATTICA_ACHIEVEMENT_H
10 #define ATTICA_ACHIEVEMENT_H
11 
12 #include "attica_export.h"
13 
14 #include <QSharedDataPointer>
15 #include <QStringList>
16 #include <QUrl>
17 #include <QVariant>
18 
19 namespace Attica
20 {
21 
22 class ATTICA_EXPORT Achievement
23 {
24 public:
25  typedef QList<Achievement> List;
26  class Parser;
27 
28  enum Type {
29  FlowingAchievement,
30  SteppedAchievement,
31  NamedstepsAchievement,
32  SetAchievement
33  };
34  static Achievement::Type stringToAchievementType(const QString &achievementTypeString);
35  static QString achievementTypeToString(const Achievement::Type type);
36 
37  enum Visibility {
38  VisibleAchievement,
39  DependentsAchievement,
40  SecretAchievement
41  };
42  static Achievement::Visibility stringToAchievementVisibility(const QString &achievementVisibilityString);
43  static QString achievementVisibilityToString(const Achievement::Visibility visibility);
44 
45  Achievement();
46  Achievement(const Achievement &other);
47  Achievement &operator=(const Achievement &other);
48  ~Achievement();
49 
50  void setId(const QString &id);
51  QString id() const;
52 
53  void setContentId(const QString &contentId);
54  QString contentId() const;
55 
56  void setName(const QString &name);
57  QString name() const;
58 
59  void setDescription(const QString &description);
60  QString description() const;
61 
62  void setExplanation(const QString &explanation);
63  QString explanation() const;
64 
65  void setPoints(const int points);
66  int points() const;
67 
68  void setImage(const QUrl &image);
69  QUrl image() const;
70 
71  void setDependencies(const QStringList &dependencies);
72  void addDependency(const QString &dependency);
73  void removeDependency(const QString &dependency);
74  QStringList dependencies() const;
75 
76  void setVisibility(Achievement::Visibility visibility);
77  Achievement::Visibility visibility() const;
78 
79  void setType(Achievement::Type type);
80  Achievement::Type type() const;
81 
82  void setOptions(const QStringList &options);
83  void addOption(const QString &option);
84  void removeOption(const QString &option);
85  QStringList options() const;
86 
87  void setSteps(const int steps);
88  int steps() const;
89 
90  void setProgress(const QVariant &progress);
91  QVariant progress() const;
92 
93  bool isValid() const;
94 
95 private:
96  class Private;
98 };
99 
100 }
101 
102 #endif
QString name(const QVariant &location)
Type type(const QSqlDatabase &db)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 23:06:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.