diff -r 000000000000 -r 8466d47a6819 emailuis/emailui/inc/ncsattachmentfield.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailuis/emailui/inc/ncsattachmentfield.h Thu Dec 17 08:39:21 2009 +0200 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container class for compose view +* +*/ + + + +#ifndef CNCSATTACHMENTFIELD_H +#define CNCSATTACHMENTFIELD_H + + +#include "ncscontrol.h" + + +class MNcsFieldSizeObserver; +class CNcsHeaderContainer; + + +/** + * CNcsAttachmentField + */ +class CNcsAttachmentField: + public CCoeControl, + public MNcsControl + { +public: // construct & destruct + + static CNcsAttachmentField* NewL( + TInt aLabelTextId, + MNcsFieldSizeObserver* aSizeObserver, + CNcsHeaderContainer* aParentControl ); + + virtual ~CNcsAttachmentField(); + +public: // methods + + TInt MinimumHeight() const; + + void SetMaxLabelLength( TInt aMaxLength ); + + TInt GetMinLabelLength() const; + + void SetTextL( const TDesC& aText ); + void SetTextL( const TDesC& aAttachmentName, const TDesC& aAttachmentSizeDesc ); + +public: // from MNcsControl + + TInt LineCount() const; + + TInt ScrollableLines() const; + + TInt GetNumChars() const; + + TInt CursorLineNumber() const; + + TInt CursorPosition() const; + + void Reposition( TPoint& aPt, TInt aWidth ); + + const TDesC& GetLabelText() const; + + // Platform layout change + TInt LayoutLineCount() const; + // Platform layout change + +public: // from CCoeControl + + void Draw( const TRect& aRect ) const; + + void SizeChanged(); + + void PositionChanged(); + + void SetContainerWindowL( const CCoeControl& aContainer ); + + void FocusChanged( TDrawNow aDrawNow ); + + void HandleResourceChange( TInt aType ); + +private: // methods + + CNcsAttachmentField( MNcsFieldSizeObserver* aSizeObserver, + CNcsHeaderContainer* aParentControl ); + + void ConstructL( TInt aLabelTextId ); + + void UpdateColors(); + + void UpdateFontSize(); + + // Platform layout change + void LayoutControls(); + + void UpdateIconPositions( const TRect& aRect ); + // Platform layout change + + void UpdateAttachmentTextL(); + + // Platform layout change + /** + * Resizes icons + */ + void ResizeIcons(); + + TInt CreateIcons(); + void CreateIconsL(); + // Platform layout change + +private: // data + + CNcsHeaderContainer* iParentControl; // not owned + + CNcsLabel* iAttachmentLabel; + +// Platform layout change + //CFont* iLabelFont; // not owned, needs to be released in the end + //CFont* iEditorFont; // not owned, needs to be released in the end + const CFont* iLabelFont; // not owned + const CFont* iEditorFont; // not owned +// + + HBufC* iAttachmentName; + HBufC* iAttachmentSizeDesc; + + TInt iMaximumLabelLength; + + TRgb iBgColor; + + TRgb iBorderColor; + + // Attachment icon + CFbsBitmap* iAttachmentBitmap; + CFbsBitmap* iAttachmentMask; + TPoint iAttachmentIconPos; + + // Action menu icon + CFbsBitmap* iActionMenuBitmap; + CFbsBitmap* iActionMenuMask; + TPoint iActionMenuIconPos; + }; + +#endif