// SMEDDATE.H
// Copyright (C) Symbian Ltd 1998
//
// SMS Editor Date/Size Control
//


#if !defined(__SMEDDATE_H__)
#define __SMEDDATE_H__


#if !defined(__EIKBCTRL_H__)
#include <EIKBCTRL.H>
#endif

#if !defined(__EIKLABEL_H__)
#include <EIKLABEL.H>
#endif

#if !defined(__MSVSTD_H__)
#include <msvstd.h>
#endif

// Forward references 
class CEikCaptionedControl;
class CEikChoiceList;
class CEikTimeAndDateEditor;
//

class CMsgDateSizeLineControl : public CEikBorderedControl, public MCoeControlObserver
	{
public:
	// --- Construction ---
	CMsgDateSizeLineControl();
	void ConstructL();
	virtual ~CMsgDateSizeLineControl();
	//
	// --- Inquiry ---
	TTime Date() const;
	//
	// --- Setter functions ---
	void SetSizeValueL(TInt aSize, TInt aMaxSize);
	void SetDate(const TTime& aTime);

protected:	
	// --- From MCoeControlObserver ---
	virtual void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
	//
	// --- From CCoeControl
	virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
	virtual void SetContainerWindowL(const CCoeControl& aContainer);
	virtual void ConstructFromResourceL(TResourceReader& aReader);
	virtual CCoeControl* ComponentControl(TInt aIndex) const;
	virtual TInt CountComponentControls() const;
	virtual void PrepareForFocusLossL();
	virtual void SizeChangedL();
	virtual TSize MinimumSize();

protected: 
	// --- Internal methods ---
	void InitialiseCaptionedControlsL(const CCoeControl& aContainer);
	CEikTimeAndDateEditor* DateEditor() const;
	CEikLabel* SizeEditor() const;

protected: 
	// --- Data ---
	enum TMsgPriorityReceiptDateLineOwnedControls
		{
		EDateControl,
		ESizeControl,
		ENumberOfControls
		} ;
	
	CArrayPtrFlat<CEikCaptionedControl>*	iControls;
	TBuf<32>								iSizeFormat;
	TBuf<32>								iSizeConcatFormat;
	enum TMsgControlFlags
		{
		EControlAboutToLoseFocus=0x01,
		EControlReadOnly=0x02
		};
	};


#endif
