/***************************************************************************

    supportware
    Copyright (C) 2001-2008 by c.holzheuer
    c.holzheuer@sourceworx.org

    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 DDWEBBLOCK_H
#define DDWEBBLOCK_H

#include <dditemtree.h>
#include <ddwebrequest.h>
#include <ddstringrow.h>
#include <ddthreadrunnable.h>
#include <dddatatable.h>
#include <ddwebconnection.h>
#include <ddthreadmutex.h>
#include <ddwebview.h>

class ddwebsite;
class ddiobuffer;
class ddwebpage;
class ddusermanager;
class ddusersessionmanager;
class ddmailmanager;
class dduserid;
class ddwebcgi;

#define DDBLOCKTXT1 "<table border='1' width='100%' bgcolor='gray'><tr><td><h1><font color='red'>" 
#define DDBLOCKTXT2 "</font></h1></td></tr></table><br>"

/// ddwebblock: site-globaler html-content, etwa top-10 user etc.
/**
	ddwebblock: site-globaler html-content, etwa top-10 user etc.
*/

class ddwebblock : public dddataclient
{
public:
    
	//ddwebblock();
  ddwebblock( const ddstring& name, ddwebsite* site );
  virtual ~ddwebblock();
  
  virtual dd_result handle_request( ddwebpage& pagelet, dditem& item );
 
  
protected:
  
  virtual dd_result create_content( ddwebpage& pagelet, dditem& item );

	ddwebview*		_table;
	ddstring			_content;
	ddthreadmutex _blocklock;
  
};

typedef ddmapptr<ddwebblock>  ddwebblockmap;

#endif
