example/clientapi/smf/inc/common/smfplace/smfplace.h
changeset 3 0446eb7b28aa
parent 2 86af6c333601
child 4 969092730d34
equal deleted inserted replaced
2:86af6c333601 3:0446eb7b28aa
     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 
       
    30 using namespace QtMobility; // Qt mobility - namespace
       
    31 
       
    32 typedef enum 
       
    33 {
       
    34 	SearchByStreet = 0x00,
       
    35 	SearchByLocality,
       
    36 	SearchByPostOffice,
       
    37 	SearchByTown,
       
    38 	SearchByRegion,
       
    39 	SearchByState,
       
    40 	SearchByCountry
       
    41 }SmfLocationSearchBoundary;
       
    42 
       
    43 class SmfPlacePrivate;
       
    44 
       
    45 /**
       
    46  * @ingroup smf_common_group
       
    47  * The SmfPlace class represents a place and its related information.
       
    48  * 
       
    49  * Note: This class has dependencies on QtMobility project
       
    50  */
       
    51 class SMFCLIENT_EXPORT SmfPlace : public QObject
       
    52 	{
       
    53 	Q_OBJECT
       
    54 public:
       
    55 	/**
       
    56 	 * Constructor with default argument
       
    57 	 * @param aParent The parent object
       
    58 	 */
       
    59 	SmfPlace( QObject *aParent = 0 );
       
    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 	 */
       
    71 	SmfPlace operator=( const SmfPlace &aOther );
       
    72 	
       
    73 	/**
       
    74 	 * Destructor
       
    75 	 */
       
    76 	~SmfPlace( );
       
    77 	
       
    78 	/**
       
    79 	 * Method to get the place name
       
    80 	 * @return The place name
       
    81 	 */
       
    82 	QString name( ) const;
       
    83 	
       
    84 	/**
       
    85 	 * Method to get the city of place
       
    86 	 * @return The city of the place
       
    87 	 */
       
    88 	QString city( ) const;
       
    89 	
       
    90 	/**
       
    91 	 * Method to get the street information of place
       
    92 	 * @return The street information of the place
       
    93 	 */
       
    94 	QString street( ) const;
       
    95 	
       
    96 	/**
       
    97 	 * Method to get the zip code of place
       
    98 	 * @return The zip code of place
       
    99 	 */
       
   100 	QString zipCode( ) const;
       
   101 	
       
   102 	/**
       
   103 	 * Method to get the country of place
       
   104 	 * @return The country of place
       
   105 	 */
       
   106 	QString country( ) const;
       
   107 	
       
   108 	/**
       
   109 	 * Method to get the Geo Position information (like information gathered 
       
   110 	 * on a global position, direction and velocity at a particular point 
       
   111 	 * in time) of the place.
       
   112 	 * @return The Geo Position information of place
       
   113 	 */
       
   114 	QtMobility::QGeoPositionInfo geoPositionInfo( ) const;
       
   115 	
       
   116 	/**
       
   117 	 * Method to get the url indicating the place
       
   118 	 * @return The url indicating the place
       
   119 	 */
       
   120 	QUrl url( ) const;
       
   121 	
       
   122 	/**
       
   123 	 * Method to get the id of the place
       
   124 	 * @return The ID value 
       
   125 	 */
       
   126 	QString id( ) const;
       
   127 	
       
   128 	/**
       
   129 	 * Method to set the place name
       
   130 	 * @param aPlace The new place name
       
   131 	 */
       
   132 	void setName( const QString& aPlace );
       
   133 	
       
   134 	/**
       
   135 	 * Method to set the city of  place
       
   136 	 * @param aCity The new city of the place
       
   137 	 */
       
   138 	void setCity( const QString& aCity );
       
   139 	
       
   140 	/**
       
   141 	 * Method to set the street information of place
       
   142 	 * @param aStreet The new street information of the place
       
   143 	 */
       
   144 	void setStreet( const QString& aStreet );
       
   145 	
       
   146 	/**
       
   147 	 * Method to set the zip code of place
       
   148 	 * @param aZipCode The new zip code of place
       
   149 	 */
       
   150 	void setZipCode( const QString& aZipCode );
       
   151 	
       
   152 	/**
       
   153 	 * Method to set the country of place
       
   154 	 * @param aCountry The new country of place
       
   155 	 */
       
   156 	void setCountry( const QString& aCountry );
       
   157 	
       
   158 	/**
       
   159 	 * Method to set the Geo Postion information (like information gathered 
       
   160 	 * on a global position, direction and velocity at a particular point 
       
   161 	 * in time) of the place.
       
   162 	 * @param aGeoPosInfo The new Geo Position information of place
       
   163 	 */
       
   164 	void setGeoPositionInfo( const QtMobility::QGeoPositionInfo& aGeoPosInfo );
       
   165 	
       
   166 	/**
       
   167 	 * Method to set the url indicating the place
       
   168 	 * @param aUrl The new url indicating the place
       
   169 	 */
       
   170 	void setUrl( const QUrl& aUrl );
       
   171 	
       
   172 private:
       
   173 	QSharedDataPointer<SmfPlacePrivate> d;
       
   174 	
       
   175 	friend QDataStream &operator<<( QDataStream &aDataStream, 
       
   176 			const SmfPlace &aPlace );
       
   177 
       
   178 	friend QDataStream &operator>>( QDataStream &aDataStream, 
       
   179 			SmfPlace &aPlace );
       
   180 	
       
   181 	};
       
   182 
       
   183 
       
   184 /**
       
   185  * Method for Externalization. Writes the SmfPlace object to 
       
   186  * the stream and returns a reference to the stream.
       
   187  * @param aDataStream Stream to be written
       
   188  * @param aPlace The SmfPlace object to be externalized
       
   189  * @return reference to the written stream
       
   190  */
       
   191 QDataStream &operator<<( QDataStream &aDataStream, 
       
   192 		const SmfPlace &aPlace );
       
   193 
       
   194 /**
       
   195  * Method for Internalization. Reads a SmfPlace object from 
       
   196  * the stream and returns a reference to the stream.
       
   197  * @param aDataStream Stream to be read
       
   198  * @param aPlace The SmfPlace object to be internalized
       
   199  * @return reference to the stream
       
   200  */
       
   201 QDataStream &operator>>( QDataStream &aDataStream, 
       
   202 		SmfPlace &aPlace);
       
   203 
       
   204 #endif /* SMFPLACE_H_ */