smf/inc/common/smfplace/smfplace.h
changeset 7 be09cf1f39dd
parent 6 c39a6cfd1fb9
child 8 4102c67b6e56
child 10 77a56c951f86
equal deleted inserted replaced
6:c39a6cfd1fb9 7:be09cf1f39dd
     1 /**
       
     2  * Copyright (c) 2010 Sasken Communication Technologies Ltd.
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the "Eclipse Public License v1.0" 
       
     6  * which accompanies  this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html"
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
       
    11  *
       
    12  * Contributors:
       
    13  * Manasij Roy, Nalina Hariharan
       
    14  * 
       
    15  * Description:
       
    16  * The SmfPlace class represents a place and its related information
       
    17  * Note: This class has dependencies on QtMobility project
       
    18  *
       
    19  */
       
    20 
       
    21 #ifndef SMFPLACE_H_
       
    22 #define SMFPLACE_H_
       
    23 
       
    24 #include <QUrl>
       
    25 #include <qgeopositioninfo.h> // Qt mobility class
       
    26 #include <qdatastream.h>
       
    27 #include <QSharedData>
       
    28 #include <smfclientglobal.h>
       
    29 #include <QMetaType>
       
    30 
       
    31 // Qt mobility - namespace
       
    32 using namespace QtMobility;
       
    33 
       
    34 typedef enum 
       
    35 {
       
    36 	SearchByStreet = 0x00,
       
    37 	SearchByLocality,
       
    38 	SearchByPostOffice,
       
    39 	SearchByTown,
       
    40 	SearchByRegion,
       
    41 	SearchByState,
       
    42 	SearchByCountry
       
    43 }SmfLocationSearchBoundary;
       
    44 
       
    45 class SmfPlacePrivate;
       
    46 
       
    47 /**
       
    48  * @ingroup smf_common_group
       
    49  * The SmfPlace class represents a place and its related information.
       
    50  * 
       
    51  * Note: This class has dependencies on QtMobility project
       
    52  */
       
    53 class SMFCLIENT_EXPORT SmfPlace
       
    54 	{
       
    55 public:
       
    56 	/**
       
    57 	 * Constructor with default argument
       
    58 	 */
       
    59 	SmfPlace( );
       
    60 	
       
    61 	/**
       
    62 	 * Copy Constructor
       
    63 	 * @param aOther The reference object
       
    64 	 */
       
    65 	SmfPlace( const SmfPlace &aOther );
       
    66 	
       
    67 	/**
       
    68 	 * Overloaded = operator 
       
    69 	 * @param aOther The reference object
       
    70 	 * @return The current object reference
       
    71 	 */
       
    72 	SmfPlace& operator=( const SmfPlace &aOther );
       
    73 	
       
    74 	/**
       
    75 	 * Destructor
       
    76 	 */
       
    77 	~SmfPlace( );
       
    78 	
       
    79 	/**
       
    80 	 * Method to get the place name
       
    81 	 * @return The place name
       
    82 	 */
       
    83 	QString name( ) const;
       
    84 	
       
    85 	/**
       
    86 	 * Method to get the city of place
       
    87 	 * @return The city of the place
       
    88 	 */
       
    89 	QString city( ) const;
       
    90 	
       
    91 	/**
       
    92 	 * Method to get the street information of place
       
    93 	 * @return The street information of the place
       
    94 	 */
       
    95 	QString street( ) const;
       
    96 	
       
    97 	/**
       
    98 	 * Method to get the zip code of place
       
    99 	 * @return The zip code of place
       
   100 	 */
       
   101 	QString zipCode( ) const;
       
   102 	
       
   103 	/**
       
   104 	 * Method to get the country of place
       
   105 	 * @return The country of place
       
   106 	 */
       
   107 	QString country( ) const;
       
   108 	
       
   109 	/**
       
   110 	 * Method to get the Geo Position information (like information gathered 
       
   111 	 * on a global position, direction and velocity at a particular point 
       
   112 	 * in time) of the place.
       
   113 	 * @return The Geo Position information of place
       
   114 	 */
       
   115 	QGeoPositionInfo geoPositionInfo( ) const;
       
   116 	
       
   117 	/**
       
   118 	 * Method to get the url indicating the place
       
   119 	 * @return The url indicating the place
       
   120 	 */
       
   121 	QUrl url( ) const;
       
   122 	
       
   123 	/**
       
   124 	 * Method to get the id of the place
       
   125 	 * @return The ID value 
       
   126 	 */
       
   127 	QString id( ) const;
       
   128 	
       
   129 	/**
       
   130 	 * Method to set the place name
       
   131 	 * @param aPlace The new place name
       
   132 	 */
       
   133 	void setName( const QString& aPlace );
       
   134 	
       
   135 	/**
       
   136 	 * Method to set the city of  place
       
   137 	 * @param aCity The new city of the place
       
   138 	 */
       
   139 	void setCity( const QString& aCity );
       
   140 	
       
   141 	/**
       
   142 	 * Method to set the street information of place
       
   143 	 * @param aStreet The new street information of the place
       
   144 	 */
       
   145 	void setStreet( const QString& aStreet );
       
   146 	
       
   147 	/**
       
   148 	 * Method to set the zip code of place
       
   149 	 * @param aZipCode The new zip code of place
       
   150 	 */
       
   151 	void setZipCode( const QString& aZipCode );
       
   152 	
       
   153 	/**
       
   154 	 * Method to set the country of place
       
   155 	 * @param aCountry The new country of place
       
   156 	 */
       
   157 	void setCountry( const QString& aCountry );
       
   158 	
       
   159 	/**
       
   160 	 * Method to set the Geo Postion information (like information gathered 
       
   161 	 * on a global position, direction and velocity at a particular point 
       
   162 	 * in time) of the place.
       
   163 	 * @param aGeoPosInfo The new Geo Position information of place
       
   164 	 */
       
   165 	void setGeoPositionInfo( const QGeoPositionInfo &aGeoPosInfo );
       
   166 	
       
   167 	/**
       
   168 	 * Method to set the url indicating the place
       
   169 	 * @param aUrl The new url indicating the place
       
   170 	 */
       
   171 	void setUrl( const QUrl& aUrl );
       
   172 	
       
   173 	/**
       
   174 	 * Method to set the id of the place
       
   175 	 * @return The ID value 
       
   176 	 */
       
   177 	void setId( const QString &aId );
       
   178 	
       
   179 private:
       
   180 	QSharedDataPointer<SmfPlacePrivate> d;
       
   181 	
       
   182 	friend QDataStream &operator<<( QDataStream &aDataStream, 
       
   183 			const SmfPlace &aPlace );
       
   184 
       
   185 	friend QDataStream &operator>>( QDataStream &aDataStream, 
       
   186 			SmfPlace &aPlace );
       
   187 	
       
   188 	};
       
   189 
       
   190 
       
   191 /**
       
   192  * Method for Externalization. Writes the SmfPlace object to 
       
   193  * the stream and returns a reference to the stream.
       
   194  * @param aDataStream Stream to be written
       
   195  * @param aPlace The SmfPlace object to be externalized
       
   196  * @return reference to the written stream
       
   197  */
       
   198 QDataStream &operator<<( QDataStream &aDataStream, 
       
   199 		const SmfPlace &aPlace );
       
   200 
       
   201 /**
       
   202  * Method for Internalization. Reads a SmfPlace object from 
       
   203  * the stream and returns a reference to the stream.
       
   204  * @param aDataStream Stream to be read
       
   205  * @param aPlace The SmfPlace object to be internalized
       
   206  * @return reference to the stream
       
   207  */
       
   208 QDataStream &operator>>( QDataStream &aDataStream, 
       
   209 		SmfPlace &aPlace);
       
   210 
       
   211 
       
   212 // Make the class SmfPlace known to QMetaType, so that as to register it.
       
   213 Q_DECLARE_METATYPE(SmfPlace)
       
   214 
       
   215 
       
   216 #endif /* SMFPLACE_H_ */