Debian Codegraph @

code/datastructures/NewsSource.h

raw
1 /*
2 Copyright (C) 2009-2013 wxLauncher Team
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19 #ifndef NEWS_SOURCE_H
20 #define NEWS_SOURCE_H
21
22 #include <vector>
23 #include <wx/string.h>
24
25 enum NewsSourceId {
26 NEWS_SOURCE_ID_HLP,
27 NEWS_SOURCE_ID_DIASPORA,
28 NEWS_SOURCE_ID_INVALID
29 };
30
31 class NewsSource {
32 public:
33 NewsSource(NewsSourceId id, const wxString& name,
34 const wxString& newsUrl, const wxString& label);
35
36 const NewsSourceId GetId() const { return this->id; }
37 const wxString& GetName() const { return this->name; }
38 const wxString& GetNewsUrl() const { return this->newsUrl; }
39 const wxString& GetLabel() const { return this->label; }
40
41 static const NewsSource* FindSource(NewsSourceId id);
42 static const NewsSource* FindSource(const wxString& name);
43 private:
44 NewsSourceId id;
45 wxString name;
46 wxString newsUrl;
47 wxString label;
48
49 static void InitializeSources();
50 static std::vector<NewsSource> newsSources;
51 };
52
53 #endif