/* 
 * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
 *
 * 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; version 2 of the
 * License.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301  USA
 */
#include "tut_stdafx.h"

#include "../stub_listbox.h"

namespace mforms
{
namespace stub
{

//------------------------------------------------------------------------------
ListBoxImpl::ListBoxImpl(::mforms::ListBox *self, bool multi_select)
  : ViewImpl(self)
{
}

//------------------------------------------------------------------------------
void __stdcall ListBoxImpl::selection_changed(::mforms::ListBox *self)
{
}

//------------------------------------------------------------------------------
bool __stdcall ListBoxImpl::create(::mforms::ListBox *self, bool multi_select)
{
  return true;
}

//------------------------------------------------------------------------------
void __stdcall ListBoxImpl::clear(::mforms::ListBox *self)
{
}

//------------------------------------------------------------------------------
int __stdcall ListBoxImpl::add_item(::mforms::ListBox *self, const std::string &item)
{
  return 0;
}

//------------------------------------------------------------------------------
void __stdcall ListBoxImpl::add_items(::mforms::ListBox *self, const std::list<std::string> &items)
{
}

//------------------------------------------------------------------------------
std::string __stdcall ListBoxImpl::get_text(::mforms::ListBox *self)
{
  return "";
}

//------------------------------------------------------------------------------
void __stdcall ListBoxImpl::set_index(::mforms::ListBox *self, int index)
{
}

//------------------------------------------------------------------------------
int __stdcall ListBoxImpl::get_index(::mforms::ListBox *self)
{
  return -1;
}

//------------------------------------------------------------------------------
void __stdcall ListBoxImpl::set_heading(ListBox *self, const std::string &text)
{
}

//------------------------------------------------------------------------------
std::vector<int> __stdcall ListBoxImpl::get_selected_indices(ListBox *self)
{
  std::vector<int> res;
  return res;
}

//------------------------------------------------------------------------------
void ListBoxImpl::init()
{
  ::mforms::ControlFactory *f = ::mforms::ControlFactory::get_instance();

  f->_listbox_impl.create                 = &ListBoxImpl::create;
  f->_listbox_impl.clear                  = &ListBoxImpl::clear;
  f->_listbox_impl.add_item               = &ListBoxImpl::add_item;
  f->_listbox_impl.add_items              = &ListBoxImpl::add_items;
  f->_listbox_impl.set_index              = &ListBoxImpl::set_index;
  f->_listbox_impl.get_index              = &ListBoxImpl::get_index;
  f->_listbox_impl.get_selected_indices   = &ListBoxImpl::get_selected_indices;
  f->_listbox_impl.get_text               = &ListBoxImpl::get_text;
  f->_listbox_impl.set_heading            = &ListBoxImpl::set_heading;
}

}
}
