LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
stdanfields.cpp
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#include "stdanfields.h"
10#include <QMap>
11#include <QList>
14
15namespace LC::Util
16{
17 QList<ANFieldData> GetStdANFields (const QString& type)
18 {
19 static const QMap<QString, QList<ANFieldData>> values
20 {
21 {
23 {
24 {
26 QObject::tr ("Track title"),
27 QObject::tr ("The track that the contact is currently listening to."),
28 QVariant::String,
29 {
31 }
32 },
33 {
35 QObject::tr ("Track album"),
36 QObject::tr ("The album that the contact is currently listening to."),
37 QVariant::String,
38 {
40 }
41 },
42 {
44 QObject::tr ("Track artist"),
45 QObject::tr ("The artist the contact is currently listening to."),
46 QVariant::String,
47 {
49 }
50 },
51 {
53 QObject::tr ("Track length"),
54 QObject::tr ("Length of the track the contact is currently listening to."),
55 QVariant::Int,
56 {
58 }
59 }
60 }
61 },
62 {
64 {
65 {
67 QObject::tr ("General activity"),
68 QObject::tr ("General activity of the contact."),
69 QVariant::String,
70 {
72 }
73 },
74 {
76 QObject::tr ("Specific activity"),
77 QObject::tr ("Specific activity of the contact within the given general activity."),
78 QVariant::String,
79 {
81 }
82 },
83 {
85 QObject::tr ("Activity text"),
86 QObject::tr ("The comment set by the contact."),
87 QVariant::String,
88 {
90 }
91 }
92 }
93 },
94 {
96 {
97 {
99 QObject::tr ("Mood"),
100 QObject::tr ("The mood of the contact."),
101 QVariant::String,
102 {
104 }
105 },
106 {
108 QObject::tr ("Mood explanation text"),
109 QObject::tr ("The text accompanying the mood set by the contact."),
110 QVariant::String,
111 {
113 }
114 }
115 }
116 },
117 {
119 {
120 {
122 QObject::tr ("Latitude"),
123 QObject::tr ("The latitude of the contact's current position."),
124 QVariant::Double,
125 {
127 }
128 },
129 {
131 QObject::tr ("Longitude"),
132 QObject::tr ("The longitude of the contact's current position."),
133 QVariant::Double,
134 {
136 }
137 },
138 {
140 QObject::tr ("Country"),
141 QObject::tr ("The country the contact is currently in."),
142 QVariant::String,
143 {
145 }
146 },
147 {
149 QObject::tr ("Locality"),
150 QObject::tr ("The the exact locality (like a city or a town) the contact is currently in."),
151 QVariant::String,
152 {
154 }
155 }
156 }
157 },
158 {
160 {
161 {
163 QObject::tr ("File URL"),
164 QObject::tr ("URL to the file being played."),
165 QVariant::Url,
166 {
168 }
169 },
170 {
172 QObject::tr ("Playback status"),
173 QObject::tr ("The status of the currently playing media file."),
174 QVariant::String,
175 {
177 },
178 {
179 "Stopped",
180 "Paused",
181 "Playing"
182 }
183 },
184 {
186 QObject::tr ("Title metadata"),
187 QObject::tr ("Title of the track being played."),
188 QVariant::String,
189 {
191 }
192 },
193 {
195 QObject::tr ("Album metadata"),
196 QObject::tr ("Album of the track being played."),
197 QVariant::String,
198 {
200 }
201 },
202 {
204 QObject::tr ("Artist metadata"),
205 QObject::tr ("Artist of the track being played."),
206 QVariant::String,
207 {
209 }
210 },
211 {
213 QObject::tr ("Length metadata"),
214 QObject::tr ("Length of the track being played."),
215 QVariant::Int,
216 {
218 }
219 }
220 }
221 },
222 {
224 {
225 {
227 QObject::tr ("News source name"),
228 QObject::tr ("The name of the news source that caused the notification."),
229 QVariant::String,
230 {
233 }
234 },
235 {
237 QObject::tr ("News source URL"),
238 QObject::tr ("The URL of the news source that caused the notification."),
239 QVariant::String,
240 {
243 }
244 }
245 }
246 },
247 {
249 {
250 {
252 QObject::tr ("Terminal is active"),
253 QObject::tr ("The terminal tab that caused the notification is active."),
254 QVariant::Bool,
255 {
259 }
260 }
261 }
262 }
263 };
264
265 if (!type.isEmpty ())
266 return values.value (type);
267
268 QList<ANFieldData> result;
269 for (const auto& list : values)
270 result << list;
271 return result;
272 }
273}
Definition anutil.h:17
Q_DECL_IMPORT const QString IMActivityGeneral
General activity name of a contact (QString).
Q_DECL_IMPORT const QString IMActivitySpecific
Specific activity name of a contact (QString).
Q_DECL_IMPORT const QString TerminalActive
Whether the terminal window is active (bool).
Q_DECL_IMPORT const QString MediaAlbum
The album of the currently playing media (QString).
Q_DECL_IMPORT const QString IMLocationCountry
Country a contact is currently in (QString).
Q_DECL_IMPORT const QString IMMoodText
Accompanying mood text entered by a contact (QString).
Q_DECL_IMPORT const QString IMLocationLocality
Exact locality, like a town or a city, a contact is currently in (QString).
Q_DECL_IMPORT const QString MediaTitle
The title of the currently playing media (QString).
Q_DECL_IMPORT const QString MediaLength
The length of the currently playing media (int).
Q_DECL_IMPORT const QString NewsSourceName
News source name (QString).
Q_DECL_IMPORT const QString MediaPlayerURL
The URL to the file being played.
Q_DECL_IMPORT const QString MediaPlaybackStatus
Playback status of the URL (QString).
Q_DECL_IMPORT const QString IMMoodGeneral
General mood name of a contact (QString).
Q_DECL_IMPORT const QString IMLocationLatitude
Latitude of a contact's position (double).
Q_DECL_IMPORT const QString MediaArtist
The artist of the currently playing media (QString).
Q_DECL_IMPORT const QString IMLocationLongitude
Longitude of a contact's position (double).
Q_DECL_IMPORT const QString IMActivityText
Accompanying activity text entered by a contact (QString).
Q_DECL_IMPORT const QString NewsSourceURL
News source URL (QString).
Q_DECL_IMPORT const QString TypeTerminalActivity
Activity in terminal window.
Q_DECL_IMPORT const QString TypeIMEventActivityChange
User's activity has changed.
Q_DECL_IMPORT const QString TypeNewsSourceUpdated
News source got updated.
Q_DECL_IMPORT const QString TypeMediaPlaybackStatus
A media file playback status has been changed.
Q_DECL_IMPORT const QString TypeIMEventLocationChange
User's location has changed.
Q_DECL_IMPORT const QString CatNews
Category for news-related events.
Q_DECL_IMPORT const QString CatTerminal
Category for terminal emulation events.
Q_DECL_IMPORT const QString TypeTerminalBell
A bell has ringed in a terminal window.
Q_DECL_IMPORT const QString CatMediaPlayer
Category of media player-related events.
Q_DECL_IMPORT const QString TypeTerminalInactivity
Inactivity in terminal window.
Q_DECL_IMPORT const QString TypeIMEventTuneChange
User's tune has changed.
Q_DECL_IMPORT const QString TypeIMEventMoodChange
User's mood has changed.
Q_DECL_IMPORT const QString TypeNewsSourceBroken
News source is detected to be broken.
QList< ANFieldData > GetStdANFields(const QString &type)
Returns the list of the standard AN fields for the given category.