00001 /* 00002 * ============================================================================ 00003 * Name : Eikfrlb.h 00004 * Part of : Avkon 00005 * 00006 * Description: 00007 * Version: 00008 * 00009 * Copyright © 2002 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. All rights are reserved. Copying, 00013 * including reproducing, storing, adapting or translating, any 00014 * or all of this material requires the prior written consent of 00015 * Nokia Corporation. This material also contains confidential 00016 * information which may not be disclosed to others without the 00017 * prior written consent of Nokia Corporation. 00018 * ============================================================================ 00019 */ 00020 // EIKFRLB.H 00021 // 00022 // Copyright (c) 1997-2001 Symbian Ltd. All rights reserved. 00023 // 00024 #if !defined(__EIKFRLB_H__) 00025 #define __EIKFRLB_H__ 00026 00027 #include <eiklbi.h> 00028 #include <eiklbv.h> 00029 #include <eiktxlbm.h> 00030 #include <eiktxlbx.h> 00031 00032 class CFormattedCellListBoxData; 00033 00040 class CFormattedCellListBoxItemDrawer : public CTextListItemDrawer 00041 { 00042 public: 00043 00051 IMPORT_C CFormattedCellListBoxItemDrawer( 00052 MTextListBoxModel* aTextListBoxModel, 00053 const CFont* aFont, 00054 CFormattedCellListBoxData* aFormattedCellData); 00055 00059 IMPORT_C ~CFormattedCellListBoxItemDrawer(); 00060 00066 IMPORT_C CFormattedCellListBoxData* FormattedCellData() const; 00067 00073 IMPORT_C CFormattedCellListBoxData* ColumnData() const; 00074 // for compability with columnlistbox itemdrawer 00075 00083 IMPORT_C virtual void DrawEmptyItem(TInt aItemIndex, TPoint aItemRectPos, 00084 TBool aViewIsDimmed) const; 00085 00091 IMPORT_C void SetTopItemIndex(TInt aTop); 00092 00096 struct SListProperties 00097 { 00099 TInt iItem; // must be first 00100 00102 TListItemProperties iProperties; 00103 }; 00104 00108 IMPORT_C void ClearAllPropertiesL(); 00109 00127 IMPORT_C void SetPropertiesL(TInt aItemIndex, TListItemProperties properties); 00128 00136 IMPORT_C virtual TListItemProperties Properties(TInt aItemIndex) const; 00137 00143 TSize LafItemSize() { return iItemCellSize; } 00144 00145 public: // from CTextListItemDrawer 00146 00162 IMPORT_C void DrawItemText(TInt aItemIndex,const TRect& aItemTextRect, 00163 TBool aItemIsCurrent, TBool aViewIsEmphasized, 00164 TBool aItemIsSelected) const; 00165 00186 IMPORT_C void DrawItemMark(TBool aItemIsSelected, TBool aViewIsDimmed, 00187 const TPoint& aMarkPos) const; 00188 00189 public: // from CListItemDrawer 00190 00199 IMPORT_C TSize MinimumCellSize() const; 00200 00209 IMPORT_C TInt ItemWidthInPixels(TInt aItemIndex) const; 00210 00221 IMPORT_C void SetItemCellSize(const TSize& aSizeInPixels); 00222 00223 protected: 00224 00230 void DrawCurrentItemRect(const TRect& aRect) const; 00231 00232 #start_since SINCE_3_1_SDK 00233 00247 void WordWrapListItem( TPtr& aTarget, 00248 const TDesC &aItemString, 00249 TInt aFirstIndex, 00250 TInt aSecondIndex, 00251 TInt aItemIndex ) const; 00252 #end_since SINCE_3_1_SDK 00253 #start_since SINCE_3_1_SDK 00254 00258 void DrawBackgroundAndSeparatorLines( const TRect& aItemTextRect ) const; 00259 #end_since SINCE_3_1_SDK 00260 00261 00262 private: 00263 00264 IMPORT_C void CFormattedCellListBoxItemDrawer_Reserved(); 00265 00266 protected: 00267 00271 TInt iTopItemIndex; 00272 00277 CArrayFix<SListProperties>* iPropertyArray; 00278 00279 private: 00280 00281 TInt iSpare; 00282 }; 00283 00284 00340 class CEikFormattedCellListBox : public CEikTextListBox 00341 { 00342 00343 public: 00344 00348 IMPORT_C CEikFormattedCellListBox(); 00349 00363 IMPORT_C void ConstructFromResourceL(TResourceReader& aReader); 00364 00377 IMPORT_C void ConstructL(const CCoeControl* aParent, TInt aFlags); 00378 00379 public: 00380 00386 IMPORT_C CTextListBoxModel* Model() const; 00387 00393 IMPORT_C CFormattedCellListBoxItemDrawer* ItemDrawer() const; 00394 00398 void SetIconSizes(); 00399 00400 public: 00401 00415 IMPORT_C void UseLogicalToVisualConversion( TBool aUseConversion ); 00416 00417 public: 00418 00437 IMPORT_C void EnableExtendedDrawingL(); 00438 00439 #start_since SINCE_3_1_SDK 00440 00451 IMPORT_C void EnableStretching( const TBool aEnabled ); 00452 #end_since SINCE_3_1_SDK 00453 00454 #start_since SINCE_3_1_SDK 00455 00463 IMPORT_C void HideSecondRow( const TBool aHide ); 00464 #end_since SINCE_3_1_SDK 00465 protected: 00466 00470 IMPORT_C virtual void CreateItemDrawerL(); 00471 00481 IMPORT_C virtual TInt AdjustRectHeightToWholeNumberOfItems( 00482 TRect &aRect) const; 00483 00484 public: // from CEikListBox 00485 00493 IMPORT_C CListBoxView* MakeViewClassInstanceL(); 00494 00505 IMPORT_C void FocusChanged(TDrawNow aDrawNow); 00506 00507 public: // from CCoeControl 00508 00516 IMPORT_C void GetColorUseListL( 00517 CArrayFix<TCoeColorUse>& aColorUseList) const; 00518 00526 IMPORT_C void HandleResourceChange(TInt aType); 00527 00535 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); 00536 00537 protected: // from MObjectProvider 00538 00550 IMPORT_C virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId); 00551 00552 private: 00553 00557 IMPORT_C void* ExtensionInterface( TUid aInterface ); 00558 00559 private: // listbox use only 00560 00561 IMPORT_C virtual void CEikListBox_Reserved(); 00562 00563 private: // data 00564 00565 TInt iSpare; 00566 }; 00567 00568 00576 class CFormattedCellListBoxView : public CListBoxView 00577 { 00578 00579 public: // from CListBoxView 00580 00588 IMPORT_C void Draw(const TRect* aClipRect = NULL) const; 00589 00597 IMPORT_C virtual void DrawEmptyList(const TRect &aClientRect) const; 00598 00607 IMPORT_C virtual void CalcBottomItemIndex(); 00608 00609 private: // overridden from CListBoxView 00610 00611 IMPORT_C virtual TAny* Reserved_1(); 00612 }; 00613 00614 00615 // __EIKFRLB_H__ 00616 #endif 00617 00618 // End of File