/*
    knetd, KDE Network Daemon

    Copyright (c) 2005 by Engin AYDOGAN		<engin @ bzzzt.biz>

    *************************************************************************
    *                                                                       *
    * This program is free software; you can redistribute it and/or modify  *
    * it under the terms of the GNU General Public License as published by  *
    * the Free Software Foundation; either version 2 of the License, or     *
    * (at your option) any later version.                                   *
    *                                                                       *
    *************************************************************************
*/

#ifndef POPUP_MANAGER_H_
#define POPUP_MANAGER_H_

#include <qobject.h>

class PopupDispatch;

class PopupManager: public QObject
{
public:
	enum Type { AutoDelete = 0x1, AutoHide = 0x1, Sticky = 0x2, DieOnClick = 0x4, Animation = 0x8 };
	PopupManager();
	virtual ~PopupManager();
	virtual void enqueue( QWidget*, int t = ( AutoDelete | Animation | DieOnClick ), int timeout = 6000 );
	void setDefaultOrigin( const QPoint& );
	QPoint defaultOrigin() const;
	void setLast( PopupDispatch* );
	virtual void timerEvent( QTimerEvent* );
	class Private;
private:
	Private* d;
};

class PopupInternal
{
public:
	PopupInternal( QWidget* w = 0, int f = PopupManager::Sticky | PopupManager::DieOnClick, int to = 6000 )
	 : widget( w ), flags( f ), timeout( to ) {}
	QWidget* widget;
	int flags;
	int timeout;
};

#endif
