TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

geo.h 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. This file is part of libtdeabc.
  3. Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public
  6. License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public License
  13. along with this library; see the file COPYING.LIB. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. Boston, MA 02110-1301, USA.
  16. */
  17. #ifndef KABC_GEO_H
  18. #define KABC_GEO_H
  19. #include <tqstring.h>
  20. #include <tdelibs_export.h>
  21. namespace TDEABC {
  22. /**
  23. @short Geographic position
  24. This class represents a geographic position.
  25. */
  26. class KABC_EXPORT Geo
  27. {
  28. friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Geo & );
  29. friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Geo & );
  30. public:
  31. /**
  32. Construct invalid geographics position object.
  33. */
  34. Geo();
  35. /**
  36. Construct geographics position object.
  37. @param latitude Geographical latitude
  38. @param longitude Geographical longitude
  39. */
  40. Geo( float latitude, float longitude );
  41. /**
  42. Sets the latitude.
  43. */
  44. void setLatitude( float );
  45. /**
  46. Returns the latitude.
  47. */
  48. float latitude() const;
  49. /**
  50. Sets the longitude.
  51. */
  52. void setLongitude( float );
  53. /**
  54. Returns the longitude.
  55. */
  56. float longitude() const;
  57. /**
  58. Returns, if this object contains a valid geographical position.
  59. */
  60. bool isValid() const;
  61. bool operator==( const Geo & ) const;
  62. bool operator!=( const Geo & ) const;
  63. /**
  64. Returns string representation of geographical position.
  65. */
  66. TQString asString() const;
  67. private:
  68. float mLatitude;
  69. float mLongitude;
  70. bool mValid;
  71. bool mValidLat;
  72. bool mValidLong;
  73. };
  74. KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Geo & );
  75. KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Geo & );
  76. }
  77. #endif