eikseced.h

Go to the documentation of this file.
00001 // EIKSECED.H
00002 //
00003 // Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
00004 //
00005 
00006 #if !defined(__EIKSECED_H__)
00007 #define __EIKSECED_H__
00008 
00009 #if !defined(__EIKDEF_H__)
00010 #include <eikdef.h>
00011 #endif
00012 
00013 #if !defined(__EIKBCTRL_H__)
00014 #include <eikbctrl.h>
00015 #endif
00016 
00017 #include <fepbase.h>
00018 
00019 // FORWARD DECLARATIONS
00020 class TResourceReader;
00021 class CEikSecretEditorExtension;
00022 class MAknsControlContext;
00023 
00035 class CEikSecretEditor : public CEikBorderedControl, public MCoeFepAwareTextEditor, public MCoeFepAwareTextEditor_Extension1
00036         {
00037 public:
00038     enum { 
00043         EMaxSecEdBufLength = 32,
00051         EMaxSecEdSecArrayLength = 255
00052         };
00053 public:
00064     IMPORT_C CEikSecretEditor();
00065 
00069     IMPORT_C ~CEikSecretEditor();
00070     
00071 public:    // from CCoeControl
00084     IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aReader);
00085     
00093     IMPORT_C virtual TSize MinimumSize();
00094     
00104     IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00105     
00113     IMPORT_C virtual void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const; // not available before Release 005u
00114     
00125     IMPORT_C virtual void HandleResourceChange(TInt aType);    // not available before Release 005u
00126 
00141     IMPORT_C virtual TCoeInputCapabilities InputCapabilities() const;
00142 
00150     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00151     
00152 public:    // specific
00164     IMPORT_C void GetText(TDes& aText) const;
00165 
00171     IMPORT_C virtual void SetText(const TDesC& aText);
00172     
00179     IMPORT_C virtual void InitializeDisplay(TInt aNumberOfChars);
00180     
00184     IMPORT_C void Reset();
00185 
00197     IMPORT_C void SetMaxLength(TInt aMaxLength);
00198 
00205     IMPORT_C void AknSetFont(const CFont &aFont);
00206 
00212     IMPORT_C void AknSetAlignment(const CGraphicsContext::TTextAlign &aAlign);
00213 
00225     IMPORT_C void SetDefaultInputMode(TInt aInputMode);
00226 
00232     IMPORT_C TInt MaxLength() const;
00233 
00239     IMPORT_C const TDesC& Buffer() const;
00240 
00246     IMPORT_C void RevealSecretText( TBool aReveal );
00247 
00259     IMPORT_C void SetSkinBackgroundControlContextL( MAknsControlContext* aContext );
00260 
00261 protected:    // inherited
00262     // methods to enable CAknNumericSecretEditor to inherit from CEikSecretEditor
00268     IMPORT_C virtual void AppendCharacterL( TInt aKeyCode );
00269     
00273     IMPORT_C virtual void Update();
00274     
00275     void InsertSecretChar();
00276     
00283     IMPORT_C void SizeChanged();
00284     
00285 private: // virtual
00286     IMPORT_C virtual void Draw(const TRect& aRect) const;
00287 
00288 private: // from MCoeFepAwareTextEditor
00289     IMPORT_C void StartFepInlineEditL(const TDesC& aInitialInlineText, TInt aPositionOfInsertionPointInInlineText, TBool aCursorVisibility, const MFormCustomDraw* aCustomDraw, MFepInlineTextFormatRetriever& aInlineTextFormatRetriever, MFepPointerEventHandlerDuringInlineEdit& aPointerEventHandlerDuringInlineEdit);
00290     IMPORT_C void UpdateFepInlineTextL(const TDesC& aNewInlineText, TInt aPositionOfInsertionPointInInlineText);
00291     IMPORT_C void SetInlineEditingCursorVisibilityL(TBool aCursorVisibility);
00292     IMPORT_C void CancelFepInlineEdit();
00293     IMPORT_C TInt DocumentLengthForFep() const;
00294     IMPORT_C TInt DocumentMaximumLengthForFep() const;
00295     IMPORT_C void SetCursorSelectionForFepL(const TCursorSelection& aCursorSelection);
00296     IMPORT_C void GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const;
00297     IMPORT_C void GetEditorContentForFep(TDes& aEditorContent, TInt aDocumentPosition, TInt aLengthToRetrieve) const;
00298     IMPORT_C void GetFormatForFep(TCharFormat& aFormat, TInt aDocumentPosition) const;
00299     IMPORT_C void GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLine, TInt& aHeight, TInt& aAscent, TInt aDocumentPosition) const;
00300     IMPORT_C void DoCommitFepInlineEditL();
00301     IMPORT_C MCoeFepAwareTextEditor_Extension1* Extension1(TBool& aSetToTrue);
00302     IMPORT_C void SetStateTransferingOwnershipL(CState* aState, TUid aTypeSafetyUid);
00303     IMPORT_C CState* State(TUid aTypeSafetyUid); // this function does *not* transfer ownership
00304 
00305 private:
00306     void OverflowAlert();
00307 
00308 private: // from CCoeControl
00309     IMPORT_C void Reserved_1();
00310     IMPORT_C void Reserved_2();
00311 private:
00315     IMPORT_C void* ExtensionInterface( TUid aInterface );
00316 private: // from MCoeFepAwareTextEditor
00317     IMPORT_C void MCoeFepAwareTextEditor_Reserved_2();
00318 private:  // from MCoeFepAwareTextEditor_Extension1
00319     IMPORT_C virtual void MCoeFepAwareTextEditor_Extension1_Reserved_2();
00320     IMPORT_C virtual void MCoeFepAwareTextEditor_Extension1_Reserved_3();
00321     IMPORT_C virtual void MCoeFepAwareTextEditor_Extension1_Reserved_4();
00322 
00323 private: // specific
00324     void InsertChar();
00325     TInt CharsFitOnEditor() const;
00326     IMPORT_C virtual MCoeFepAwareTextEditor_Extension1::CState* CreateFepStateL();
00327     void CalculateAscent();
00328     void ReportUpdate();
00329 private:
00330     typedef TBuf<EMaxSecEdBufLength> TSecEdBuf;
00331 protected:
00332     HBufC* iSecCharArr;
00333     TInt iSecPos;
00334     TSecEdBuf iBuf;
00335     TInt iMaxLen;
00336     TInt iCharWidth;
00337     TInt iAscent;
00338     TBool iBufferFull;
00339 
00340 public: // timer methods
00341     void StartTimer();
00342 private:
00343     static TInt TimerCallback(TAny* aThis);
00344 private:
00345     CPeriodic* iTimer;
00346     const CFont *iFont;
00347     CGraphicsContext::TTextAlign iAlign;
00348     TBool iRevealSecretText; // holds the state of whether text is shown or not
00349     CEikSecretEditorExtension* iExtension;
00350     CState* iFepState;
00351     HBufC* iInlineEditText;
00352 
00353 public:
00361     IMPORT_C void SetSkinTextColorL(TInt aAknSkinIDForTextColor, TInt aAknSkinIdForBgColor=KErrNotFound);
00362     };
00363 
00364 #endif

Copyright © Nokia Corporation 2001-2008
Back to top