1 /*
2  * %kadu copyright begin%
3  * Copyright 2011 Rafał Przemysław Malinowski (rafal.przemyslaw.malinowski@gmail.com)
4  * %kadu copyright end%
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef STATUS_TYPE_DATA_H
21 #define STATUS_TYPE_DATA_H
22 
23 #include <QtCore/QString>
24 #include <QtCore/QVariant>
25 
26 #include "status/status-type-group.h"
27 #include "status/status-type.h"
28 
29 #include "exports.h"
30 
31 /**
32  * @addtogroup Status
33  * @{
34  */
35 
36 /**
37  * @class StatusTypeData
38  * @author Rafał 'Vogel' Malinowski
39  * @short Extendend information about StatusType enum values.
40  * @see StatusType
41  * @see StatusTypeManager
42  *
43  * This class contains extended information about StatusType enums. If C++ allowed for enums with fields, this class
44  * would be merged with StatusType.
45  *
46  * StatusTypeData instances can be only aquired by StatusTypeManager methods. Use instances of this class to get
47  * additional info like status type name, display name, icon or type group.
48  */
49 class KADUAPI StatusTypeData
50 {
51 	friend class StatusTypeManager;
52 
53 	StatusType Type;
54 	QString Name;
55 	QString DisplayName;
56 	QString IconName;
57 
58 	StatusTypeGroup TypeGroup;
59 
60 	StatusTypeData(StatusType type, const QString &name, const QString &displayName, const QString &iconName, StatusTypeGroup typeGroup);
61 
62 public:
63 	StatusTypeData();
64 	StatusTypeData(const StatusTypeData &copyMe);
65 
66 	/**
67 	 * @author Rafał 'Vogel' Malinowski
68 	 * @short Returns StatusType enum value associated with this object.
69 	 * @return StatusType enum value associated with this object
70 	 *
71 	 * Returns StatusType enum value associated with this object.
72 	 */
type()73 	StatusType type() const { return Type; }
74 
75 	/**
76 	 * @author Rafał 'Vogel' Malinowski
77 	 * @short Returns name of status type associated with this object.
78 	 * @return name of status type associated with this object
79 	 *
80 	 * Returns name of status type associated with this object. This name can be used to store
81 	 * status type in configuration files. StatusTypeData can be restored from name using
82 	 * StatusTypeManager::byName method.
83 	 */
name()84 	const QString & name() const { return Name; }
85 
86 	/**
87 	 * @author Rafał 'Vogel' Malinowski
88 	 * @short Returns display name of status type associated with this object.
89 	 * @return display name of status type associated with this object
90 	 *
91 	 * Returns display name of status type associated with this object.
92 	 */
displayName()93 	const QString & displayName() const { return DisplayName; }
94 
95 	/**
96 	 * @author Rafał 'Vogel' Malinowski
97 	 * @short Returns icon name associated with this status type.
98 	 * @return icon name associated with this status type
99 	 *
100 	 * Returns icon name associated with this status type.
101 	 */
iconName()102 	const QString & iconName() const { return IconName; }
103 
104 	/**
105 	 * @author Rafał 'Vogel' Malinowski
106 	 * @short Returns StatusTypeGroup enum value associated with this status type.
107 	 * @return StatusTypeGroup enum value associated with this status type
108 	 *
109 	 * Returns StatusTypeGroup enum value associated with this status type.
110 	 */
typeGroup()111 	StatusTypeGroup typeGroup() const { return TypeGroup; }
112 
113 };
114 
115 /**
116  * @addtogroup Status
117  * @}
118  */
119 
120 #endif // STATUS_TYPE_DATA_H
121