// EIKXDLG.H
//
// Copyright (c) 1998 Symbian Ltd.  All rights reserved. 
//

// Header for EikXtra DLL. Includes definitions for 
// Secret editor with set,
// IP address editor,
// Help dialog

#if !defined(__EIKXTRA_H__)
#define __EIKXTRA_H__

#if !defined(__EIKEDWIN_H__)
#include <eikedwin.h>
#endif

#if !defined(__EIKFORM_H__)
#include <eikform.h>
#endif

#if !defined(__EIKDIALG_H__)
#include <eikdialg.h>
#endif

#if !defined(__EIKMFNE_H__)
#include <eikmfne.h>
#endif

#include <t32wld.h>
#include <eikseced.h>
#include "eikxtra.hrh"


class CEikSecretEditorSettable : public CEikSecretEditor
	{
public: // inherited
	IMPORT_C CEikSecretEditorSettable();
public: // specific
	IMPORT_C static void SetText(TInt aControlId, const TDesC& aText, CEikForm& aForm);
protected:	// inherited
	IMPORT_C void FocusChanged(TDrawNow aDrawNow);
private:
	void SetText(const TDesC& aText);
private:
	TBool iCursorDisplayed;
	};

#define EIKX_SetSecretEditor(I, T) CEikSecretEditorSettable::SetText(I, T, *this)

class CEikIpAddressEditor : public CEikMfne
	{
public:
	CEikIpAddressEditor();
	IMPORT_C TInt SetIpAddress(const TDesC& aIpAddress); // returns either KErrGeneral or KErrNone
	IMPORT_C void GetIpAddress(TDes& aIpAddress) const; // can only be called if PrepareForFocusLossL() succeeded
	// framework
	virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
	virtual void ConstructFromResourceL(TResourceReader&); // no resource is actually read
private:
	enum {ENumberOfIpAddressNumbers=4};
	enum {EMinimumLengthOfAnIpAddressNumber=1};
	enum {EMaximumLengthOfAnIpAddressNumber=3};
	enum {EMinimumValueOfAnIpAddressNumber=0};
	enum {EMaximumValueOfAnIpAddressNumber=255};
public:
	enum {EMaximumLengthOfAnIpAddress=(ENumberOfIpAddressNumbers*EMaximumLengthOfAnIpAddressNumber)+(ENumberOfIpAddressNumbers-1)};
private:
	TChar iNudgeCharMinus;
	TChar iNudgeCharPlus;
	// none of these pointers owns anything
	CEikMfneNumber* (iIpAddressNumber[ENumberOfIpAddressNumbers]);
	};

class CEikHelpViewer : private CEikDialog
	{
public:
	IMPORT_C static void ExecuteL(TInt aResourceId);
private:
	CEikHelpViewer();
	// from CBase
	virtual ~CEikHelpViewer();
private:
	HBufC* iBuffer;
	TPtr iText;
	};

class CEikXtraDialog : public CEikDialog
	{
public:
	IMPORT_C virtual SEikControlInfo CreateCustomControlL(TInt aControlType);
	IMPORT_C static TBool CreateEikXtraControlL(TInt aControlType, SEikControlInfo& aControlInfo);
	};

#endif
