00001
00002
00003
00004
00005
00006 #if !defined(__EIKLBED_H__)
00007 #define __EIKLBED_H__
00008
00009 #if !defined(__E32BASE_H__)
00010 #include <e32base.h>
00011 #endif
00012
00013 #if !defined(__EIKLBM_H__)
00014 #include <eiklbm.h>
00015 #endif
00016
00017 #if !defined(__W32STD_H__)
00018 #include <w32std.h>
00019 #endif
00020
00021 #if !defined(__COEDEF_H__)
00022 #include <coedef.h>
00023 #endif
00024
00025 #if !defined(__COECNTRL_H__)
00026 #include <coecntrl.h>
00027 #endif
00028
00029 #include <akncontrol.h>
00030
00031 class CEikEdwin;
00032 class CParaFormatLayer;
00033 class CCharFormatLayer;
00034
00041 class MEikListBoxEditor
00042 {
00043 public:
00047 virtual TPtrC ItemText() = 0;
00048
00054 virtual void StartEditingL(const CCoeControl& aContainer,const TRect& aRect,TInt aItemIndex,TInt aMaxLength) = 0;
00055
00059 virtual void StopEditingL() = 0;
00060
00064 virtual TBool UpdateModelL() = 0;
00065
00069 virtual void Release() = 0;
00070 private:
00071 IMPORT_C virtual void MEikListBoxEditor_Reserved_1();
00072 };
00073
00074 class MListBoxEditorObserver
00075 {
00076 public:
00077 virtual TKeyResponse HandleListBoxEditorEventL(MEikListBoxEditor* aListBoxEditor, const TKeyEvent& aKeyEvent)=0;
00078 };
00079
00086 class CEikListBoxTextEditor : public CAknControl, public MEikListBoxEditor
00087 {
00088 public:
00089
00095 IMPORT_C CEikListBoxTextEditor(MListBoxModel* aModel);
00096
00100 IMPORT_C ~CEikListBoxTextEditor();
00101
00107 IMPORT_C void SetFont(const CFont* aFont);
00108
00114 IMPORT_C CEikEdwin* Editor();
00115
00121 IMPORT_C void SetListBoxEditorObserver(MListBoxEditorObserver* aObserver);
00122
00123 public:
00124
00131 IMPORT_C TPtrC ItemText();
00132
00146 IMPORT_C void StartEditingL(const CCoeControl& aContainer,
00147 const TRect& aRect,
00148 TInt aItemIndex,
00149 TInt aMaxLength);
00150
00155 IMPORT_C void StopEditingL();
00156
00164 IMPORT_C TBool UpdateModelL();
00165
00176 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
00177 TEventCode aType);
00178
00179 public:
00180
00187 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00188
00189 protected:
00190
00195 IMPORT_C void Release();
00196
00197 protected:
00198
00204 IMPORT_C MListBoxModel* ListBoxModel();
00205
00211 IMPORT_C TInt ItemIndex() const;
00212
00213 private:
00214
00215 IMPORT_C void MEikListBoxEditor_Reserved_1();
00216
00217 protected:
00218
00226 IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
00227
00228 private:
00229
00230 void UseFontL(CEikEdwin& editor, const CFont& aFont);
00231
00232 TPtrC EditableItemText(TRect* aRect=NULL);
00233
00234 private:
00238 IMPORT_C void* ExtensionInterface(TUid aInterface);
00239
00240 private:
00241 MListBoxEditorObserver* iEditorObserver;
00242 MListBoxModel* iModel;
00243 CEikEdwin* iEditor;
00244 TInt iItemIndex;
00245 CFont* iFont;
00246 TInt iItemPos;
00247 TInt iItemLen;
00248 CParaFormatLayer* iParaFormatLayer;
00249 CCharFormatLayer* iCharFormatLayer;
00250 TInt iSpare[2];
00251 };
00252
00253 #endif
00254
00255
00256