00001
00002
00003
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
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
00059 enum TFeatureId
00060 {
00064 EDisablePenInput
00065 };
00066
00067
00068 public:
00079 IMPORT_C CEikSecretEditor();
00080
00084 IMPORT_C ~CEikSecretEditor();
00085
00086 public:
00099 IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aReader);
00100
00108 IMPORT_C virtual TSize MinimumSize();
00109
00119 IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00120
00128 IMPORT_C virtual void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const;
00129
00140 IMPORT_C virtual void HandleResourceChange(TInt aType);
00141
00156 IMPORT_C virtual TCoeInputCapabilities InputCapabilities() const;
00157
00165 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00166
00167 public:
00179 IMPORT_C void GetText(TDes& aText) const;
00180
00186 IMPORT_C virtual void SetText(const TDesC& aText);
00187
00194 IMPORT_C virtual void InitializeDisplay(TInt aNumberOfChars);
00195
00199 IMPORT_C void Reset();
00200
00212 IMPORT_C void SetMaxLength(TInt aMaxLength);
00213
00220 IMPORT_C void AknSetFont(const CFont &aFont);
00221
00227 IMPORT_C void AknSetAlignment(const CGraphicsContext::TTextAlign &aAlign);
00228
00240 IMPORT_C void SetDefaultInputMode(TInt aInputMode);
00241
00247 IMPORT_C TInt MaxLength() const;
00248
00254 IMPORT_C const TDesC& Buffer() const;
00255
00261 IMPORT_C void RevealSecretText( TBool aReveal );
00262
00274 IMPORT_C void EnableSCT( TBool aEnable = ETrue );
00275
00287 IMPORT_C void SetSkinBackgroundControlContextL( MAknsControlContext* aContext );
00288
00289 protected:
00290
00296 IMPORT_C virtual void AppendCharacterL( TInt aKeyCode );
00297
00301 IMPORT_C virtual void Update();
00302
00303 void InsertSecretChar();
00304
00311 IMPORT_C void SizeChanged();
00312
00313 private:
00314 IMPORT_C virtual void Draw(const TRect& aRect) const;
00315
00316 private:
00317 IMPORT_C void StartFepInlineEditL(const TDesC& aInitialInlineText, TInt aPositionOfInsertionPointInInlineText, TBool aCursorVisibility, const MFormCustomDraw* aCustomDraw, MFepInlineTextFormatRetriever& aInlineTextFormatRetriever, MFepPointerEventHandlerDuringInlineEdit& aPointerEventHandlerDuringInlineEdit);
00318 IMPORT_C void UpdateFepInlineTextL(const TDesC& aNewInlineText, TInt aPositionOfInsertionPointInInlineText);
00319 IMPORT_C void SetInlineEditingCursorVisibilityL(TBool aCursorVisibility);
00320 IMPORT_C void CancelFepInlineEdit();
00321 IMPORT_C TInt DocumentLengthForFep() const;
00322 IMPORT_C TInt DocumentMaximumLengthForFep() const;
00323 IMPORT_C void SetCursorSelectionForFepL(const TCursorSelection& aCursorSelection);
00324 IMPORT_C void GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const;
00325 IMPORT_C void GetEditorContentForFep(TDes& aEditorContent, TInt aDocumentPosition, TInt aLengthToRetrieve) const;
00326 IMPORT_C void GetFormatForFep(TCharFormat& aFormat, TInt aDocumentPosition) const;
00327 IMPORT_C void GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLine, TInt& aHeight, TInt& aAscent, TInt aDocumentPosition) const;
00328 IMPORT_C void DoCommitFepInlineEditL();
00329 IMPORT_C MCoeFepAwareTextEditor_Extension1* Extension1(TBool& aSetToTrue);
00330 IMPORT_C void SetStateTransferingOwnershipL(CState* aState, TUid aTypeSafetyUid);
00331 IMPORT_C CState* State(TUid aTypeSafetyUid);
00332
00333 private:
00334 void OverflowAlert();
00335
00336 private:
00337 IMPORT_C void Reserved_1();
00338 IMPORT_C void Reserved_2();
00339 private:
00343 IMPORT_C void* ExtensionInterface( TUid aInterface );
00344 private:
00345 IMPORT_C void MCoeFepAwareTextEditor_Reserved_2();
00346 private:
00347 IMPORT_C virtual void MCoeFepAwareTextEditor_Extension1_Reserved_2();
00348 IMPORT_C virtual void MCoeFepAwareTextEditor_Extension1_Reserved_3();
00349 IMPORT_C virtual void MCoeFepAwareTextEditor_Extension1_Reserved_4();
00350
00351 private:
00352 void InsertChar();
00353 TInt CharsFitOnEditor() const;
00354 IMPORT_C virtual MCoeFepAwareTextEditor_Extension1::CState* CreateFepStateL();
00355 void CalculateAscent();
00356 void ReportUpdate();
00357 private:
00358 typedef TBuf<EMaxSecEdBufLength> TSecEdBuf;
00359 protected:
00360 HBufC* iSecCharArr;
00361 TInt iSecPos;
00362 TSecEdBuf iBuf;
00363 TInt iMaxLen;
00364 TInt iCharWidth;
00365 TInt iAscent;
00366 TBool iBufferFull;
00367
00368 public:
00369 void StartTimer();
00370 private:
00371 static TInt TimerCallback(TAny* aThis);
00372 private:
00373 CPeriodic* iTimer;
00374 const CFont *iFont;
00375 CGraphicsContext::TTextAlign iAlign;
00376 TBool iRevealSecretText;
00377 CEikSecretEditorExtension* iExtension;
00378 CState* iFepState;
00379 HBufC* iInlineEditText;
00380
00381 public:
00389 IMPORT_C void SetSkinTextColorL(TInt aAknSkinIDForTextColor, TInt aAknSkinIdForBgColor=KErrNotFound);
00390
00401 IMPORT_C TInt SetFeature( TInt aFeatureId, TInt aFeatureParam );
00402
00414 IMPORT_C TInt GetFeature( TInt aFeatureId, TInt& aFeatureParam ) const;
00415
00424 IMPORT_C TBool SupportsFeature( TInt aFeatureId ) const;
00425 };
00426
00427 #endif