// EIKCAPC.H
//
// Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
//

#if !defined(__EIKCAPC_H__)
#define __EIKCAPC_H__

#if !defined(__COECNTRL_H__)
#include <coecntrl.h>
#endif

#if !defined(__EIKLABEL_H__)
#include <eiklabel.h>
#endif

class CEikCaptionedControl : public CCoeControl
	{
public:
	IMPORT_C CEikCaptionedControl();
	IMPORT_C ~CEikCaptionedControl();
public: // new functions
	IMPORT_C void SetUsesEars();
	IMPORT_C void SetExtraAscent();
	IMPORT_C void SetCaptionL(const TDesC& aText);
	IMPORT_C void SetTrailerL(const TDesC& aText);
	IMPORT_C void SetCurrent(TBool aSelected);
	IMPORT_C void CheckDimmedDisplayState();
	IMPORT_C void ResetMinimumSizes();
	IMPORT_C TBool IsLatent() const;
	IMPORT_C void SetLatent(TBool aLatent);
	IMPORT_C TBool LatentGroupLineFollows() const;
	IMPORT_C void SetLatentGroupLineFollows(TBool aLglf);
	IMPORT_C TBool DividerAfter() const;
	IMPORT_C void SetDividerAfter(TBool aDividerAfter);
	IMPORT_C TBool TakesEnterKey() const;
	IMPORT_C void SetTakesEnterKey(TBool aTakesEnter);
	IMPORT_C TBool OfferHotKeys() const;
	IMPORT_C void SetOfferHotKeys(TBool aOffer);
public: // framework
	IMPORT_C TSize MinimumSize();
	IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
	IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
private: // from CCoeControl
	IMPORT_C TInt CountComponentControls() const;
	IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
	IMPORT_C void SizeChangedL();
	IMPORT_C void FocusChanged(TDrawNow aDrawNow);
protected: // from CCoeControl
	IMPORT_C void Draw(const TRect& aRect) const;
	IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
private: // from CCoeControl
	IMPORT_C void Reserved_1();
	IMPORT_C void Reserved_2();
private: // new functions
	enum TWhichEars
		{
		ENoEar=0x00,
		ELeftEar=0x01,
		ERightEar=0x02,
		EBothEars=0x03
		};
	void DrawEarsNow(TWhichEars aEar) const;
	void DrawEars(TWhichEars aEar) const;
	void DrawSingleEar(TWhichEars aEar,TBool aPressed) const;
	TRect EarRect(TWhichEars aEar) const;
	void FireEarL(TWhichEars aEar,TInt aEarRepeat);
	TInt SquashComponentWidth(TInt& aTotalWidth,const TInt aComponentWidthHint);
	void StretchComponentsL();
	void SquashComponentsL();
public:
	CCoeControl* iControl;
	CEikLabel* iCaption;
	CEikLabel* iTrailer;
	TInt iId;
	TInt iControlType;
	TAny* iReturnValue;
private:
	TSize iMinSize;
	TInt iCapCFlags;
	TInt iCaptionWidth;
	TInt iFullWidth;
	friend class CEikCapCArray;
	};

#endif
