eikmfne.h

Go to the documentation of this file.
00001 // EIKMFNE.H
00002 //
00003 // Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
00004 //
00005 
00006 #if !defined(__EIKMFNE_H__)
00007 #define __EIKMFNE_H__
00008 
00009 #if !defined(__EIKBCTRL_H__)
00010 #include <eikbctrl.h>
00011 #endif
00012 
00013 #if !defined(__COEDEF_H__)
00014 #include <coedef.h>
00015 #endif
00016 
00017 #if !defined(__COEINPUT_H__)
00018 #include <coeinput.h>
00019 #endif
00020 
00021 // For MEikCalendarObserver
00022 #if !defined(__EIKCAL_H__)
00023 #include <eikcal.h>     
00024 #endif
00025 
00026 #if !defined(__EIKDEF_H__)
00027 #include <eikdef.h>
00028 #endif
00029 
00030 #if !defined(__BABITFLAGS_H__)
00031 #include <babitflags.h>
00032 #endif
00033 
00034 // For MAknMfneCommandObserver
00035 #if !defined(__AKNMFNECOMMANDOBSERVER)
00036 #include <AknMfneCommandObserver.h>
00038 #endif
00039 
00040 //
00041 // Forward Declarations
00042 //
00043 class CEikonEnv;
00044 class CTimeEditor;
00045 class CDateEditor;
00046 
00047 // Skin-related API forward declarations
00048 class MAknsControlContext;
00049 
00050 // Extension object within CEikMfne
00051 class CEikMfneExtension;
00052 
00053 //
00057 class CEikMfneField : public CBase
00058         {
00059 public:
00063         enum THighlightType
00064                 {
00066                 EInverseVideo,
00068                 ECursor
00069                 };
00070 protected:
00076         IMPORT_C CEikMfneField();
00077 public:
00078         void Draw(CWindowGc& aGc, const CFont& aFont, const TPoint& aTopLeft) const;
00079         TInt WidthInPixels(const CFont& aFont) const;
00080         TInt DistanceFromStartOfFieldToEndOfTextInPixels(const CFont& aFont) const;
00081 
00090         virtual TInt MaximumWidthInPixels(const CFont& aFont, TBool aShrinkToMinimumSize)=0;
00091 
00098         virtual TCoeInputCapabilities InputCapabilities() const=0;
00099         
00108         IMPORT_C virtual TBool IsEditable() const;
00109         
00118         IMPORT_C virtual TBool IsValid() const;
00119         
00131         IMPORT_C virtual THighlightType HighlightType() const;
00132         
00152         IMPORT_C virtual void HandleKey(const CFont& aFont, const TKeyEvent& aKeyEvent, TBool aInterpretLeftAndRightAsEarEvents, TBool& aDataAltered, TInt& aHighlightIncrement);
00153         
00170         IMPORT_C virtual void HandleDeHighlight(const CFont& aFont, CEikonEnv& aEikonEnv, TBool& aDataAltered, TBool& aError);
00171         
00172         const TDesC& FieldText() const;
00173 protected:
00183         IMPORT_C void HandleLeftOrRightArrow(TChar aKey, TBool& aDataAltered, TInt& aHighlightIncrement);
00184 
00185     TInt AdditionalWidthForHighlights(const CFont& aFont) const;
00186 private:
00187         virtual const TDesC& Text() const=0;
00188 protected:
00192         TInt iMinimumWidthInPixels;
00193         };
00194 
00195 //
00196 
00202 NONSHARABLE_CLASS(CEikMfneSeparator) : public CEikMfneField
00203         {
00204 private:
00205         CEikMfneSeparator(HBufC* aText);
00206 public:
00212         IMPORT_C virtual ~CEikMfneSeparator();
00213         
00222         IMPORT_C static CEikMfneSeparator* NewL(TResourceReader& aResourceReader);
00223         
00230         IMPORT_C static CEikMfneSeparator* NewL(HBufC* aText); // ownership of aText is transferred when everything that can leave has successfully been done
00231         
00240         IMPORT_C void SetText(HBufC* aText); // allows later transfer of ownership of text - can only be called if aText was previously NULL
00241     
00242 private: // framework
00243         virtual TInt MaximumWidthInPixels(const CFont& aFont, TBool aShrinkToMinimumSize);
00244         virtual TCoeInputCapabilities InputCapabilities() const;
00245         virtual const TDesC& Text() const;
00246 private:
00247         HBufC* iText;
00248         };
00249 
00250 //
00251 
00255 NONSHARABLE_CLASS(CEikMfneNumber) : public CEikMfneField
00256         {
00257 public:
00263         enum
00264                 {
00266                 EFillWithLeadingZeros                   =0x1,
00268                 EPreserveOldWidthBeforeEditing  =0x2,
00270                 ERepresentsYear                                 =0x4,
00272                 EPublicallySettableFlags                =EFillWithLeadingZeros|EPreserveOldWidthBeforeEditing|ERepresentsYear
00273                 };
00274 private:
00275         enum
00276                 {
00277                 EIsBeingEditedWithCursor                =0x8,
00278                 EIsUninitialised                                =0x10,
00279                 EFillWithTrailingZeros          =0x20
00280                 };
00281 private:
00282         CEikMfneNumber(TInt aMinimumValue, TInt aMaximumValue, TUint32 aFlags);
00283         void ConstructL();
00284 public:
00290         IMPORT_C virtual ~CEikMfneNumber();
00291         
00301         IMPORT_C static CEikMfneNumber* NewL(const CFont& aFont, TResourceReader& aResourceReader);
00302 
00314         IMPORT_C static CEikMfneNumber* NewL(const CFont& aFont, TInt aMinimumValue, TInt aMaximumValue, TInt aInitialValue, TUint32 aFlags);
00315         
00324         IMPORT_C void SetMinimumAndMaximum(TInt aMinimumValue, TInt aMaximumValue, const CFont& aFont); // only values inside the initial minimum and maximum are permitted
00325         
00332         IMPORT_C void GetMinimumAndMaximum(TInt& aMinimumValue, TInt& aMaximumValue) const;
00333         
00340         IMPORT_C void SetValue(TInt aValue, const CFont& aFont);
00341         
00349         IMPORT_C TInt Value() const;
00350         
00357         IMPORT_C virtual TBool IsValid() const;
00358 
00365         IMPORT_C void SetUninitialised(TBool aUninitialised);
00366         
00372         IMPORT_C TBool IsUninitialised() const;
00373 
00374 public:
00382         IMPORT_C void SetDigitType(TDigitType aDigitType, const CFont& aFont);
00383 
00390         IMPORT_C TDigitType DigitType() const;
00391 
00398         IMPORT_C void RefreshDigitType(const CFont& aFont);
00399         
00400         void SetTrailingZeros();
00401 
00402 public:
00403         TBool IsTextNull() const;
00404 private: // framework
00405         virtual TInt MaximumWidthInPixels(const CFont& aFont, TBool aShrinkToMinimumSize);
00406         virtual TCoeInputCapabilities InputCapabilities() const;
00407         virtual TBool IsEditable() const;
00408         virtual THighlightType HighlightType() const;
00409         virtual void HandleKey(const CFont& aFont, const TKeyEvent& aKeyEvent, TBool aInterpretLeftAndRightAsEarEvents, TBool& aDataAltered, TInt& aHighlightIncrement);
00410         virtual void HandleDeHighlight(const CFont& aFont, CEikonEnv& aEikonEnv, TBool& aDataAltered, TBool& aError);
00411         virtual const TDesC& Text() const;
00412 private:
00413         TInt MaximumNumberOfDigits() const;
00414         TInt NumberOfDigits() const;
00415         void SetTextToValue(TInt aValue, const CFont& aFont);
00416         TInt ValueFromText() const;
00417         TBool ConvertsIntoValidValue(TInt& aValue) const;
00418 
00419 private: // International digit support
00420         TChar NormalizeDigit(TChar aChar);
00421         TText ZeroCharacter() const;
00422         TText NegativeCharacter() const;
00423 
00424 private:
00425         TInt iMinimumValue;
00426         TInt iMaximumValue;
00427         TInt iMaxDigits;
00428         TUint32 iFlags;
00429         HBufC* iText;
00430         TChar iNudgeCharMinus;
00431         TChar iNudgeCharPlus;
00432         TInt iMaxDigitsMinimumValue;
00433     TInt iMaxDigitsMaximumValue;
00434         TDigitType      iDigitType;
00435         };
00436 
00437 //
00438 
00444 NONSHARABLE_CLASS(CEikMfneSymbol) : public CEikMfneField
00445         {
00446 public:
00450         NONSHARABLE_CLASS(CItem) : public CBase
00451                 {
00452         private:
00453                 CItem(TInt aId, TChar aKeyToMatch, HBufC* aText);
00454         public:
00460                 IMPORT_C virtual ~CItem();
00461                 
00469                 IMPORT_C static CItem* NewL(TResourceReader& aResourceReader);
00470                 
00479                 IMPORT_C static CItem* NewL(TInt aId, TChar aKeyToMatch, HBufC* aText); // ownership of aText is transferred when everything that can leave has successfully been done
00480         
00490                 IMPORT_C void SetText(HBufC* aText); // allows later transfer of ownership of text - can only be called if aText was previously NULL
00491         private:
00492                 friend class CEikMfneSymbol;
00493         private:
00494                 TInt iId;
00495                 TCharF iKeyToMatch;
00496                 HBufC* iText;
00497                 };
00498 private:
00499         CEikMfneSymbol(TInt aNumSymbolicItems);
00500 public:
00506         IMPORT_C virtual ~CEikMfneSymbol();
00507         
00517         IMPORT_C static CEikMfneSymbol* NewL(TResourceReader& aResourceReader);
00518         
00529         IMPORT_C static CEikMfneSymbol* NewL(TInt aNumSymbolicItems);
00530 
00545         IMPORT_C void AddSymbolicItem(CItem* aSymbolicItem, TBool aMakeCurrent); // to be called by container only if not constructed from resource - ownership of aSymbolicItem is transferred to "this"
00546         
00554         IMPORT_C void SetCurrentSymbolicItemToId(TInt aId);
00555         
00561         IMPORT_C TInt IdOfCurrentSymbolicItem() const;
00562         
00569         IMPORT_C void SetUninitialised(TBool aUninitialised);
00570         
00576         IMPORT_C TBool IsUninitialised() const;
00577         
00578 private: // framework
00579         virtual TInt MaximumWidthInPixels(const CFont& aFont, TBool aShrinkToMinimumSize);
00580         virtual TCoeInputCapabilities InputCapabilities() const;
00581         virtual TBool IsEditable() const;
00582         virtual THighlightType HighlightType() const;
00583         virtual void HandleKey(const CFont& aFont, const TKeyEvent& aKeyEvent, TBool aInterpretLeftAndRightAsEarEvents, TBool& aDataAltered, TInt& aHighlightIncrement);
00584         virtual void HandleDeHighlight(const CFont& aFont, CEikonEnv& aEikonEnv, TBool& aDataAltered, TBool& aError);
00585         virtual const TDesC& Text() const;
00586 private:
00587         TInt CurrentSymbolicItem() const;
00588         void SetCurrentSymbolicItem(TInt aCurrentSymbolicItem);
00589 private:
00590         TInt iNumSymbolicItems;
00591         TInt iCurrentSymbolicItem;
00592         CItem** iSymbolicItems;
00593         };
00594 
00595 //
00596 
00621 class CEikMfne : public CEikBorderedControl, public MAknMfneCommandObserver
00622         {
00623 public:
00624         // miscellaneous functions
00628         IMPORT_C CEikMfne();
00629         
00637         IMPORT_C virtual ~CEikMfne();
00638 
00648         IMPORT_C void CreateFieldArrayL(TInt aNumFields); // to be called by container only if not constructed from resource
00649 
00665         IMPORT_C void AddField(CEikMfneField* aField); // to be called by container only if not constructed from resource - ownership of aField is transferred to "this"
00666 
00672         IMPORT_C void ResetFieldArray(); // after this CreateFieldArrayL() can be called again
00673         
00679         IMPORT_C TMargins BorderMargins() const;
00680         
00692         IMPORT_C void DrawNowAndLeaveWithTimeDateFormatInfoMsgL(TInt aResourceId, const TTime& aTimeDate) const;
00693 
00701         IMPORT_C CEikMfneField* Field(TInt aField) const;
00702         
00703 public:
00704         // some utility functions which other classes may find useful
00705         
00713         IMPORT_C static TTime ReadTime(TResourceReader& aResourceReader);
00714 
00723         IMPORT_C static TTime ReadDate(TResourceReader& aResourceReader);
00724 
00732         IMPORT_C static TTime ReadTimeAndDate(TResourceReader& aResourceReader);
00733         
00740         IMPORT_C static TTimeIntervalSeconds ReadDuration(TResourceReader& aResourceReader);
00741         
00751         IMPORT_C static TTimeIntervalSeconds ReadTimeOffset(TResourceReader& aResourceReader);
00752     
00759         IMPORT_C static TTimeIntervalSeconds Convert(const TTime& aTime);
00760     
00767         IMPORT_C static TTime Convert(const TTimeIntervalSeconds& aTimeIntervalSeconds);
00768     //
00774     inline TInt CurrentField() const;
00775 
00781     inline TInt NumFields() const;
00782 
00783 public: // AVKON addition
00789     enum TFeatureId
00790         {
00795         EClipGcToRect
00796         };    
00797     
00805     IMPORT_C void SetMfneAlignment(TInt aAlignment);
00806     
00816     IMPORT_C void SetUpAndDownKeysConsumed(TBool aConsume);
00817 
00828     IMPORT_C void SetSuppressBackgroundDrawing( TBool aSuppress );
00829 
00840     IMPORT_C TInt SetFeature( TInt aFeatureId, TInt aFeatureParam );
00841      
00853     IMPORT_C TInt GetFeature( TInt aFeatureId, TInt& aFeatureParam ) const;
00854 
00863     IMPORT_C TBool SupportsFeature( TInt aFeatureId ) const;
00864 
00865     // Highlights a field
00866     void HighlightField(  TInt aFieldPosition );
00867 
00875         IMPORT_C const CFont* Font() const;
00876         
00883         IMPORT_C void SetFont(const CFont* aFont);
00884 
00898     IMPORT_C void SetSkinBackgroundControlContextL( MAknsControlContext* aControlContext );
00899     
00900     
00908     IMPORT_C void HandleMfneCommandL(TInt aCommand);
00909     
00918     IMPORT_C void SetUseOverrideColors( TBool aUseOverrideColors );
00919 
00920 
00921 public: // from CCoeControl
00933         IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
00934 
00948         IMPORT_C virtual void PrepareForFocusLossL();
00949 
00957         IMPORT_C virtual TSize MinimumSize();
00958 
00968         IMPORT_C virtual void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const; // not available before Release 005u
00969 
00980         IMPORT_C virtual void HandleResourceChange(TInt aType);                 // not available before Release 005u
00981 
00995         IMPORT_C virtual TCoeInputCapabilities InputCapabilities() const;
00996 
01004         IMPORT_C virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);
01005 
01015         IMPORT_C virtual TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
01016 
01017 public: // new 
01026     IMPORT_C void SetSkinTextColorL(TInt aAknSkinIDForTextColor, TInt aAknSkinIDForBgColor=KErrNotFound);
01027 
01028 protected:
01029         // framework
01038         IMPORT_C virtual void FocusChanged(TDrawNow aDrawNow);
01039 
01046         IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
01047 
01048         // miscellaneous functions
01049         
01068         IMPORT_C void HandleInteraction(TBool aHandleDeHighlight, TInt aNewCurrentField, TInt aOldWidthInPixelsOfOldCurrentField,
01069                                                                 CEikMfneField::THighlightType aOldHighlightTypeOfOldCurrentField, TBool& aDataAltered, TBool& aError);
01070                                                                 
01082         IMPORT_C virtual void FieldIsAboutToBeDeHighlighted(CEikMfneField* aField, TBool& aDrawAllFields); // first occurrence of this virtual function - does nothing by default
01083         
01091         IMPORT_C TSize MfneSize() const;
01092 
01102         IMPORT_C TSize MfneSize(TBool aShrinkToMinimumSize);
01103 
01104 public:
01105         static void InvalidFieldAlert();
01106         static void LeaveWithAlert(TInt aResourceId);
01107 
01108 private:
01109         // framework
01110         IMPORT_C virtual void Draw(const TRect& aRect) const;
01111         // new virtual functions
01112         IMPORT_C virtual void CreatePopoutIfRequiredL();
01113         // miscellaneous functions
01114         void DrawRange(CWindowGc& aGc, TInt aFirstField, TInt aLastField) const;
01115         CWindowGc& PreparedGc() const;
01116         void SetGcToNormalVideo(CWindowGc& aGc) const;
01117         void SetGcToInverseVideo(CWindowGc& aGc) const;
01118         void SetGcToDimmedVideo(CWindowGc& aGc) const;
01119         void DrawCursor();
01120         void HideCursor();
01121         void ReportUpdate();
01122         IMPORT_C void Reserved_2();
01123         IMPORT_C virtual void CEikMfne_Reserved();
01124 private:
01128     IMPORT_C void* ExtensionInterface( TUid aInterface );
01129 
01130 private:
01131         enum {ENullIndex=KMaxTInt};
01132 
01139         TBool ConsumesUpAndDownKeys() const;
01140 
01151         TBool SkinningBackground() const;
01152 
01159         void EvaluateSkinningBackground(); 
01160 
01171     MAknsControlContext* SkinBackgroundControlContext() const;
01172 
01176     void CreateExtensionIfRequiredL();
01177 
01178 private:
01179         TInt iNumFields;
01180         TInt iCurrentField;
01181         CEikMfneField** iFields;
01182         CEikMfneExtension* iExtension;
01183         const CFont* iFont;
01184     TInt iAlignment;
01185     TBitFlags iFlags;
01186         };
01187 
01188 inline TInt CEikMfne::CurrentField() const
01189     {
01190     return(iCurrentField);
01191     }
01192 
01193 inline TInt CEikMfne::NumFields() const
01194     {
01195     return(iNumFields);
01196     }
01197 
01198 //
01199 
01211 class CEikNumberEditor : public CEikMfne
01212         {
01213 public:
01214         // miscellaneous functions
01215     
01224         IMPORT_C CEikNumberEditor();
01225         
01239         IMPORT_C void ConstructL(TInt aMinimumValue, TInt aMaximumValue, TInt aInitialValue); // to be called by container only if not constructed from resource
01240         
01253         IMPORT_C void SetMinimumAndMaximum(TInt aMinimumValue, TInt aMaximumValue); // only values inside the initial minimum and maximum are permitted
01254 
01263         IMPORT_C void GetMinimumAndMaximum(TInt& aMinimumValue, TInt& aMaximumValue) const;
01264 
01273         IMPORT_C void SetNumber(TInt aNumber);
01274 
01281         IMPORT_C TInt Number() const; // can only be called if PrepareForFocusLossL() succeeded
01282 
01283         // framework
01284 
01294         IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aResourceReader);
01295 
01296     // From CCoeControl
01297 
01305     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);      
01306 private:
01307         IMPORT_C virtual void CEikMfne_Reserved();
01308 private:
01309         void RefreshFromLocale();
01310 private:
01314     IMPORT_C void* ExtensionInterface( TUid aInterface );
01315 private:
01316         // none of these pointers owns anything
01317         CEikMfneNumber* iNumber;
01318         TInt iSpare;
01319         };
01320 
01321 
01322 //
01326 struct SEikRange
01327         {
01331         TInt iLowerLimit;
01332 
01336         TInt iUpperLimit;
01337         };
01338 
01339 //
01340 
01356 class CEikRangeEditor : public CEikMfne
01357         {
01358 public:
01359         // miscellaneous functions
01360     
01369         IMPORT_C CEikRangeEditor();
01370 
01371         // ConstructL to be called by container only if not constructed from resource, also ownership of aSeparatorText is transferred when everything that can leave has successfully been done
01389         IMPORT_C void ConstructL(TInt aMinimumValue, TInt aMaximumValue, const SEikRange& aInitialRange, HBufC* aSeparatorText);
01390 
01401         IMPORT_C void SetMinimumAndMaximum(TInt aMinimumValue, TInt aMaximumValue); // only values inside the initial minimum and maximum are permitted
01402 
01411         IMPORT_C void GetMinimumAndMaximum(TInt& aMinimumValue, TInt& aMaximumValue) const;
01412 
01418         IMPORT_C void SetRange(const SEikRange& aRange);
01419         
01427         IMPORT_C SEikRange Range() const; // can only be called if PrepareForFocusLossL() succeeded
01428         
01429         // framework
01430         
01440         IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aResourceReader);
01441 
01442     // From CCoeControl
01443 
01451     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
01452 private:
01453         virtual void FieldIsAboutToBeDeHighlighted(CEikMfneField* aField, TBool& aDrawAllFields);
01454         IMPORT_C virtual void CEikMfne_Reserved();
01455         void RefreshFromLocale();
01456 private:
01460     IMPORT_C void* ExtensionInterface( TUid aInterface );
01461 private:
01462         // none of these pointers owns anything
01463         CEikMfneNumber* iLowerLimit;
01464         CEikMfneNumber* iUpperLimit;
01465         TInt iSpare;
01466         };
01467 
01468 
01469 //
01470 
01475 class CEikTTimeEditor : public CEikMfne
01476         {
01477 public:
01488         virtual void SetMinimumAndMaximum(const TTime& aMinimumTime, const TTime& aMaximumTime)=0;
01489 
01497         virtual void GetMinimumAndMaximum(TTime& aMinimumTime, TTime& aMaximum) const=0;
01498     
01505         virtual void SetTTime(const TTime& aTime)=0;
01506 
01515         virtual TTime GetTTime() const=0; // can only be called if PrepareForFocusLossL() succeeded
01516         };
01517 
01535 class CEikTimeEditor : public CEikTTimeEditor
01536         {
01537 public:
01538         // miscellaneous functions
01547         IMPORT_C CEikTimeEditor();
01548 
01555         IMPORT_C virtual ~CEikTimeEditor();
01556 
01583         IMPORT_C void ConstructL(const TTime& aMinimumTime, const TTime& aMaximumTime, const TTime& aInitialTime, TUint32 aFlags); // to be called by container only if not constructed from resource
01584 
01590         IMPORT_C void SetTime(const TTime& aTime);
01591 
01597         IMPORT_C TTime Time() const;
01598 
01605         IMPORT_C void SetUninitialised(TBool aUninitialised);
01606         
01612         IMPORT_C TBool IsUninitialised() const;
01613         // from CEikTTimeEditor
01614         
01628         IMPORT_C virtual void SetMinimumAndMaximum(const TTime& aMinimumTime, const TTime& aMaximumTime); // only values inside the initial minimum and maximum are permitted
01629 
01638         IMPORT_C virtual void GetMinimumAndMaximum(TTime& aMinimumTime, TTime& aMaximumTime) const;
01639 
01640         // from CCoeControl
01641 
01654         IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aResourceReader);
01655         
01665         IMPORT_C virtual void PrepareForFocusLossL();
01666 
01674     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
01675 private:
01676         // from CEikTTimeEditor
01677         virtual void SetTTime(const TTime& aTime);
01678         virtual TTime GetTTime() const; // can only be called if PrepareForFocusLossL() succeeded
01679 private:
01680         // miscellaneous functions
01681         void DoSetMinimumAndMaximum(const TTime& aMinimumTime, const TTime& aMaximumTime);
01682         IMPORT_C virtual void CEikMfne_Reserved();
01683 private:
01687     IMPORT_C void* ExtensionInterface( TUid aInterface );
01688 private:
01689         CTimeEditor* iTimeEditor;
01690         TTime iMinimumTime;
01691         TTime iMaximumTime;
01692         TInt iSpare;
01693         };
01694 
01695 
01696 //
01697 
01698 // note: TDateTime uses zero based day numbers, so -1 on the day field
01699 #define KAknMinimumDate (TTime(TDateTime(0001, EJanuary, 1-1, 0, 0, 0, 0)))
01700 #define KAknMaximumDate (TTime(TDateTime(9999, EDecember, 31-1, 23, 59, 59, 999999)))
01701 
01720 class CEikDateEditor : public CEikTTimeEditor, private MEikCalendarObserver
01721         {
01722 
01723 public:
01724 
01725     // miscellaneous functions
01729     IMPORT_C CEikDateEditor();
01730 
01734     IMPORT_C virtual ~CEikDateEditor();
01735 
01736     // to be called by container only if not constructed from resource
01754     IMPORT_C void ConstructL(const TTime& aMinimumDate, 
01755                              const TTime& aMaximumDate, 
01756                              const TTime& aInitialDate, 
01757                              TBool aWithoutPopoutCalendar); 
01758     
01764     IMPORT_C void SetDate(const TTime& aDate);
01765 
01771         IMPORT_C TTime Date() const;
01772 
01779         IMPORT_C void SetUninitialised(TBool aUninitialised);
01780 
01786         IMPORT_C TBool IsUninitialised() const;
01787 
01788         // from CEikTTimeEditor
01789         // only values inside the initial minimum and maximum are permitted
01801     IMPORT_C virtual void SetMinimumAndMaximum(const TTime& aMinimumDate, 
01802                                                const TTime& aMaximumDate); 
01803         
01812     IMPORT_C virtual void GetMinimumAndMaximum(TTime& aMinimumDate, 
01813                                                TTime& aMaximumDate) const;
01814         
01815     // from CCoeControl
01825     IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, 
01826                                                  TEventCode aType);
01827         
01840     IMPORT_C virtual void ConstructFromResourceL(TResourceReader& 
01841                                                  aResourceReader);
01842         
01853     IMPORT_C virtual void PrepareForFocusLossL();
01854     
01862     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
01863 
01864 private:
01865 
01866     // from CEikMfne
01867     virtual void CreatePopoutIfRequiredL();
01868     // from CEikTTimeEditor
01869     virtual void SetTTime(const TTime& aDate);
01870     virtual TTime GetTTime() const; // can only be called if PrepareForFocusLossL() succeeded
01871 
01872 private:
01873 
01874     // from MEikCalendarDialogObserver
01875     virtual void GetMinimumAndMaximumAndInitialDatesForCalendarL(TTime& aMinimumDate, 
01876                                                                  TTime& aMaximumDate, 
01877                                                                  TTime& aInitialDate) const;
01878     virtual void SetDateFromCalendarAndDrawNow(const TTime& aDate);
01879     // miscellaneous functions
01880     void DoSetMinimumAndMaximum(const TTime& aMinimumDate, const TTime& aMaximumDate);
01881     IMPORT_C virtual void CEikMfne_Reserved();
01882 
01883 private:
01884 
01888     IMPORT_C void* ExtensionInterface( TUid aInterface );
01889 
01890 private:
01891 
01892         CDateEditor* iDateEditor;
01893         TTime iMinimumDate;
01894         TTime iMaximumDate;
01895         TInt iSpare;
01896         };
01897 
01898 
01899 //
01900 
01919 class CEikTimeAndDateEditor : public CEikTTimeEditor, private MEikCalendarObserver
01920         {
01921 public:
01922         // miscellaneous functions
01923 
01932         IMPORT_C CEikTimeAndDateEditor();
01933 
01940         IMPORT_C virtual ~CEikTimeAndDateEditor();
01941 
01942         // ConstructL to be called by container only if not constructed from resource, also ownership of aInterveningText is transferred when everything that can leave has successfully been done
01943 
01975         IMPORT_C void ConstructL(const TTime& aMinimumTimeAndDate, const TTime& aMaximumTimeAndDate, const TTime& aInitialTimeAndDate, TUint32 aFlags, HBufC* aInterveningText=NULL);
01976         
01983         IMPORT_C void SetTimeAndDate(const TTime& aTimeAndDate);
01984 
01990         IMPORT_C TTime TimeAndDate() const;
01991 
01998         IMPORT_C void SetUninitialised(TBool aUninitialised);
01999         
02005         IMPORT_C TBool IsUninitialised() const;
02006         
02007         // from CEikTTimeEditor
02008 
02021         IMPORT_C virtual void SetMinimumAndMaximum(const TTime& aMinimumTimeAndDate, const TTime& aMaximumTimeAndDate); // only values inside the initial minimum and maximum are permitted
02022 
02031         IMPORT_C virtual void GetMinimumAndMaximum(TTime& aMinimumTimeAndDate, TTime& aMaximumTimeAndDate) const;
02032 
02033         // from CCoeControl
02034         
02047         IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
02048 
02060         IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aResourceReader);
02061 
02071         IMPORT_C virtual void PrepareForFocusLossL();
02072 
02080     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);      
02081     
02082 private:
02083         // from CEikMfne
02084         virtual void CreatePopoutIfRequiredL(); 
02085         IMPORT_C virtual void CEikMfne_Reserved();
02086         // from CEikTTimeEditor
02087         virtual void SetTTime(const TTime& aTimeAndDate);
02088         virtual TTime GetTTime() const; // can only be called if PrepareForFocusLossL() succeeded
02089 private:
02090         // from MEikCalendarDialogObserver
02091         virtual void GetMinimumAndMaximumAndInitialDatesForCalendarL(TTime& aMinimumDate, TTime& aMaximumDate, TTime& aInitialDate) const;
02092         virtual void SetDateFromCalendarAndDrawNow(const TTime& aDate);
02093         // miscellaneous functions
02094         void DoSetMinimumAndMaximum(const TTime& aMinimumTimeAndDate, const TTime& aMaximumTimeAndDate);
02095 private:
02099     IMPORT_C void* ExtensionInterface( TUid aInterface );
02100 private:
02101         CTimeEditor* iTimeEditor;
02102         CDateEditor* iDateEditor;
02103         TTime iMinimumTimeAndDate;
02104         TTime iMaximumTimeAndDate;
02105         TInt iSpare;
02106         };
02107 
02108 
02109 //
02110 
02129 class CEikDurationEditor : public CEikMfne
02130         {
02131 public:
02132         // miscellaneous functions
02133 
02142         IMPORT_C CEikDurationEditor();
02143 
02150         IMPORT_C virtual ~CEikDurationEditor();
02151 
02176         IMPORT_C void ConstructL(const TTimeIntervalSeconds& aMinimumDuration, const TTimeIntervalSeconds& aMaximumDuration, const TTimeIntervalSeconds& aInitialDuration, TUint32 aFlags);
02177 
02187         IMPORT_C void SetMinimumAndMaximum(const TTimeIntervalSeconds& aMinimumDuration, const TTimeIntervalSeconds& aMaximumDuration); // only values inside the initial minimum and maximum are permitted
02188 
02195         IMPORT_C void GetMinimumAndMaximum(TTimeIntervalSeconds& aMinimumDuration, TTimeIntervalSeconds& aMaximumDuration) const;
02196 
02203         IMPORT_C void SetDuration(const TTimeIntervalSeconds& aDuration);
02204 
02211         IMPORT_C TTimeIntervalSeconds Duration() const; // can only be called if PrepareForFocusLossL() succeeded
02212 
02213         // framework
02214 
02225         IMPORT_C void ConstructFromResourceL(TResourceReader& aResourceReader);
02226 
02235         IMPORT_C void PrepareForFocusLossL();
02236 
02237     // From CCoeControl    
02245     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);      
02246 private:
02247         // miscellaneous functions
02248         void DoSetMinimumAndMaximum(const TTimeIntervalSeconds& aMinimumDuration, const TTimeIntervalSeconds& aMaximumDuration);
02249         IMPORT_C virtual void CEikMfne_Reserved();
02250 private:
02254     IMPORT_C void* ExtensionInterface( TUid aInterface );
02255 private:
02256         CTimeEditor* iTimeEditor;
02257         TTimeIntervalSeconds iMinimumDuration;
02258         TTimeIntervalSeconds iMaximumDuration;
02259         TInt iSpare;
02260         };
02261 
02273 class CEikTimeOffsetEditor : public CEikMfne
02274         {
02275 public:
02276         // miscellaneous functions
02277 
02286         IMPORT_C CEikTimeOffsetEditor();
02287 
02292         IMPORT_C virtual ~CEikTimeOffsetEditor();
02293 
02322         IMPORT_C void ConstructL(const TTimeIntervalSeconds& aMinimumTimeOffset, const TTimeIntervalSeconds& aMaximumTimeOffset, const TTimeIntervalSeconds& aInitialTimeOffset, TUint32 aFlags);
02323 
02337         IMPORT_C void SetMinimumAndMaximum(const TTimeIntervalSeconds& aMinimumTimeOffset, const TTimeIntervalSeconds& aMaximumTimeOffset); // only values inside the initial minimum and maximum are permitted
02338 
02347         IMPORT_C void GetMinimumAndMaximum(TTimeIntervalSeconds& aMinimumTimeOffset, TTimeIntervalSeconds& aMaximumTimeOffset) const;
02348 
02358         IMPORT_C void SetTimeOffset(const TTimeIntervalSeconds& aTimeOffset);
02359 
02365         IMPORT_C TTimeIntervalSeconds TimeOffset() const; // can only be called if PrepareForFocusLossL() succeeded
02366 
02367         // framework
02368 
02381         IMPORT_C void ConstructFromResourceL(TResourceReader& aResourceReader);
02382 
02393         IMPORT_C void PrepareForFocusLossL();
02394 
02395     // From CCoeControl    
02396 
02404     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);      
02405     
02406 private:
02407         // miscellaneous functions
02408         void DoSetMinimumAndMaximum(const TTimeIntervalSeconds& aMinimumTimeOffset, const TTimeIntervalSeconds& aMaximumTimeOffset);
02409         IMPORT_C virtual void CEikMfne_Reserved();
02410 private:
02414     IMPORT_C void* ExtensionInterface( TUid aInterface );
02415 private:
02416         CTimeEditor* iTimeEditor;
02417         TTimeIntervalSeconds iMinimumTimeOffset;
02418         TTimeIntervalSeconds iMaximumTimeOffset;
02419         // none of these pointers owns anything
02420         CEikMfneSymbol* iSign;
02421         TInt iSpare;
02422         };
02423 
02424 
02425 //
02426 // Longitude and Latitude editors removed 2.4.2002:
02427 
02428 enum
02429         {
02430         EEikOrientationNorthSouth   =0x1000,
02431         EEikOrientationWestEast     =0x2000,
02432         EEikOrientationMask=EEikOrientationNorthSouth|EEikOrientationWestEast
02433         };
02434 
02435 
02436 enum
02437         {
02438         EEikDirectionNegative,
02439         EEikDirectionPositive,
02440         EEikDirectionMask=EEikDirectionNegative|EEikDirectionPositive
02441         };
02442 
02443 
02444 enum TEikCompass
02445         {
02446         EEikCompassNorth=EEikOrientationNorthSouth|EEikDirectionNegative,
02447         EEikCompassSouth=EEikOrientationNorthSouth|EEikDirectionPositive,
02448         EEikCompassEast=EEikOrientationWestEast|EEikDirectionNegative,
02449         EEikCompassWest=EEikOrientationWestEast|EEikDirectionPositive
02450         };
02451 
02452 
02453 struct SEikDegreesMinutesDirection
02454         {
02455         TInt iDegrees;
02456         TInt iMinutes;
02457         TInt iSeconds;
02458         TEikCompass iDirection;
02459         };
02460 
02461 // __EIKMFNE_H__
02462 #endif
02463 // End of file

Copyright © Nokia Corporation 2001-2008
Back to top