examples/ForumNokia/TZLocalizer/inc/TZLocalizerEngine.h

00001 /*
00002  * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
00003  *    
00004  * Redistribution and use in source and binary forms, with or without
00005  * modification, are permitted provided that the following conditions are met:
00006  *    
00007  *  * Redistributions of source code must retain the above copyright notice, this
00008  *    list of conditions and the following disclaimer.
00009  *  * Redistributions in binary form must reproduce the above copyright notice,
00010  *    this list of conditions and the following disclaimer in the documentation
00011  *    and/or other materials provided with the distribution.
00012  *  * Neither the name of Nokia Corporation nor the names of its contributors
00013  *    may be used to endorse or promote products derived from this software
00014  *    without specific prior written permission.
00015  *    
00016  *    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00017  *    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00018  *    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019  *    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00020  *    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00021  *    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00022  *    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00023  *    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00024  *    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00025  *    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026  *    
00027  *    Description:  
00028  */
00029 
00030 #ifndef CTZLOCALIZERENGINE_H
00031 #define CTZLOCALIZERENGINE_H
00032 
00033 #include <tz.h>
00034 #include <TzLocalizer.h>
00035 #include <TzLocalizationDataTypes.h>
00036 
00037 class CTZLocalizerEngine : public CBase  
00038     {
00039     public:
00040 
00041         static CTZLocalizerEngine* NewL();
00042         static CTZLocalizerEngine* NewLC();
00043 
00047         ~CTZLocalizerEngine();
00048 
00049     private:    // Constructors
00050         CTZLocalizerEngine();
00051         
00052 // ---------------------------------------------------------
00053 //  CTZLocalizerEngine::ConstructL()
00054 //  Connect to Time Zone server. 
00055 // ---------------------------------------------------------
00056         void ConstructL();
00057 
00058     public:     // Methods
00059 
00060 // ---------------------------------------------------------
00061 //  CTZLocalizerEngine::ListCitiesL()
00062 //  Fills aCityListReturn with the names of the cities of
00063 //  whose name match to aSearchPattern.
00064 // ---------------------------------------------------------
00065     void ListCitiesL( const TDesC& aSearchPattern, 
00066             CDesC16ArrayFlat* aCityListReturn );
00067 
00068 // ---------------------------------------------------------
00069 // CTZLocalizerEngine::RemoveCityL()
00070 // Removes a city from the user defined city collection 
00071 // ---------------------------------------------------------
00072     void RemoveCityL(const TDesC& aCityName );
00073 
00074 // ---------------------------------------------------------
00075 // TPtrC CTZLocalizerEngine::GetCityName(CTzLocalizedCity *aLocalizedCity)
00076 // Get current city name.
00077 // ---------------------------------------------------------
00078     TPtrC GetCityName(CTzLocalizedCity *aLocalizedCity);
00079 
00080 // ---------------------------------------------------------
00081 // CTZLocalizerEngine::GetCityTimeZoneId(CTzLocalizedCity *aLocalizedCity)
00082 // Get current city time zone id.
00083 // ---------------------------------------------------------    
00084     TUint16 GetCityTimeZoneId(CTzLocalizedCity *aLocalizedCity);
00085 
00086 // ---------------------------------------------------------
00087 // CTZLocalizerEngine::GetCityGroupId(CTzLocalizedCity *aLocalizedCity)
00088 // Get current city group id.
00089 // ---------------------------------------------------------
00090     TUint8 GetCityGroupId(CTzLocalizedCity *aLocalizedCity);
00091 
00092 // ---------------------------------------------------------
00093 // CTZLocalizerEngine::GetCityLocalTime()
00094 // Convert universal time to local time.
00095 // ---------------------------------------------------------    
00096     HBufC* GetCityLocalTimeL(CTzLocalizedCity *aLocalizedCity);
00097 
00098 // ---------------------------------------------------------
00099 // CTZLocalizerEngine::FindCitiesInGroupL()
00100 // Find the cities with same group id.
00101 // ---------------------------------------------------------
00102     CDesC16ArrayFlat* FindCitiesInGroupL( TInt aGroupID);
00103 
00104 // ---------------------------------------------------------
00105 //  CTZLocalizerEngine::AddCityL()
00106 //  Add a new city to the database.
00107 // ---------------------------------------------------------    
00108     CTzLocalizedCity* AddCityL(TInt aTimeZoneId, const TDesC &aCityName, TInt aGroupId=0);
00109 
00110 // ---------------------------------------------------------
00111 // CTZLocalizerEngine::FindCityL()
00112 // Find the specific city.
00113 // ---------------------------------------------------------    
00114     CTzLocalizedCity* FindCityL(const TDesC& aCityName);
00115     
00116 // ---------------------------------------------------------
00117 //  CTZLocalizerEngine::GetAllTimeZonesL()
00118 //  Fetch the localized time zone ID's
00119 // ---------------------------------------------------------
00120     CDesC16ArrayFlat* GetAllTimeZonesL();
00121 
00122 // ---------------------------------------------------------
00123 // CTZLocalizerEngine::GetAllGroupID()
00124 // Fetch the localized city group ID's
00125 // ---------------------------------------------------------    
00126     CDesC16ArrayFlat* GetAllGroupIDL();
00127     
00128 // ---------------------------------------------------------
00129 // CDesC16ArrayFlat* CTZLocalizerEngine::GetAllCitiesL()
00130 // Fetch the localized cities
00131 // ---------------------------------------------------------    
00132     CDesC16ArrayFlat* GetAllCitiesL();
00133 
00134     private:    // Data
00135 
00136 };
00137 
00138 #endif
00139 
00140 // End of File
00141 

Generated by  doxygen 1.6.2