Upstream tarball 20080901
[amule.git] / src / IP2Country.h
blobf5fc714de4eba263d0ee2d919122b343abcbe3a9
1 //
2 // This file is part of the aMule Project.
3 //
4 // Copyright (c) 2004-2008 Marcelo Roberto Jimenez ( phoenix@amule.org )
5 // Copyright (c) 2006-2008 aMule Team ( admin@amule.org / http://www.amule.org )
6 //
7 // Any parts of this program derived from the xMule, lMule or eMule project,
8 // or contributed by third-party developers are copyrighted by their
9 // respective authors.
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 2 of the License, or
14 // (at your option) any later version.
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 // Country flags are from FAMFAMFAM (http://www.famfamfam.com)
30 // Flag icons - http://www.famfamfam.com
31 //
32 // These icons are public domain, and as such are free for any use (attribution appreciated but not required).
33 //
34 // Note that these flags are named using the ISO3166-1 alpha-2 country codes where appropriate.
35 // A list of codes can be found at http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
37 // If you find these icons useful, please donate via paypal to mjames@gmail.com
38 // (or click the donate button available at http://www.famfamfam.com/lab/icons/silk)
39 //
40 // Contact: mjames@gmail.com
43 #ifndef IP2COUNTRY_H
44 #define IP2COUNTRY_H
47 #include <GeoIP.h>
49 #include <map>
51 #include <wx/bitmap.h>
52 #include <wx/string.h>
55 typedef struct {
56 wxString Name;
57 wxBitmap Flag;
58 } CountryData;
61 typedef std::map<wxString, CountryData> CountryDataMap;
64 class CIP2Country {
65 public:
66 CIP2Country();
67 ~CIP2Country();
68 const CountryData& GetCountryData(const wxString& ip);
70 private:
71 GeoIP *m_geoip;
72 CountryDataMap m_CountryDataMap;
75 #endif // IP2COUNTRY_H