/* 
 * 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_form.h"

namespace mforms {
namespace stub {

bool __stdcall FormImpl::create(::mforms::Form *self, ::mforms::Form *owner, mforms::FormFlag flag)
{
  return true;
}


void __stdcall FormImpl::set_title(::mforms::Form *self, const std::string &title)
{
}

void FormImpl::accept_clicked(bool *status, const bool is_run)
{
}

void FormImpl::cancel_clicked(bool *status, const bool is_run)
{
}

void __stdcall FormImpl::show_modal(::mforms::Form *self, ::mforms::Button *accept, ::mforms::Button *cancel)
{
}

bool __stdcall FormImpl::run_modal(::mforms::Form *self, ::mforms::Button *accept, ::mforms::Button *cancel)
{
  return false;
}

void __stdcall FormImpl::close(::mforms::Form *self)
{
}

void __stdcall FormImpl::set_content(::mforms::Form *self, ::mforms::View *child)
{
}

void __stdcall FormImpl::flush_events(::mforms::Form *self)
{
}

void __stdcall FormImpl::center(Form *self)
{
}

void __stdcall FormImpl::end_modal(Form *self, bool result)
{
}


FormImpl::FormImpl(::mforms::Form *form, ::mforms::Form *owner, mforms::FormFlag form_flag)
  : ViewImpl(form)
{
}

void FormImpl::set_size(int width, int height)
{
}

void FormImpl::init()
{
  ::mforms::ControlFactory *f = ::mforms::ControlFactory::get_instance();

  f->_form_impl.create     = &FormImpl::create;
  f->_form_impl.close      = &FormImpl::close;
  f->_form_impl.set_title  = &FormImpl::set_title;
  f->_form_impl.show_modal = &FormImpl::show_modal;
  f->_form_impl.run_modal = &FormImpl::run_modal;
  f->_form_impl.set_content= &FormImpl::set_content;
  f->_form_impl.flush_events= &FormImpl::flush_events;
  f->_form_impl.center      = &FormImpl::center;
  f->_form_impl.end_modal = &FormImpl::end_modal;
}

};
};
