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>
00037 #endif 
00038 
00039 //
00040 // Forward Declarations
00041 //
00042 class CEikonEnv;
00043 class CTimeEditor;
00044 class CDateEditor;
00045 
00046 // Skin-related API forward declarations
00047 class MAknsControlContext;
00048 
00049 // Extension object within CEikMfne
00050 class CEikMfneExtension;
00051 
00052 //
00056 class CEikMfneField : public CBase
00057         {
00058 public:
00062         enum THighlightType
00063                 {
00065                 EInverseVideo,
00067                 ECursor
00068                 };
00069 protected:
00075         IMPORT_C CEikMfneField();
00076 public:
00077         void Draw(CWindowGc& aGc, const CFont& aFont, const TPoint& aTopLeft) const;
00078         TInt WidthInPixels(const CFont& aFont) const;
00079         TInt DistanceFromStartOfFieldToEndOfTextInPixels(const CFont& aFont) const;
00080 
00089         virtual TInt MaximumWidthInPixels(const CFont& aFont, TBool aShrinkToMinimumSize)=0;
00090 
00097         virtual TCoeInputCapabilities InputCapabilities() const=0;
00098         
00107         IMPORT_C virtual TBool IsEditable() const;
00108         
00117         IMPORT_C virtual TBool IsValid() const;
00118         
00130         IMPORT_C virtual THighlightType HighlightType() const;
00131         
00151         IMPORT_C virtual void HandleKey(const CFont& aFont, const TKeyEvent& aKeyEvent, TBool aInterpretLeftAndRightAsEarEvents, TBool& aDataAltered, TInt& aHighlightIncrement);
00152         
00169         IMPORT_C virtual void HandleDeHighlight(const CFont& aFont, CEikonEnv& aEikonEnv, TBool& aDataAltered, TBool& aError);
00170         
00171         const TDesC& FieldText() const;
00172 protected:
00182         IMPORT_C void HandleLeftOrRightArrow(TChar aKey, TBool& aDataAltered, TInt& aHighlightIncrement);
00183 
00184     TInt AdditionalWidthForHighlights(const CFont& aFont) const;
00185 private:
00186         virtual const TDesC& Text() const=0;
00187 protected:
00191         TInt iMinimumWidthInPixels;
00192         };
00193 
00194 //
00195 
00201 NONSHARABLE_CLASS(CEikMfneSeparator) : public CEikMfneField
00202         {
00203 private:
00204         CEikMfneSeparator(HBufC* aText);
00205 public:
00211         IMPORT_C virtual ~CEikMfneSeparator();
00212         
00221         IMPORT_C static CEikMfneSeparator* NewL(TResourceReader& aResourceReader);
00222         
00229         IMPORT_C static CEikMfneSeparator* NewL(HBufC* aText); // ownership of aText is transferred when everything that can leave has successfully been done
00230         
00239         IMPORT_C void SetText(HBufC* aText); // allows later transfer of ownership of text - can only be called if aText was previously NULL
00240     
00241 private: // framework
00242         virtual TInt MaximumWidthInPixels(const CFont& aFont, TBool aShrinkToMinimumSize);
00243         virtual TCoeInputCapabilities InputCapabilities() const;
00244         virtual const TDesC& Text() const;
00245 private:
00246         HBufC* iText;
00247         };
00248 
00249 //
00250 
00254 NONSHARABLE_CLASS(CEikMfneNumber) : public CEikMfneField
00255         {
00256 public:
00262         enum
00263                 {
00265                 EFillWithLeadingZeros                   =0x1,
00267                 EPreserveOldWidthBeforeEditing  =0x2,
00269                 ERepresentsYear                                 =0x4,
00271                 EPublicallySettableFlags                =EFillWithLeadingZeros|EPreserveOldWidthBeforeEditing|ERepresentsYear
00272                 };
00273 private:
00274         enum
00275                 {
00276                 EIsBeingEditedWithCursor                =0x8,
00277                 EIsUninitialised                                =0x10,
00278                 EFillWithTrailingZeros          =0x20
00279                 };
00280 private:
00281         CEikMfneNumber(TInt aMinimumValue, TInt aMaximumValue, TUint32 aFlags);
00282         void ConstructL();
00283 public:
00289         IMPORT_C virtual ~CEikMfneNumber();
00290         
00300         IMPORT_C static CEikMfneNumber* NewL(const CFont& aFont, TResourceReader& aResourceReader);
00301 
00313         IMPORT_C static CEikMfneNumber* NewL(const CFont& aFont, TInt aMinimumValue, TInt aMaximumValue, TInt aInitialValue, TUint32 aFlags);
00314         
00323         IMPORT_C void SetMinimumAndMaximum(TInt aMinimumValue, TInt aMaximumValue, const CFont& aFont); // only values inside the initial minimum and maximum are permitted
00324         
00331         IMPORT_C void GetMinimumAndMaximum(TInt& aMinimumValue, TInt& aMaximumValue) const;
00332         
00339         IMPORT_C void SetValue(TInt aValue, const CFont& aFont);
00340         
00348         IMPORT_C TInt Value() const;
00349         
00356         IMPORT_C virtual TBool IsValid() const;
00357 
00364         IMPORT_C void SetUninitialised(TBool aUninitialised);
00365         
00371         IMPORT_C TBool IsUninitialised() const;
00372 
00373 public:
00381         IMPORT_C void SetDigitType(TDigitType aDigitType, const CFont& aFont);
00382 
00389         IMPORT_C TDigitType DigitType() const;
00390 
00397         IMPORT_C void RefreshDigitType(const CFont& aFont);
00398         
00399         void SetTrailingZeros();
00400 
00401 public:
00402         TBool IsTextNull() const;
00403 private: // framework
00404         virtual TInt MaximumWidthInPixels(const CFont& aFont, TBool aShrinkToMinimumSize);
00405         virtual TCoeInputCapabilities InputCapabilities() const;
00406         virtual TBool IsEditable() const;
00407         virtual THighlightType HighlightType() const;
00408         virtual void HandleKey(const CFont& aFont, const TKeyEvent& aKeyEvent, TBool aInterpretLeftAndRightAsEarEvents, TBool& aDataAltered, TInt& aHighlightIncrement);
00409         virtual void HandleDeHighlight(const CFont& aFont, CEikonEnv& aEikonEnv, TBool& aDataAltered, TBool& aError);
00410         virtual const TDesC& Text() const;
00411 private:
00412         TInt MaximumNumberOfDigits() const;
00413         TInt NumberOfDigits() const;
00414         void SetTextToValue(TInt aValue, const CFont& aFont);
00415         TInt ValueFromText() const;
00416         TBool ConvertsIntoValidValue(TInt& aValue) const;
00417 
00418 private: // International digit support
00419         TChar NormalizeDigit(TChar aChar);
00420         TText ZeroCharacter() const;
00421         TText NegativeCharacter() const;
00422 
00423 private:
00424         TInt iMinimumValue;
00425         TInt iMaximumValue;
00426         TInt iMaxDigits;
00427         TUint32 iFlags;
00428         HBufC* iText;
00429         TChar iNudgeCharMinus;
00430         TChar iNudgeCharPlus;
00431         TInt iMaxDigitsMinimumValue;
00432     TInt iMaxDigitsMaximumValue;
00433         TDigitType      iDigitType;
00434         };
00435 
00436 //
00437 
00443 NONSHARABLE_CLASS(CEikMfneSymbol) : public CEikMfneField
00444         {
00445 public:
00449         NONSHARABLE_CLASS(CItem) : public CBase
00450                 {
00451         private:
00452                 CItem(TInt aId, TChar aKeyToMatch, HBufC* aText);
00453         public:
00459                 IMPORT_C virtual ~CItem();
00460                 
00468                 IMPORT_C static CItem* NewL(TResourceReader& aResourceReader);
00469                 
00478                 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
00479         
00489                 IMPORT_C void SetText(HBufC* aText); // allows later transfer of ownership of text - can only be called if aText was previously NULL
00490         private:
00491                 friend class CEikMfneSymbol;
00492         private:
00493                 TInt iId;
00494                 TCharF iKeyToMatch;
00495                 HBufC* iText;
00496                 };
00497 private:
00498         CEikMfneSymbol(TInt aNumSymbolicItems);
00499 public:
00505         IMPORT_C virtual ~CEikMfneSymbol();
00506         
00516         IMPORT_C static CEikMfneSymbol* NewL(TResourceReader& aResourceReader);
00517         
00528         IMPORT_C static CEikMfneSymbol* NewL(TInt aNumSymbolicItems);
00529 
00544         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"
00545         
00553         IMPORT_C void SetCurrentSymbolicItemToId(TInt aId);
00554         
00560         IMPORT_C TInt IdOfCurrentSymbolicItem() const;
00561         
00568         IMPORT_C void SetUninitialised(TBool aUninitialised);
00569         
00575         IMPORT_C TBool IsUninitialised() const;
00576         
00577 private: // framework
00578         virtual TInt MaximumWidthInPixels(const CFont& aFont, TBool aShrinkToMinimumSize);
00579         virtual TCoeInputCapabilities InputCapabilities() const;
00580         virtual TBool IsEditable() const;
00581         virtual THighlightType HighlightType() const;
00582         virtual void HandleKey(const CFont& aFont, const TKeyEvent& aKeyEvent, TBool aInterpretLeftAndRightAsEarEvents, TBool& aDataAltered, TInt& aHighlightIncrement);
00583         virtual void HandleDeHighlight(const CFont& aFont, CEikonEnv& aEikonEnv, TBool& aDataAltered, TBool& aError);
00584         virtual const TDesC& Text() const;
00585 private:
00586         TInt CurrentSymbolicItem() const;
00587         void SetCurrentSymbolicItem(TInt aCurrentSymbolicItem);
00588 private:
00589         TInt iNumSymbolicItems;
00590         TInt iCurrentSymbolicItem;
00591         CItem** iSymbolicItems;
00592         };
00593 
00594 //
00595 
00620 class CEikMfne : public CEikBorderedControl, public MAknMfneCommandObserver
00621         {
00622 public:
00623         // miscellaneous functions
00627         IMPORT_C CEikMfne();
00628         
00636         IMPORT_C virtual ~CEikMfne();
00637 
00647         IMPORT_C void CreateFieldArrayL(TInt aNumFields); // to be called by container only if not constructed from resource
00648 
00664         IMPORT_C void AddField(CEikMfneField* aField); // to be called by container only if not constructed from resource - ownership of aField is transferred to "this"
00665 
00671         IMPORT_C void ResetFieldArray(); // after this CreateFieldArrayL() can be called again
00672         
00678         IMPORT_C TMargins BorderMargins() const;
00679         
00691         IMPORT_C void DrawNowAndLeaveWithTimeDateFormatInfoMsgL(TInt aResourceId, const TTime& aTimeDate) const;
00692 
00700         IMPORT_C CEikMfneField* Field(TInt aField) const;
00701         
00702 public:
00703         // some utility functions which other classes may find useful
00704         
00712         IMPORT_C static TTime ReadTime(TResourceReader& aResourceReader);
00713 
00722         IMPORT_C static TTime ReadDate(TResourceReader& aResourceReader);
00723 
00731         IMPORT_C static TTime ReadTimeAndDate(TResourceReader& aResourceReader);
00732         
00739         IMPORT_C static TTimeIntervalSeconds ReadDuration(TResourceReader& aResourceReader);
00740         
00750         IMPORT_C static TTimeIntervalSeconds ReadTimeOffset(TResourceReader& aResourceReader);
00751     
00758         IMPORT_C static TTimeIntervalSeconds Convert(const TTime& aTime);
00759     
00766         IMPORT_C static TTime Convert(const TTimeIntervalSeconds& aTimeIntervalSeconds);
00767     //
00773     inline TInt CurrentField() const;
00774 
00780     inline TInt NumFields() const;
00781 
00782 public: // AVKON addition
00788     enum TFeatureId
00789         {
00794         EClipGcToRect,
00795         
00799         EDisablePenInput,
00800         
00802         EFingerSupport
00803         };
00809     enum TFingerSupportParams
00810         {
00811         EDisaleFingerSupport,
00812         EnableFingerSupport,
00813         EnableWithAllHighlight
00814         };
00815     
00823     IMPORT_C void SetMfneAlignment(TInt aAlignment);
00824     
00834     IMPORT_C void SetUpAndDownKeysConsumed(TBool aConsume);
00835 
00846     IMPORT_C void SetSuppressBackgroundDrawing( TBool aSuppress );
00847 
00858     IMPORT_C TInt SetFeature( TInt aFeatureId, TInt aFeatureParam );
00859      
00871     IMPORT_C TInt GetFeature( TInt aFeatureId, TInt& aFeatureParam ) const;
00872 
00881     IMPORT_C TBool SupportsFeature( TInt aFeatureId ) const;
00882 
00883     // Highlights a field
00884     void HighlightField(  TInt aFieldPosition );
00885 
00893         IMPORT_C const CFont* Font() const;
00894         
00901         IMPORT_C void SetFont(const CFont* aFont);
00902 
00916     IMPORT_C void SetSkinBackgroundControlContextL( MAknsControlContext* aControlContext );
00917     
00918     
00926     IMPORT_C void HandleMfneCommandL(TInt aCommand);
00927     
00936     IMPORT_C void SetUseOverrideColors( TBool aUseOverrideColors );
00937 
00938 
00939 public: // from CCoeControl
00951         IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
00952 
00966         IMPORT_C virtual void PrepareForFocusLossL();
00967 
00975         IMPORT_C virtual TSize MinimumSize();
00976 
00986         IMPORT_C virtual void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const; // not available before Release 005u
00987 
00998         IMPORT_C virtual void HandleResourceChange(TInt aType);                 // not available before Release 005u
00999 
01013         IMPORT_C virtual TCoeInputCapabilities InputCapabilities() const;
01014 
01022         IMPORT_C virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);
01023 
01033         IMPORT_C virtual TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
01034 
01035 public: // new 
01044     IMPORT_C void SetSkinTextColorL(TInt aAknSkinIDForTextColor, TInt aAknSkinIDForBgColor=KErrNotFound);
01045 
01046 protected:
01047         // framework
01056         IMPORT_C virtual void FocusChanged(TDrawNow aDrawNow);
01057 
01064         IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
01065 
01066         // miscellaneous functions
01067         
01086         IMPORT_C void HandleInteraction(TBool aHandleDeHighlight, TInt aNewCurrentField, TInt aOldWidthInPixelsOfOldCurrentField,
01087                                                                 CEikMfneField::THighlightType aOldHighlightTypeOfOldCurrentField, TBool& aDataAltered, TBool& aError);
01088                                                                 
01100         IMPORT_C virtual void FieldIsAboutToBeDeHighlighted(CEikMfneField* aField, TBool& aDrawAllFields); // first occurrence of this virtual function - does nothing by default
01101         
01109         IMPORT_C TSize MfneSize() const;
01110 
01120         IMPORT_C TSize MfneSize(TBool aShrinkToMinimumSize);
01121 
01122     IMPORT_C virtual void SizeChanged();
01123     
01124 public:
01125         static void InvalidFieldAlert();
01126         static void LeaveWithAlert(TInt aResourceId);   
01127         void GetCursorInfo( TPoint& aPos, TInt& aHeight, TInt& aWidth, TInt& aAscent );
01128     void ReportUpdate();
01129     IMPORT_C virtual void MakeVisible(TBool aVisible);
01130     void SetCurrentField( TInt aCurrentField );
01131     void SetValidateCallBack( TCallBack aCallBack );
01132     void ReportStateChangeEventL();
01133     
01134 private:
01135         // framework
01136         IMPORT_C virtual void Draw(const TRect& aRect) const;
01137         
01138         // new virtual functions
01139         IMPORT_C virtual void CreatePopoutIfRequiredL();
01140         // miscellaneous functions
01141         void DrawRange(CWindowGc& aGc, TInt aFirstField, TInt aLastField) const;
01142         CWindowGc& PreparedGc() const;
01143         void SetGcToNormalVideo(CWindowGc& aGc) const;
01144         void SetGcToInverseVideo(CWindowGc& aGc) const;
01145         void SetGcToDimmedVideo(CWindowGc& aGc) const;
01146         void DrawCursor();
01147         void HideCursor();      
01148         IMPORT_C void Reserved_2();
01149         IMPORT_C virtual void CEikMfne_Reserved();
01150         
01151 private:
01155     IMPORT_C void* ExtensionInterface( TUid aInterface );
01156 
01157 private:
01158         enum {ENullIndex=KMaxTInt};
01159 
01166         TBool ConsumesUpAndDownKeys() const;
01167 
01178         TBool SkinningBackground() const;
01179 
01186         void EvaluateSkinningBackground(); 
01187 
01198     MAknsControlContext* SkinBackgroundControlContext() const;
01199 
01203     void CreateExtensionIfRequiredL();
01204 
01205 private:
01206         TInt iNumFields;
01207         TInt iCurrentField;
01208         CEikMfneField** iFields;
01209         CEikMfneExtension* iExtension;
01210         const CFont* iFont;
01211     TInt iAlignment;
01212     TBitFlags iFlags;
01213         };
01214 
01215 inline TInt CEikMfne::CurrentField() const
01216     {
01217     return(iCurrentField);
01218     }
01219 
01220 inline TInt CEikMfne::NumFields() const
01221     {
01222     return(iNumFields);
01223     }
01224 
01225 //
01226 
01238 class CEikNumberEditor : public CEikMfne
01239         {
01240 public:
01241         // miscellaneous functions
01242     
01251         IMPORT_C CEikNumberEditor();
01252         
01266         IMPORT_C void ConstructL(TInt aMinimumValue, TInt aMaximumValue, TInt aInitialValue); // to be called by container only if not constructed from resource
01267         
01280         IMPORT_C void SetMinimumAndMaximum(TInt aMinimumValue, TInt aMaximumValue); // only values inside the initial minimum and maximum are permitted
01281 
01290         IMPORT_C void GetMinimumAndMaximum(TInt& aMinimumValue, TInt& aMaximumValue) const;
01291 
01300         IMPORT_C void SetNumber(TInt aNumber);
01301 
01308         IMPORT_C TInt Number() const; // can only be called if PrepareForFocusLossL() succeeded
01309 
01310         // framework
01311 
01321         IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aResourceReader);
01322 
01323     // From CCoeControl
01324 
01332     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);      
01333 private:
01334         IMPORT_C virtual void CEikMfne_Reserved();
01335 private:
01336         void RefreshFromLocale();
01337 private:
01341     IMPORT_C void* ExtensionInterface( TUid aInterface );
01342 private:
01343         // none of these pointers owns anything
01344         CEikMfneNumber* iNumber;
01345         TInt iSpare;
01346         };
01347 
01348 
01349 //
01353 struct SEikRange
01354         {
01358         TInt iLowerLimit;
01359 
01363         TInt iUpperLimit;
01364         };
01365 
01366 //
01367 
01383 class CEikRangeEditor : public CEikMfne
01384         {
01385 public:
01386         // miscellaneous functions
01387     
01396         IMPORT_C CEikRangeEditor();
01397 
01398         // 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
01416         IMPORT_C void ConstructL(TInt aMinimumValue, TInt aMaximumValue, const SEikRange& aInitialRange, HBufC* aSeparatorText);
01417 
01428         IMPORT_C void SetMinimumAndMaximum(TInt aMinimumValue, TInt aMaximumValue); // only values inside the initial minimum and maximum are permitted
01429 
01438         IMPORT_C void GetMinimumAndMaximum(TInt& aMinimumValue, TInt& aMaximumValue) const;
01439 
01445         IMPORT_C void SetRange(const SEikRange& aRange);
01446         
01454         IMPORT_C SEikRange Range() const; // can only be called if PrepareForFocusLossL() succeeded
01455         
01456         // framework
01457         
01467         IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aResourceReader);
01468 
01469     // From CCoeControl
01470 
01478     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
01479 private:
01480         virtual void FieldIsAboutToBeDeHighlighted(CEikMfneField* aField, TBool& aDrawAllFields);
01481         IMPORT_C virtual void CEikMfne_Reserved();
01482         void RefreshFromLocale();
01483 private:
01487     IMPORT_C void* ExtensionInterface( TUid aInterface );
01488 private:
01489         // none of these pointers owns anything
01490         CEikMfneNumber* iLowerLimit;
01491         CEikMfneNumber* iUpperLimit;
01492         TInt iSpare;
01493         };
01494 
01495 
01496 //
01497 
01502 class CEikTTimeEditor : public CEikMfne
01503         {
01504 public:
01515         virtual void SetMinimumAndMaximum(const TTime& aMinimumTime, const TTime& aMaximumTime)=0;
01516 
01524         virtual void GetMinimumAndMaximum(TTime& aMinimumTime, TTime& aMaximum) const=0;
01525     
01532         virtual void SetTTime(const TTime& aTime)=0;
01533 
01542         virtual TTime GetTTime() const=0; // can only be called if PrepareForFocusLossL() succeeded
01543         };
01544 
01562 class CEikTimeEditor : public CEikTTimeEditor
01563         {
01564 public:
01565         // miscellaneous functions
01574         IMPORT_C CEikTimeEditor();
01575 
01582         IMPORT_C virtual ~CEikTimeEditor();
01583 
01610         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
01611 
01617         IMPORT_C void SetTime(const TTime& aTime);
01618 
01624         IMPORT_C TTime Time() const;
01625 
01632         IMPORT_C void SetUninitialised(TBool aUninitialised);
01633         
01639         IMPORT_C TBool IsUninitialised() const;
01640         // from CEikTTimeEditor
01641         
01655         IMPORT_C virtual void SetMinimumAndMaximum(const TTime& aMinimumTime, const TTime& aMaximumTime); // only values inside the initial minimum and maximum are permitted
01656 
01665         IMPORT_C virtual void GetMinimumAndMaximum(TTime& aMinimumTime, TTime& aMaximumTime) const;
01666 
01667         // from CCoeControl
01668 
01681         IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aResourceReader);
01682         
01692         IMPORT_C virtual void PrepareForFocusLossL();
01693 
01701     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
01702 private:
01703         // from CEikTTimeEditor
01704         virtual void SetTTime(const TTime& aTime);
01705         virtual TTime GetTTime() const; // can only be called if PrepareForFocusLossL() succeeded
01706 private:
01707         // miscellaneous functions
01708         void DoSetMinimumAndMaximum(const TTime& aMinimumTime, const TTime& aMaximumTime);
01709         IMPORT_C virtual void CEikMfne_Reserved();
01710 private:
01714     IMPORT_C void* ExtensionInterface( TUid aInterface );
01715 private:
01716         CTimeEditor* iTimeEditor;
01717         TTime iMinimumTime;
01718         TTime iMaximumTime;
01719         TInt iSpare;
01720         };
01721 
01722 
01723 //
01724 
01725 // note: TDateTime uses zero based day numbers, so -1 on the day field
01726 #define KAknMinimumDate (TTime(TDateTime(0001, EJanuary, 1-1, 0, 0, 0, 0)))
01727 #define KAknMaximumDate (TTime(TDateTime(9999, EDecember, 31-1, 23, 59, 59, 999999)))
01728 
01747 class CEikDateEditor : public CEikTTimeEditor, private MEikCalendarObserver
01748         {
01749 
01750 public:
01751 
01752     // miscellaneous functions
01756     IMPORT_C CEikDateEditor();
01757 
01761     IMPORT_C virtual ~CEikDateEditor();
01762 
01763     // to be called by container only if not constructed from resource
01781     IMPORT_C void ConstructL(const TTime& aMinimumDate, 
01782                              const TTime& aMaximumDate, 
01783                              const TTime& aInitialDate, 
01784                              TBool aWithoutPopoutCalendar); 
01785     
01791     IMPORT_C void SetDate(const TTime& aDate);
01792 
01798         IMPORT_C TTime Date() const;
01799 
01806         IMPORT_C void SetUninitialised(TBool aUninitialised);
01807 
01813         IMPORT_C TBool IsUninitialised() const;
01814 
01815         // from CEikTTimeEditor
01816         // only values inside the initial minimum and maximum are permitted
01828     IMPORT_C virtual void SetMinimumAndMaximum(const TTime& aMinimumDate, 
01829                                                const TTime& aMaximumDate); 
01830         
01839     IMPORT_C virtual void GetMinimumAndMaximum(TTime& aMinimumDate, 
01840                                                TTime& aMaximumDate) const;
01841         
01842     // from CCoeControl
01852     IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, 
01853                                                  TEventCode aType);
01854         
01867     IMPORT_C virtual void ConstructFromResourceL(TResourceReader& 
01868                                                  aResourceReader);
01869         
01880     IMPORT_C virtual void PrepareForFocusLossL();
01881     
01889     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
01890 
01891 private:
01892 
01893     // from CEikMfne
01894     virtual void CreatePopoutIfRequiredL();
01895     // from CEikTTimeEditor
01896     virtual void SetTTime(const TTime& aDate);
01897     virtual TTime GetTTime() const; // can only be called if PrepareForFocusLossL() succeeded
01898 
01899 private:
01900 
01901     // from MEikCalendarDialogObserver
01902     virtual void GetMinimumAndMaximumAndInitialDatesForCalendarL(TTime& aMinimumDate, 
01903                                                                  TTime& aMaximumDate, 
01904                                                                  TTime& aInitialDate) const;
01905     virtual void SetDateFromCalendarAndDrawNow(const TTime& aDate);
01906     // miscellaneous functions
01907     void DoSetMinimumAndMaximum(const TTime& aMinimumDate, const TTime& aMaximumDate);
01908     IMPORT_C virtual void CEikMfne_Reserved();
01909 
01910 private:
01911 
01915     IMPORT_C void* ExtensionInterface( TUid aInterface );
01916 
01917 private:
01918 
01919         CDateEditor* iDateEditor;
01920         TTime iMinimumDate;
01921         TTime iMaximumDate;
01922         TInt iSpare;
01923         };
01924 
01925 
01926 //
01927 
01946 class CEikTimeAndDateEditor : public CEikTTimeEditor, private MEikCalendarObserver
01947         {
01948 public:
01949         // miscellaneous functions
01950 
01959         IMPORT_C CEikTimeAndDateEditor();
01960 
01967         IMPORT_C virtual ~CEikTimeAndDateEditor();
01968 
01969         // 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
01970 
02002         IMPORT_C void ConstructL(const TTime& aMinimumTimeAndDate, const TTime& aMaximumTimeAndDate, const TTime& aInitialTimeAndDate, TUint32 aFlags, HBufC* aInterveningText=NULL);
02003         
02010         IMPORT_C void SetTimeAndDate(const TTime& aTimeAndDate);
02011 
02017         IMPORT_C TTime TimeAndDate() const;
02018 
02025         IMPORT_C void SetUninitialised(TBool aUninitialised);
02026         
02032         IMPORT_C TBool IsUninitialised() const;
02033         
02034         // from CEikTTimeEditor
02035 
02048         IMPORT_C virtual void SetMinimumAndMaximum(const TTime& aMinimumTimeAndDate, const TTime& aMaximumTimeAndDate); // only values inside the initial minimum and maximum are permitted
02049 
02058         IMPORT_C virtual void GetMinimumAndMaximum(TTime& aMinimumTimeAndDate, TTime& aMaximumTimeAndDate) const;
02059 
02060         // from CCoeControl
02061         
02074         IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
02075 
02087         IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aResourceReader);
02088 
02098         IMPORT_C virtual void PrepareForFocusLossL();
02099 
02107     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);      
02108     
02109 private:
02110         // from CEikMfne
02111         virtual void CreatePopoutIfRequiredL(); 
02112         IMPORT_C virtual void CEikMfne_Reserved();
02113         // from CEikTTimeEditor
02114         virtual void SetTTime(const TTime& aTimeAndDate);
02115         virtual TTime GetTTime() const; // can only be called if PrepareForFocusLossL() succeeded
02116 private:
02117         // from MEikCalendarDialogObserver
02118         virtual void GetMinimumAndMaximumAndInitialDatesForCalendarL(TTime& aMinimumDate, TTime& aMaximumDate, TTime& aInitialDate) const;
02119         virtual void SetDateFromCalendarAndDrawNow(const TTime& aDate);
02120         // miscellaneous functions
02121         void DoSetMinimumAndMaximum(const TTime& aMinimumTimeAndDate, const TTime& aMaximumTimeAndDate);
02122 private:
02126     IMPORT_C void* ExtensionInterface( TUid aInterface );
02127 private:
02128         CTimeEditor* iTimeEditor;
02129         CDateEditor* iDateEditor;
02130         TTime iMinimumTimeAndDate;
02131         TTime iMaximumTimeAndDate;
02132         TInt iSpare;
02133         };
02134 
02135 
02136 //
02137 
02156 class CEikDurationEditor : public CEikMfne
02157         {
02158 public:
02159         // miscellaneous functions
02160 
02169         IMPORT_C CEikDurationEditor();
02170 
02177         IMPORT_C virtual ~CEikDurationEditor();
02178 
02203         IMPORT_C void ConstructL(const TTimeIntervalSeconds& aMinimumDuration, const TTimeIntervalSeconds& aMaximumDuration, const TTimeIntervalSeconds& aInitialDuration, TUint32 aFlags);
02204 
02214         IMPORT_C void SetMinimumAndMaximum(const TTimeIntervalSeconds& aMinimumDuration, const TTimeIntervalSeconds& aMaximumDuration); // only values inside the initial minimum and maximum are permitted
02215 
02222         IMPORT_C void GetMinimumAndMaximum(TTimeIntervalSeconds& aMinimumDuration, TTimeIntervalSeconds& aMaximumDuration) const;
02223 
02230         IMPORT_C void SetDuration(const TTimeIntervalSeconds& aDuration);
02231 
02238         IMPORT_C TTimeIntervalSeconds Duration() const; // can only be called if PrepareForFocusLossL() succeeded
02239 
02240         // framework
02241 
02252         IMPORT_C void ConstructFromResourceL(TResourceReader& aResourceReader);
02253 
02262         IMPORT_C void PrepareForFocusLossL();
02263 
02264     // From CCoeControl    
02272     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);      
02273 private:
02274         // miscellaneous functions
02275         void DoSetMinimumAndMaximum(const TTimeIntervalSeconds& aMinimumDuration, const TTimeIntervalSeconds& aMaximumDuration);
02276         IMPORT_C virtual void CEikMfne_Reserved();
02277 private:
02281     IMPORT_C void* ExtensionInterface( TUid aInterface );
02282 private:
02283         CTimeEditor* iTimeEditor;
02284         TTimeIntervalSeconds iMinimumDuration;
02285         TTimeIntervalSeconds iMaximumDuration;
02286         TInt iSpare;
02287         };
02288 
02300 class CEikTimeOffsetEditor : public CEikMfne
02301         {
02302 public:
02303         // miscellaneous functions
02304 
02313         IMPORT_C CEikTimeOffsetEditor();
02314 
02319         IMPORT_C virtual ~CEikTimeOffsetEditor();
02320 
02349         IMPORT_C void ConstructL(const TTimeIntervalSeconds& aMinimumTimeOffset, const TTimeIntervalSeconds& aMaximumTimeOffset, const TTimeIntervalSeconds& aInitialTimeOffset, TUint32 aFlags);
02350 
02364         IMPORT_C void SetMinimumAndMaximum(const TTimeIntervalSeconds& aMinimumTimeOffset, const TTimeIntervalSeconds& aMaximumTimeOffset); // only values inside the initial minimum and maximum are permitted
02365 
02374         IMPORT_C void GetMinimumAndMaximum(TTimeIntervalSeconds& aMinimumTimeOffset, TTimeIntervalSeconds& aMaximumTimeOffset) const;
02375 
02385         IMPORT_C void SetTimeOffset(const TTimeIntervalSeconds& aTimeOffset);
02386 
02392         IMPORT_C TTimeIntervalSeconds TimeOffset() const; // can only be called if PrepareForFocusLossL() succeeded
02393 
02394         // framework
02395 
02408         IMPORT_C void ConstructFromResourceL(TResourceReader& aResourceReader);
02409 
02420         IMPORT_C void PrepareForFocusLossL();
02421 
02422     // From CCoeControl    
02423 
02431     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);      
02432     
02433 private:
02434         // miscellaneous functions
02435         void DoSetMinimumAndMaximum(const TTimeIntervalSeconds& aMinimumTimeOffset, const TTimeIntervalSeconds& aMaximumTimeOffset);
02436         IMPORT_C virtual void CEikMfne_Reserved();
02437 private:
02441     IMPORT_C void* ExtensionInterface( TUid aInterface );
02442 private:
02443         CTimeEditor* iTimeEditor;
02444         TTimeIntervalSeconds iMinimumTimeOffset;
02445         TTimeIntervalSeconds iMaximumTimeOffset;
02446         // none of these pointers owns anything
02447         CEikMfneSymbol* iSign;
02448         TInt iSpare;
02449         };
02450 
02451 
02452 //
02453 // Longitude and Latitude editors removed 2.4.2002:
02454 
02455 enum
02456         {
02457         EEikOrientationNorthSouth   =0x1000,
02458         EEikOrientationWestEast     =0x2000,
02459         EEikOrientationMask=EEikOrientationNorthSouth|EEikOrientationWestEast
02460         };
02461 
02462 
02463 enum
02464         {
02465         EEikDirectionNegative,
02466         EEikDirectionPositive,
02467         EEikDirectionMask=EEikDirectionNegative|EEikDirectionPositive
02468         };
02469 
02470 
02471 enum TEikCompass
02472         {
02473         EEikCompassNorth=EEikOrientationNorthSouth|EEikDirectionNegative,
02474         EEikCompassSouth=EEikOrientationNorthSouth|EEikDirectionPositive,
02475         EEikCompassEast=EEikOrientationWestEast|EEikDirectionNegative,
02476         EEikCompassWest=EEikOrientationWestEast|EEikDirectionPositive
02477         };
02478 
02479 
02480 struct SEikDegreesMinutesDirection
02481         {
02482         TInt iDegrees;
02483         TInt iMinutes;
02484         TInt iSeconds;
02485         TEikCompass iDirection;
02486         };
02487 
02488 #endif  // __EIKMFNE_H__
02489 // End of file

Copyright © Nokia Corporation 2001-2007
Back to top