/****************************************************************************
** Interface to the GUI.
**
** Created: Wed Feb 26 22:48:00 2004
**      by: Varol Okan using kate editor
**
**
****************************************************************************/

#ifndef DIALOGBUTTON_H
#define DIALOGBUTTON_H

// the designer created GUI.
#include "uidialogbutton.h"

class QFrame;
class QPaintEvent;
class ButtonObject;
class ButtonPreview;
class SourceFileEntry;
class SourceFileInfo;
class MenuPreview;

class DialogButton : public uiDialogButton
{
	Q_OBJECT
public:
	 DialogButton (QWidget * parent, const char * name = 0, WFlags f = 0 );
	~DialogButton ();

	void initMe(ButtonObject *, MenuPreview *);
	void setSourceFiles(QValueList<SourceFileEntry *>);
	void setSubMenus (QStringList);
	void setMenuButtons (QStringList);
	void setButtonCreation (bool);

protected:
	void initNext        ( );
	void initActions     ( );
	void initActionState ( );
	void initSystem ( MenuPreview *, ButtonObject * );
	SourceFileEntry *getSelectedSourceEntry  ( );
	SourceFileInfo  *getSelectedSourceFile   ( );
	void removeFromString ( QString &, QString );

signals:
	void signalUpdateStructure();
	void signalUpdatePixmap();


protected slots:
	virtual void slotAdjustSize (   );
	virtual void slotAction1    (int);
	virtual void slotSourceEntry(int);
	virtual void slotSourceFile (int);
	virtual void slotChapters   (int);
	virtual void slotChapters2  (int);
	virtual void slotSystem     (int);
	virtual void slotHelpAction();
	virtual void slotHelpGoto();
	virtual void slotHelp();
	virtual void slotHelpSystem();
	virtual void slotOkay();
	virtual void slotCancel();
	virtual void slotAdvanced();
	virtual void slotTabChanged (QWidget *);
	virtual void slotEditActionChanged(const QString &);

protected:
	ButtonObject *m_pButtonObject;
	ButtonObject *m_pClonedButton;

	ButtonPreview *m_pFramePreviewNormal;
	ButtonPreview *m_pFrameHighlighted;
	ButtonPreview *m_pFrameSelected;

	QValueList<SourceFileEntry *> m_listSourceFileEntries;	// Retrieve the info from the QDVDAuthor class
	QStringList m_listSubMenus;	// Retrieve the info from the CDVDMeun class
	QStringList m_listMenuButtons;	// Retrieve the info from the CDVDMenu class
	
	// The following flag is needed to diff between a newly created Button and a opening of the Dialog with
	// an already existing Button. This is helping the cancelation of the Dialog.
	bool m_bButtonCreation;
	bool m_bAutomatic;
};

#endif // DIALOGBUTTON_H
