// EIKSVPRV.H
//
// Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
//

#if !defined(__EIKSVPRV_H__)
#define __EIKSVPRV_H__

#if !defined(__EIKLBO_H__)
#include <eiklbo.h>
#endif

#if !defined(__EIKCFDLG_H__)
#include <eikcfdlg.h>
#endif

#if !defined(__EIKTXLBX_H__)
#include <eiktxlbx.h>
#endif

#if !defined(__EIKFCTRY_H__)
#include <eikfctry.h>
#endif

#if !defined(__PLPSESS_H__)
#include <plpsess.h>
#endif

#if !defined(__BADESCA_H__)
#include <badesca.h>
#endif

//
// class CEikServSecretEditor
//

class TResourceReader;

class CEikServSecretEditor : public CEikBorderedControl
	{
public:
	enum { EMaxSecEdLength=32 };
public:	// inherited
	CEikServSecretEditor(RWindowGroup& aGroupWin);
	virtual void ConstructFromResourceL(TResourceReader& aReader);
	virtual TSize MinimumSize();
	virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
public:	// specific
	void GetText(TDes& aText) const;
	void Reset();
	void SetMaxLength(TInt aMaxLength);
protected:	// inherited
	virtual void FocusChanged(TDrawNow aDrawNow);
private: // virtual
	virtual void Draw(const TRect& aRect) const;
private: // specific
	void DrawText() const;
	void DrawTextNow() const;
	void DisplayCursor();
private:
	typedef TBuf<EMaxSecEdLength> TSecEdBuf;
	TInt iSecPos;
	TInt iMaxLen;
	TInt iCharWidth;
	TInt iAscent;
	TSecEdBuf iSecCharArr;
	RWindowGroup& iGroupWin;
	};

//
// class CEikPasswordControl
//

class CRichText;
class CEikRichTextEditor;
class CEikAlarmControlDateTime;
class CEikServSecretEditor;
class CEikClock;

class CEikDateTime : public CEikBorderedControl, public MCoeControlBrushContext
	{
public: // new functions
	CEikDateTime();
	~CEikDateTime();
	void ConstructL();
	virtual TSize MinimumSize();
	void SizeChangedL();
private:
	void Draw(const TRect& aRect) const;
    TInt CountComponentControls() const;
    CCoeControl* ComponentControl(TInt aIndex) const;
private:
	CEikClock* iDigitalClock;
	};


class CParaFormatLayer;
class CCharFormatLayer;
class CEikServAppUi;
class CEikPasswordControl : public CEikBorderedControl, public MCoeControlBrushContext
	{
public:
	CEikPasswordControl(CEikServAppUi* aAppUi);
	~CEikPasswordControl();
	void ConstructL();
	void ShowPasswordScreen();
	void SetPasswordMode();
private:
	void ConstructOwnerInfoL();
private:
	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
	void HandlePointerEventL(const TPointerEvent& aPointerEvent);
    TInt CountComponentControls() const;
    CCoeControl* ComponentControl(TInt aIndex) const;
	TSize MinimumSize();
	void SizeChangedL();
	void Draw(const TRect& aRect) const;
	void ExitPasswordScreen();
private:
	CEikRichTextEditor* iOwnerInfo;
	CEikLabel* iCaption;
	CEikServSecretEditor* iSeced;
	CEikClock* iAnalogClock;
	CEikDateTime* iDateTime;
private:
	CRichText* iText;
	CParaFormatLayer* iParaFormatLayer;
	CCharFormatLayer* iCharFormatLayer;
	RRemoteLink iLink;
	CEikServAppUi* iAppUi;
	};


//
// class CEikTaskListDialog
//

class CEikServTaskListBox;
class CApaWindowGroupName;
class TApaTask;

class CEikTaskListDialog : public CEikDialog, public MEikListBoxObserver
	{
public:
	~CEikTaskListDialog();
	void ConstructL(CEikServAppUi* aEikServAppUi);
	void RunTaskListL();
	void SetCurrentItemIndex(TInt aCurrentItemIndex);
public: // from CCoeControl
	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
public: // from MEikListBoxObserver
	void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
private:
	void PrepareTaskArraysL();
	CEikServTaskListBox* ListBox() const;
	void SetArrayIntoListBox();
	TInt NumberOfListBoxItems() const;
	void EndTaskL(TApaTask& aTask);
private: // from CCoeControl
	void HandlePointerEventL(const TPointerEvent& aPointerEvent);
private: // from CEikForm
	SEikControlInfo CreateCustomControlL(TInt aControlType);
private: // from CEikDialog
	TBool OkToExitL(TInt aKeyCode);
	void PreLayoutDynInitL();
private:
	friend class CEikServAppUi;
	CDesCArray* iTasks;
	CArrayFixFlat<TInt>* iWgIds;
	CEikServAppUi* iEikServAppUi;
	CApaWindowGroupName* iWgName;
	TInt iPrevCurrentItemIndex;
	TUint iLastKeyModifiers;
	};

class CEikServTaskListBox : public CEikTextListBox
	{
public: // from CCoeControl
	void HandlePointerEventL(const TPointerEvent& aPointerEvent);
	};

//
// CEikServPanicScreen
//

class CEikServPanicScreen : public CEikDialog
	{
public:
	CEikServPanicScreen(RThread& aThread);
private: // from CEikDialog
	void PreLayoutDynInitL();
protected:
	RThread& iThread;
	};

//
// CEikServResetReasonDialog
//

class CEikServResetReasonDialog : public CEikDialog
	{
private: // virtual from CEikDialog
	virtual void PreLayoutDynInitL();
	};

// 
// CEikScreenCaptureDialog
//

class CEikScreenCaptureDialog : public CEikFileSaveAsDialog
	{
public:
	CEikScreenCaptureDialog(TDes* aFileName, TBool& aSaveAsMonochromeImage, TInt aTitleId = 0);
private: // inherited
	TBool OkToExitL(TInt aButtonId);
private:
	TBool& iSaveAsMonochrome;
	};

#endif
