⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wsengine.h

📁 Symbian智能手机操作系统源代码值的参考_服务器
💻 H
字号:
                                              //
//============================================================================
// Name     : CWSEngine from CWSEngine.h
// Part of  : WSExample
// Created  : 10/08/2005 by Forum Nokia
// Implementation notes: Declares application world server access engine class
//                       
// Version  : 1.0
// Copyright: Nokia Corporation
//============================================================================
//

#ifndef CWSENGINE_H
#define CWSENGINE_H

class   RWorldServer;

class CWSEngine : public CBase  
    {
    public:

		static CWSEngine* NewL();
		static CWSEngine* NewLC();

		/**
		 * Destructor.
		 */
		~CWSEngine();

	private:	// Constructors
		CWSEngine();
// ---------------------------------------------------------
//  CWSEngine::ConstructL()
//  Connect to world server. 
//  !!!!!!!!!!!!!!!!!!!!! Under the emulator of S60 sdk 2.1 
//  ! This is where the execution
//  ! ends in emulator with error code KErrServerTerminated
//  ! but still it works fine on actual devices.
// ---------------------------------------------------------
		void ConstructL();

    public:		// Methods
// ---------------------------------------------------------
//  CWSEngine::FindFirst()
//  Fills aCityData with the information of the city 
//  matching to aCityName.
// ---------------------------------------------------------
        TInt FindFirst( const TDesC& aCityName, 
            TCityData& aCityData );

// ---------------------------------------------------------
//  CWSEngine::FindFirst()
//  Fills aCountryData with the information of the country
//  matching to aCountryName.
// ---------------------------------------------------------
        TInt FindFirst( const TDesC& aCountryName, 
            TCountryData& aCountryData );

// ---------------------------------------------------------
//  CWSEngine::ListCitiesL()
//  Fills aCityListReturn with the names of the cities of
//  whose name match to aSearchPattern.
// ---------------------------------------------------------
        void ListCitiesL( const TDesC& aSearchPattern, 
            CDesC16ArrayFlat* aCityListReturn );

// ---------------------------------------------------------
//  CWSEngine::ListCountriesL()
//  Fills aCountryListReturn with the names of the countries
//  of whose name match to aSearchPattern.
// ---------------------------------------------------------
        void ListCountriesL( const TDesC& aSearchPattern, 
            CDesC16ArrayFlat* aCountryListReturn );

// ---------------------------------------------------------
//  CWSEngine::Sunlight()
//  Fills aSunrise and aSunset with corresponding 
//  information about city pointed by aCityData.
// ---------------------------------------------------------

        TInt Sunlight( const TCityData& aCityData, TTime& Sunrise,
            TTime& Sunset );
// ---------------------------------------------------------
//  CWSEngine::HomeCity()
//  Fill aCityData with information about current home city.
// ---------------------------------------------------------
        void HomeCity( TCityData& aCityData );

// ---------------------------------------------------------
//  CWSEngine::HomeCountry()
//  Fills aCityData with information about current home 
//  country.
// ---------------------------------------------------------
        void HomeCountry( TCountryData& aCountryData );




// ---------------------------------------------------------
//  CWSEngine::CalculateDistance()
//  Calculates the distance between the two cities
// ---------------------------------------------------------
        TInt CalculateDistance( const TDesC& aFirstCity, 
            const TDesC& aSecondCity, TInt& aDistance );

// ---------------------------------------------------------
//  CWSEngine::SetUnit()
//  Sets the distance unit for world server.
// ---------------------------------------------------------
        void SetUnit( const TWldDistanceUnits aUnit );

// ---------------------------------------------------------
//  CWSEngine::GetUnit()
//  Gets the distance unit used for world server.
// ---------------------------------------------------------
        TWldDistanceUnits GetUnit();

// ---------------------------------------------------------
//  CWSEngine::DataFileImport()
//  Import datafile to world server database.
// ---------------------------------------------------------
        TInt DataFileImport( const TDesC& aFileName );

// ---------------------------------------------------------
//  CWSEngine::DataFileExport()
//  Export datafile from world server database.
// ---------------------------------------------------------
        TInt DataFileExport( const TDesC& aFileName );

// ---------------------------------------------------------
//  CWSEngine::ResetDatabase()
//  Reset the world database to the rom version.
// ---------------------------------------------------------
        TInt ResetDatabase();

// ---------------------------------------------------------
//  CWSEngine::AddCity()
//  add city to database.
// ---------------------------------------------------------
        TInt AddCity( const TCityData& aCityData );

// ---------------------------------------------------------
//  CWSEngine::RemoveCity()
//  remove city from database.
// ---------------------------------------------------------
        TInt RemoveCity( const TDesC& aCityName );

// ---------------------------------------------------------
//  CWSEngine::AddCountry()
//  add country and capital city for the country to the
//  database.
// ---------------------------------------------------------
        TInt AddCountry( const TCountryData& aCountry,
            const TCityData& aCapitalCity );

// ---------------------------------------------------------
//  CWSEngine::RemoveCountry()
//  Remove country from database.
// ---------------------------------------------------------
        TInt RemoveCountry( const TDesC& aCountryName );

	private:	// Data
        RWorldServer    iWS;

        // used unit for distance (km/miles)
        TWldDistanceUnits   iCurrentUnit;

};

#endif

// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -