LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
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 
15 namespace 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  {
223  AN::CatNews,
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 }
LC::AN::Field::IMLocationLocality
const Q_DECL_IMPORT QString IMLocationLocality
Exact locality, like a town or a city, a contact is currently in (QString).
Definition: anconstantsdefs.cpp:104
LC::AN::Field::MediaArtist
const Q_DECL_IMPORT QString MediaArtist
The artist of the currently playing media (QString).
Definition: anconstantsdefs.cpp:92
LC::AN::TypeIMEventMoodChange
const Q_DECL_IMPORT QString TypeIMEventMoodChange
User's mood has changed.
Definition: anconstantsdefs.cpp:51
LC::AN::TypeTerminalActivity
const Q_DECL_IMPORT QString TypeTerminalActivity
Activity in terminal window.
Definition: anconstantsdefs.cpp:75
LC::AN::TypeIMEventLocationChange
const Q_DECL_IMPORT QString TypeIMEventLocationChange
User's location has changed.
Definition: anconstantsdefs.cpp:53
LC::AN::Field::IMActivitySpecific
const Q_DECL_IMPORT QString IMActivitySpecific
Specific activity name of a contact (QString).
Definition: anconstantsdefs.cpp:97
LC::AN::Field::TerminalActive
const Q_DECL_IMPORT QString TerminalActive
Whether the terminal window is active (bool).
Definition: anconstantsdefs.cpp:95
LC::AN::Field::IMActivityGeneral
const Q_DECL_IMPORT QString IMActivityGeneral
General activity name of a contact (QString).
Definition: anconstantsdefs.cpp:96
LC::AN::Field::MediaAlbum
const Q_DECL_IMPORT QString MediaAlbum
The album of the currently playing media (QString).
Definition: anconstantsdefs.cpp:93
QList
Definition: ianrulesstorage.h:14
LC::AN::Field::NewsSourceURL
const Q_DECL_IMPORT QString NewsSourceURL
News source URL (QString).
Definition: anconstantsdefs.cpp:106
LC::Util
Definition: icoreproxy.h:33
LC::AN::TypeTerminalBell
const Q_DECL_IMPORT QString TypeTerminalBell
A bell has ringed in a terminal window.
Definition: anconstantsdefs.cpp:74
LC::AN::Field::NewsSourceName
const Q_DECL_IMPORT QString NewsSourceName
News source name (QString).
Definition: anconstantsdefs.cpp:105
LC::AN::Field::IMLocationLongitude
const Q_DECL_IMPORT QString IMLocationLongitude
Longitude of a contact's position (double).
Definition: anconstantsdefs.cpp:101
LC::AN::TypeTerminalInactivity
const Q_DECL_IMPORT QString TypeTerminalInactivity
Inactivity in terminal window.
Definition: anconstantsdefs.cpp:76
LC::AN::TypeNewsSourceBroken
const Q_DECL_IMPORT QString TypeNewsSourceBroken
News source is detected to be broken.
Definition: anconstantsdefs.cpp:81
LC::AN::CatNews
const Q_DECL_IMPORT QString CatNews
Category for news-related events.
Definition: anconstantsdefs.cpp:79
LC::AN::TypeNewsSourceUpdated
const Q_DECL_IMPORT QString TypeNewsSourceUpdated
News source got updated.
Definition: anconstantsdefs.cpp:80
LC::AN::TypeIMEventTuneChange
const Q_DECL_IMPORT QString TypeIMEventTuneChange
User's tune has changed.
Definition: anconstantsdefs.cpp:50
LC::AN::Field::MediaTitle
const Q_DECL_IMPORT QString MediaTitle
The title of the currently playing media (QString).
Definition: anconstantsdefs.cpp:91
LC::AN::Field::IMActivityText
const Q_DECL_IMPORT QString IMActivityText
Accompanying activity text entered by a contact (QString).
Definition: anconstantsdefs.cpp:98
ianemitter.h
stdanfields.h
LC::AN::Field::MediaPlaybackStatus
const Q_DECL_IMPORT QString MediaPlaybackStatus
Playback status of the URL (QString).
Definition: anconstantsdefs.cpp:90
LC::AN::CatMediaPlayer
const Q_DECL_IMPORT QString CatMediaPlayer
Category of media player-related events.
Definition: anconstantsdefs.cpp:69
constants.h
LC::AN::Field::MediaPlayerURL
const Q_DECL_IMPORT QString MediaPlayerURL
The URL to the file being played.
Definition: anconstantsdefs.cpp:89
LC::AN::Field::IMLocationCountry
const Q_DECL_IMPORT QString IMLocationCountry
Country a contact is currently in (QString).
Definition: anconstantsdefs.cpp:103
QMap
Definition: anutil.h:17
LC::AN::TypeMediaPlaybackStatus
const Q_DECL_IMPORT QString TypeMediaPlaybackStatus
A media file playback status has been changed.
Definition: anconstantsdefs.cpp:70
LC::AN::Field::MediaLength
const Q_DECL_IMPORT QString MediaLength
The length of the currently playing media (int).
Definition: anconstantsdefs.cpp:94
LC::AN::Field::IMLocationLatitude
const Q_DECL_IMPORT QString IMLocationLatitude
Latitude of a contact's position (double).
Definition: anconstantsdefs.cpp:102
LC::AN::TypeIMEventActivityChange
const Q_DECL_IMPORT QString TypeIMEventActivityChange
User's activity has changed.
Definition: anconstantsdefs.cpp:52
LC::AN::Field::IMMoodText
const Q_DECL_IMPORT QString IMMoodText
Accompanying mood text entered by a contact (QString).
Definition: anconstantsdefs.cpp:100
LC::AN::Field::IMMoodGeneral
const Q_DECL_IMPORT QString IMMoodGeneral
General mood name of a contact (QString).
Definition: anconstantsdefs.cpp:99
LC::Util::GetStdANFields
QList< ANFieldData > GetStdANFields(const QString &type)
Returns the list of the standard AN fields for the given category.
Definition: stdanfields.cpp:23
LC::AN::CatTerminal
const Q_DECL_IMPORT QString CatTerminal
Category for terminal emulation events.
Definition: anconstantsdefs.cpp:73