// This may look like C code, but it's really -*- C++ -*-
/*
 * Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
 *
 * See the LICENSE file for terms of use.
 */
#ifndef WLAYOUT_ITEM_IMPL_H_
#define WLAYOUT_ITEM_IMPL_H_

#include <Wt/WDllDefs.h>

namespace Wt {

class WLayoutItem;
class WWidget;

/*! \class WLayoutItemImpl Wt/WLayoutItemImpl Wt/WLayoutItemImpl
 *  \brief An abstract base class for implementing layout managers.
 *
 * \sa WLayoutItem, WLayout
 */
class WT_API WLayoutItemImpl
{
public:
  /*! \brief Destroy a layout item implementation.
   */
  virtual ~WLayoutItemImpl();

  /*! \brief Add a layout <i>item</i>.
   *
   * The <i>item</i> already has an implementation set.
   */
  virtual void updateAddItem(WLayoutItem *item) = 0;

  /*! \brief Remove a layout <i>item</i>.
   */
  virtual void updateRemoveItem(WLayoutItem *item) = 0;

  /*! \brief Update the layout.
   */
  virtual void update(WLayoutItem *item) = 0;

  /*! \brief Get the widget for which this layout item participates in layout management.
   */
  virtual WWidget *parent() const = 0;

protected:
  /*! \brief Create a layout item implementation.
   */
  WLayoutItemImpl();
};

}

#endif // WLAYOUT_ITEM_IMPL_H_
