LeechCraft  0.6.70-13729-g7046a9d2a7
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  * Boost Software License - Version 1.0 - August 17th, 2003
6  *
7  * Permission is hereby granted, free of charge, to any person or organization
8  * obtaining a copy of the software and accompanying documentation covered by
9  * this license (the "Software") to use, reproduce, display, distribute,
10  * execute, and transmit the Software, and to prepare derivative works of the
11  * Software, and to permit third-parties to whom the Software is furnished to
12  * do so, all subject to the following:
13  *
14  * The copyright notices in the Software and this entire statement, including
15  * the above license grant, this restriction and the following disclaimer,
16  * must be included in all copies of the Software, in whole or in part, and
17  * all derivative works of the Software, unless such copies or derivative
18  * works are solely in the form of machine-executable object code generated by
19  * a source language processor.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
24  * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
25  * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
26  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  **********************************************************************/
29 
30 #include "stdanfields.h"
31 #include <QMap>
32 #include <QList>
35 
36 namespace LC
37 {
38 namespace Util
39 {
40  QList<ANFieldData> GetStdANFields (const QString& type)
41  {
42  static const QMap<QString, QList<ANFieldData>> values
43  {
44  {
46  {
47  {
49  QObject::tr ("Title metadata"),
50  QObject::tr ("Title of the track being played."),
51  QVariant::String,
52  {
54  }
55  },
56  {
58  QObject::tr ("Album metadata"),
59  QObject::tr ("Album of the track being played."),
60  QVariant::String,
61  {
63  }
64  },
65  {
67  QObject::tr ("Artist metadata"),
68  QObject::tr ("Artist of the track being played."),
69  QVariant::String,
70  {
72  }
73  },
74  {
76  QObject::tr ("Length metadata"),
77  QObject::tr ("Length of the track being played."),
78  QVariant::Int,
79  {
81  }
82  }
83  }
84  },
85  {
87  {
88  {
90  QObject::tr ("General activity"),
91  QObject::tr ("General activity of the contact."),
92  QVariant::String,
93  {
95  }
96  },
97  {
99  QObject::tr ("Specific activity"),
100  QObject::tr ("Specific activity of the contact within the given general activity."),
101  QVariant::String,
102  {
104  }
105  },
106  {
108  QObject::tr ("Activity text"),
109  QObject::tr ("The comment set by the contact."),
110  QVariant::String,
111  {
113  }
114  }
115  }
116  },
117  {
119  {
120  {
122  QObject::tr ("Mood"),
123  QObject::tr ("The mood of the contact."),
124  QVariant::String,
125  {
127  }
128  },
129  {
131  QObject::tr ("Mood explanation text"),
132  QObject::tr ("The text accompanying the mood set by the contact."),
133  QVariant::String,
134  {
136  }
137  }
138  }
139  },
140  {
142  {
143  {
145  QObject::tr ("Latitude"),
146  QObject::tr ("The latitude of the contact's current position."),
147  QVariant::Double,
148  {
150  }
151  },
152  {
154  QObject::tr ("Longitude"),
155  QObject::tr ("The longitude of the contact's current position."),
156  QVariant::Double,
157  {
159  }
160  },
161  {
163  QObject::tr ("Country"),
164  QObject::tr ("The country the contact is currently in."),
165  QVariant::String,
166  {
168  }
169  },
170  {
172  QObject::tr ("Longitude"),
173  QObject::tr ("The the exact locality (like a city or a town) the contact is currently in."),
174  QVariant::String,
175  {
177  }
178  }
179  }
180  },
181  {
183  {
184  {
186  QObject::tr ("File URL"),
187  QObject::tr ("URL to the file being played."),
188  QVariant::Url,
189  {
191  }
192  },
193  {
195  QObject::tr ("Playback status"),
196  QObject::tr ("The status of the currently playing media file."),
197  QVariant::String,
198  {
200  },
201  {
202  "Stopped",
203  "Paused",
204  "Playing"
205  }
206  },
207  {
209  QObject::tr ("Title metadata"),
210  QObject::tr ("Title of the track being played."),
211  QVariant::String,
212  {
214  }
215  },
216  {
218  QObject::tr ("Album metadata"),
219  QObject::tr ("Album of the track being played."),
220  QVariant::String,
221  {
223  }
224  },
225  {
227  QObject::tr ("Artist metadata"),
228  QObject::tr ("Artist of the track being played."),
229  QVariant::String,
230  {
232  }
233  },
234  {
236  QObject::tr ("Length metadata"),
237  QObject::tr ("Length of the track being played."),
238  QVariant::Int,
239  {
241  }
242  }
243  }
244  },
245  {
246  AN::CatNews,
247  {
248  {
250  QObject::tr ("News source name"),
251  QObject::tr ("The name of the news source that caused the notification."),
252  QVariant::String,
253  {
256  }
257  }
258  }
259  },
260  {
262  {
263  {
265  QObject::tr ("Terminal is active"),
266  QObject::tr ("The terminal tab that caused the notification is active."),
267  QVariant::Bool,
268  {
272  }
273  }
274  }
275  }
276  };
277 
278  if (!type.isEmpty ())
279  return values.value (type);
280 
281  QList<ANFieldData> result;
282  for (const auto& list : values)
283  result << list;
284  return result;
285  }
286 }
287 }
Q_DECL_IMPORT const QString CatTerminal
Category for terminal emulation events.
Q_DECL_IMPORT const QString MediaArtist
The artist of the currently playing media (QString).
Q_DECL_IMPORT const QString TypeIMEventLocationChange
User&#39;s location has changed.
Q_DECL_IMPORT const QString IMActivitySpecific
Specific activity name of a contact (QString).
Q_DECL_IMPORT const QString TypeTerminalActivity
Activity in terminal window.
Q_DECL_IMPORT const QString MediaTitle
The title of the currently playing media (QString).
Q_DECL_IMPORT const QString TerminalActive
Whether the terminal window is active (bool).
Q_DECL_IMPORT const QString IMLocationLongitude
Longitude of a contact&#39;s position (double).
Q_DECL_IMPORT const QString IMActivityText
Accompanying activity text entered by a contact (QString).
Q_DECL_IMPORT const QString TypeTerminalBell
A bell has ringed in a terminal window.
Q_DECL_IMPORT const QString TypeNewsSourceBroken
News source is detected to be broken.
Q_DECL_IMPORT const QString MediaPlayerURL
The URL to the file being played.
Q_DECL_IMPORT const QString TypeNewsSourceUpdated
News source got updated.
Q_DECL_IMPORT const QString TypeTerminalInactivity
Inactivity in terminal window.
Q_DECL_IMPORT const QString MediaAlbum
The album of the currently playing media (QString).
Q_DECL_IMPORT const QString CatNews
Category for news-related events.
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 CatMediaPlayer
Category of media player-related events.
Q_DECL_IMPORT const QString TypeMediaPlaybackStatus
A media file playback status has been changed.
Q_DECL_IMPORT const QString TypeIMEventTuneChange
User&#39;s tune has changed.
Q_DECL_IMPORT const QString TypeIMEventActivityChange
User&#39;s activity has changed.
Q_DECL_IMPORT const QString NewsSourceName
News source name (QString).
Q_DECL_IMPORT const QString IMLocationLatitude
Latitude of a contact&#39;s position (double).
Q_DECL_IMPORT const QString IMLocationCountry
Country a contact is currently in (QString).
Q_DECL_IMPORT const QString IMActivityGeneral
General activity name of a contact (QString).
Definition: constants.h:35
Q_DECL_IMPORT const QString IMMoodGeneral
General mood name of a contact (QString).
QList< ANFieldData > GetStdANFields(const QString &type)
Returns the list of the standard AN fields for the given category.
Definition: stdanfields.cpp:40
Q_DECL_IMPORT const QString MediaPlaybackStatus
Playback status of the URL (QString).
Definition: anutil.h:38
Q_DECL_IMPORT const QString TypeIMEventMoodChange
User&#39;s mood has changed.
Q_DECL_IMPORT const QString MediaLength
The length of the currently playing media (int).