aknlocationed.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : AknLocationEd.h
00004 *  Part of     : EikCtl
00005 *  Description : Location editors 
00006 *  Version     :
00007 *
00008 *  Copyright © 2006-2007 Nokia. All rights reserved.
00009 *  This material, including documentation and any related 
00010 *  computer programs, is protected by copyright controlled by 
00011 *  Nokia. All rights are reserved. Copying, including 
00012 *  reproducing, storing, adapting or translating, any 
00013 *  or all of this material requires the prior written consent of 
00014 *  Nokia. This material also contains confidential 
00015 *  information which may not be disclosed to others without the 
00016 *  prior written consent of Nokia.
00017 * ==============================================================================
00018 */
00019 #ifndef AKNLOCATIONED_H
00020 #define AKNLOCATIONED_H
00021 
00022 #include <eikmfne.h>
00023 
00024 class TPosition;
00025 class CLocationStrings;
00068 class CAknLocationEditor : public CEikMfne
00069         {
00070 public:
00076         enum TLocationContext
00077                 {
00078                 ELongitudeOnly = 0x1,
00079                 ELatitudeOnly  = 0x2
00080                 };
00084         IMPORT_C CAknLocationEditor();
00088         IMPORT_C ~CAknLocationEditor();
00096         IMPORT_C static CAknLocationEditor* NewL( TPosition &aValue, TLocationContext aContext );
00097 
00104         IMPORT_C void ConstructFromResourceL( TResourceReader& aResourceReader );
00105 
00113         IMPORT_C static HBufC* DisplayableLocationL( const TPosition &aValue, TLocationContext aContext );
00114 
00115 
00120         IMPORT_C virtual void PrepareForFocusLossL();
00121 
00128         IMPORT_C void Set(const TPosition &aValue);
00135         IMPORT_C void Get( TPosition &aValue ) const;
00140         IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
00141 private:
00142         enum TLocationType
00143                 {
00144                 EDD,
00145                 EDMM,
00146                 EDMSD
00147                 };
00148         TLocationType Type() const;
00149         static void Split( const TPosition &aValue, 
00150                                            TLocationContext aContext, 
00151                                            TInt &aDegrees, 
00152                                            TInt &aDeciDegrees, 
00153                                            TInt &aMinutes, 
00154                                            TInt &aDeciMinutes, 
00155                                            TInt &aSeconds, 
00156                                            TInt &aDeciSeconds, 
00157                                            TBool &aNeg, 
00158                                            TBool &aNan );
00159         static void SplitDD( const TPosition &aValue, 
00160                                                  TLocationContext aContext, 
00161                                                  TInt &aDegrees,
00162                                                  TInt &aDeciDegrees, 
00163                                                  TBool &aNeg, 
00164                                                  TBool &aNan );
00165         static void SplitDMM( const TPosition &aValue, 
00166                               TLocationContext aContext, 
00167                               TInt &aDegrees, 
00168                               TInt &aMinutes, 
00169                               TInt &aDeciMinutes, 
00170                               TBool &aNeg, 
00171                               TBool &aNan );
00172         static void SplitDMSD( const TPosition &aValue, 
00173                                                    TLocationContext aContext, 
00174                                                    TInt &aDegrees, 
00175                                                    TInt &aMinutes, 
00176                                                    TInt &aSeconds, 
00177                                                    TInt &aDeciSeconds, 
00178                                                    TBool &aNeg, 
00179                                                    TBool &aNan );
00180         static void CombineDD( TPosition &aValue, 
00181                                                    TLocationContext aContext, 
00182                                                    TInt aDegrees, 
00183                                                    TInt aDeciDegrees, 
00184                                                    TBool aNeg, 
00185                                                    TBool aNan );
00186         static void CombineDMM( TPosition &aValue, 
00187                                                         TLocationContext aContext, 
00188                                                         TInt aDegrees, 
00189                                                         TInt aMinutes, 
00190                                                         TInt aDeciMinutes, 
00191                                                         TBool aNeg, 
00192                                                         TBool aNan );
00193         static void CombineDMSD( TPosition &aValue, 
00194                                                          TLocationContext aContext, 
00195                                                          TInt aDegrees, 
00196                                                          TInt aMinutes, 
00197                                                          TInt aSeconds, 
00198                                                          TInt aDeciSeconds, 
00199                                                          TBool aNeg, 
00200                                                          TBool aNan );
00201 private:
00202         void SetUninitialised(TBool aInitialised);
00203         void RefreshFromLocale();
00204         void ConstructL( TPosition &aValue, TLocationContext aContext );
00205 public:
00206         void HandleCenRepChangedL(TUint32 aKey, TInt aValue);
00207         void CreateMfneFieldsL(const TPosition &aValue);
00208 private:
00209         void LoadStringsL( TInt aResourceId );
00210         
00217         TInt FieldMapping(const TInt aFieldNumber, const TLocationType aType) const;
00218 
00219 protected:
00220         IMPORT_C virtual void* CAknLocationEditor_ExtensionInterface( TUid aInterface ); 
00221 private:
00222         CLocationStrings* iStrings;
00223         TLocationContext iContext;
00224         };
00225 
00226 
00227 #endif

Copyright © Nokia Corporation 2001-2008
Back to top