2 // Tizen Web Device API
3 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #ifndef __TIZEN_EXIF_EXIF_GPS_LOCATION_H_
19 #define __TIZEN_EXIF_EXIF_GPS_LOCATION_H_
23 #include <SimpleCoordinates.h>
30 enum GPSLocationDirectionLongitude {
35 enum GPSLocationDirectionLatitude {
40 enum ExifGPSLocationAttributes {
41 EXIF_GPS_LOCATION_ATTRIBUTE_LONGITUDE = 0,
42 EXIF_GPS_LOCATION_ATTRIBUTE_LONGITUDE_REF,
43 EXIF_GPS_LOCATION_ATTRIBUTE_LATITUDE,
44 EXIF_GPS_LOCATION_ATTRIBUTE_LATITUDE_REF,
45 EXIF_GPS_LOCATION_ATTRIBUTE_NUMBER_OF_ATTRIBUTES
49 * This class represents Global Coordinate System using
50 * three Rational numbers (as stored in Exif)
55 GCSPosition(Rational degrees, Rational minutes, Rational seconds);
58 * Create GCSPosition from degrees represented as double value
60 static GCSPosition createFromDouble(double value);
63 * Verify that all components are valid Rational numbers and
64 * each component is within valid range. Sum of degrees,
65 * minutes and seconds should not be bigger then 180.0
70 * Return position in degrees
72 double toDouble() const;
75 * Return vector of three rationals: dgrees, minutes, seconds
77 Rationals toRationalsVector() const;
80 * Return string for debugging purposes
82 std::string toDebugString() const;
94 void setLongitude(const GCSPosition& longitude);
95 const GCSPosition& getLongitude() const;
97 void setLongitudeRef(GPSLocationDirectionLongitude ref);
98 GPSLocationDirectionLongitude getLongitudeRef() const;
100 void setLatitude(const GCSPosition& latitude);
101 const GCSPosition& getLatitude() const;
103 void setLatitudeRef(GPSLocationDirectionLatitude ref);
104 GPSLocationDirectionLatitude getLatitudeRef() const;
106 bool isSet(ExifGPSLocationAttributes attribute) const;
107 void unset(ExifGPSLocationAttributes attribute);
111 * Returns true only if all components are set.
113 bool isComplete() const;
116 * Returns true only if all components are set and valid.
118 bool isValid() const;
121 * Returns null pointer if any information is missing or incorrect
123 Tizen::SimpleCoordinatesPtr getSimpleCoordinates() const;
126 * Return true if scoords has been set
128 bool set(Tizen::SimpleCoordinatesPtr scoords);
132 double getLongitudeValue() const;
133 double getLatitudeValue() const;
135 GCSPosition m_longitude;
136 GPSLocationDirectionLongitude m_longitude_ref;
138 GCSPosition m_latitude;
139 GPSLocationDirectionLatitude m_latitude_ref;
141 bool m_is_set[EXIF_GPS_LOCATION_ATTRIBUTE_NUMBER_OF_ATTRIBUTES];
147 #endif // __TIZEN_EXIF_EXIF_GPS_LOCATION_H_