/*
 * Copyright (c) 2002 Robert Collins.
 * Copyright (c) 2005-2006 Tom N Harris.
 *
 *     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.
 *
 *     A copy of the GNU General Public License can be found at
 *     http://www.gnu.org/
 *
 * Written by Robert Collins <robertc@hotmail.com>
 * Written by Tom N Harris <telliamed@whoopdedo.org>
 *
 */

#ifndef SETUP_PICKCATEGORYLINE_H
#define SETUP_PICKCATEGORYLINE_H

#include <vector>

#include "PickLine.h"

namespace Setup
{

class PickView;

class PickCategoryLine : public PickLine
{
public:
	PickCategoryLine(PickView & aView)
		: PickLine(), m_view(aView), m_collapsed(false)
	{
	};
	PickCategoryLine(PickView & aView, String const & aName)
		: PickLine(aName), m_view(aView), m_label(aName), m_collapsed(false)
	{
	};
	~PickCategoryLine()
	{
		clear();
	};
	virtual void paint(HDC hdc, int x, int y, int row, int indent);
	virtual int click(int myrow, int ClickedRow, int x, int indent);
	virtual int itemCount() const;
	virtual bool isContainer(void) const
	{
		return true;
	};
	virtual void insert(PickLine * aLine)
	{
		m_contents.push_back(aLine);
	};
	virtual PickLine * find(const char* key);
	virtual void clear();
	virtual void setColumn(int, String const &)
	{
	};
	virtual CheckState getCheckState() const;
	virtual void setCheckState(CheckState checked);
	virtual PickLine * getRow(int row);

private:
	PickCategoryLine(PickCategoryLine const &);
	PickCategoryLine & operator=(PickCategoryLine const &);

	std::vector<PickLine*> m_contents;
	PickView& m_view;
	String m_label;
	bool m_collapsed;
};

};

#endif /* SETUP_PICKCATEGORYLINE_H */
