// Note: Instrumentation statements are highlighted in green

#include "HomeInfo.hpp"
#include "string_io.hpp"

///////////////////////////////////////////////////////////////////////////////
// HomeInfo class
///////////////////////////////////////////////////////////////////////////////

// Visual Member Definition
VISIBILITY_START(HomeInfo, "Home Info", 3)
VVARIABLE(HomeInfo, street, "Street Address", 0, 0)
VVARIABLE(HomeInfo, city, "City", 0, 0)
VVARIABLE(HomeInfo, state, "State/Province", 0, 0)
VVARIABLE(HomeInfo, zipCode, "Zip Code", 0, 0)
VVARIABLE(HomeInfo, country, "Country/Region", 0, 0)
VVARIABLE(HomeInfo, phone, "Phone", 0, 0)
VVARIABLE(HomeInfo, fax, "Fax", 0, 0)
VVARIABLE(HomeInfo, mobile, "Mobile", 0, 0)
VVARIABLE(HomeInfo, webPage, "Web Page", 0, 0)
VVOID_FUNCTION(HomeInfo, clear, "Clear", 0, 0)
VISIBILITY_END

HomeInfo::HomeInfo(void)
{
}

HomeInfo::HomeInfo(const HomeInfo & that)
{
  *this = that;
}

HomeInfo::~HomeInfo(void)
{
}

HomeInfo & HomeInfo::operator =(const HomeInfo & that)
{
  if (this != &that) {
    street = that.street;
    city = that.city;
    state = that.state;
    zipCode = that.zipCode;
    country = that.country;
    phone = that.phone;
    fax = that.fax;
    mobile = that.mobile;
    webPage = that.webPage;
  }
  return *this;
}

std::ostream & operator<< (std::ostream& os, HomeInfo & out_obj)
{
  write_string(os, out_obj.street);
  write_string(os, out_obj.city);
  write_string(os, out_obj.state);
  write_string(os, out_obj.zipCode);
  write_string(os, out_obj.country);
  write_string(os, out_obj.phone);
  write_string(os, out_obj.fax);
  write_string(os, out_obj.mobile);
  write_string(os, out_obj.webPage);
  return os;
}

std::istream & operator>> (std::istream & is, HomeInfo & in_obj)
{
  read_string(is, in_obj.street);
  read_string(is, in_obj.city);
  read_string(is, in_obj.state);
  read_string(is, in_obj.zipCode);
  read_string(is, in_obj.country);
  read_string(is, in_obj.phone);
  read_string(is, in_obj.fax);
  read_string(is, in_obj.mobile);
  read_string(is, in_obj.webPage);
  return is;
}

void HomeInfo::clear(void)
{
  street = "";
  city = "";
  state = "";
  zipCode = "";
  country = "";
  phone = "";
  fax = "";
  mobile = "";
  webPage = "";
}

void HomeInfo::populateEditView(void)
{
  street = "1515 Easy Street";
  city = "Sunnyville";
  state = "Texas";
  zipCode = "76744";
  country = "USA";
  phone = "717-232-1111";
  fax = "717-232-1112";
  mobile = "618-332-1325";
  webPage = "www.mgoose.net\\jacksprat\\index.html";
}

Copyright 2002-2007 Outerface Technologies, Inc.