00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef INC_SOA_GEONAMES_H
00022 #define INC_SOA_GEONAMES_H
00023
00024 #ifndef INC_MI32_MISTRING_H
00025 #include <mi32/mistring.h>
00026 #endif
00027
00028 #ifndef INC_MI32_POINT_H
00029 #include <mi32/point.h>
00030 #endif
00031
00032 #ifndef INC_MI32_POLYLINE_H
00033 #include <mi32/polyline.h>
00034 #endif
00035
00036 #ifndef INC_MI32_MILIST_H
00037 #include <mi32/milist.h>
00038 #endif
00039
00040 namespace SOA {
00041
00042 class GEONAMES {
00043 public:
00044
00046 GEONAMES ();
00047
00049 ~GEONAMES ();
00050
00052 class RECORD {
00053 public:
00055 RECORD();
00056
00058 RECORD(const RECORD& rhs);
00059
00061 ~RECORD();
00062
00063 INT32 GetAccuracy() {return m_accuracy;}
00064
00065 void GetCountryName(MISTRING& countryname) {countryname = m_countryname;}
00066
00067 void GetExtents(DRECT2D& extents) {extents = m_extents;}
00068
00069 void GetLocation(DPOINT2D& location) {location = m_location;}
00070
00071 void GetName(MISTRING& name) {name = m_name;}
00072
00073 void SetAccuracy(INT32 accuracy) {m_accuracy = accuracy;}
00074
00075 void SetCountryName(const MISTRING& countryname) {m_countryname = countryname;}
00076
00077 void SetExtents(const DRECT2D& extents) {m_extents = extents;}
00078
00079 void SetLocation(const DPOINT2D& location) {m_location = location;}
00080
00081 void SetName(const MISTRING& name) {m_name = name;}
00082
00083 private:
00084 MISTRING m_name;
00085 MISTRING m_countryname;
00086 DPOINT2D m_location;
00087 DRECT2D m_extents;
00088 INT32 m_accuracy;
00089 };
00090
00091 enum SITE {
00092 SITE_Geonames,
00093 SITE_Google
00094 };
00095
00096 void GetRecord (
00097 RECORD& record,
00098 int index
00099 ) {record = m_list.GetIndexed(index);}
00100
00102 ERRVALUE QueryPoint (
00103 DPOINT2D& point,
00104 SITE site,
00105 MDLGPARENT dlgparent = NULL,
00106 const MISTRING& dlgmsg = NULL
00107 );
00108
00110 ERRVALUE QueryPolyline (
00111 POLYLINE& polyline,
00112 SITE site,
00113 int MaxResults = 10,
00114 MDLGPARENT dlgparent = NULL,
00115 const MISTRING& dlgmsg = NULL
00116 );
00117
00119 ERRVALUE QueryRecordList (
00120 MILIST<RECORD>& List,
00121 SITE site,
00122 int MaxResults = 10,
00123 MDLGPARENT dlgparent = NULL,
00124 const MISTRING& dlgmsg = NULL
00125 );
00126
00128 void SetName (
00129 const MISTRING& name
00130 ) {m_name = name;}
00131
00132 private:
00133
00134 #ifndef GENERATING_DOXYGEN_OUTPUT
00135 MISTRING m_name;
00136 MILIST<RECORD> m_list;
00137 #endif // GENERATING_DOXYGEN_OUTPUT
00138
00139 };
00140
00141 }
00142
00143 #endif //INC_SOA_GEONAMES_H