// Note: Instrumentation statements are highlighted in green

#include "BusinessInfo.hpp"
#include "string_io.hpp"

///////////////////////////////////////////////////////////////////////////////
// BusinessInfo class
///////////////////////////////////////////////////////////////////////////////

// Visual Member Definition
VISIBILITY_START(BusinessInfo, "Business Info", 4)
VVARIABLE(BusinessInfo, company, "Company", 0, 0)
VVARIABLE(BusinessInfo, street, "Street Address", 0, 0)
VVARIABLE(BusinessInfo, city, "City", 0, 0)
VVARIABLE(BusinessInfo, state, "State/Province", 0, 0)
VVARIABLE(BusinessInfo, zipCode, "Zip Code", 0, 0)
VVARIABLE(BusinessInfo, country, "Country/Region", 0, 0)
VVARIABLE(BusinessInfo, jobTitle, "Job Title", 0, 0)
VVARIABLE(BusinessInfo, department, "Department", 0, 0)
VVARIABLE(BusinessInfo, office, "Office", 0, 0)
VVARIABLE(BusinessInfo, phone, "Phone", 0, 0)
VVARIABLE(BusinessInfo, fax, "Fax", 0, 0)
VVARIABLE(BusinessInfo, pager, "Pager", 0, 0)
VVARIABLE(BusinessInfo, ipPhone, "IP Phone", 0, 0)
VVOID_FUNCTION(BusinessInfo, clear, "Clear", 0, 0)
VISIBILITY_END

BusinessInfo::BusinessInfo(void)
{
}

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

BusinessInfo::~BusinessInfo(void)
{
}

BusinessInfo & BusinessInfo::operator =(const BusinessInfo & that)
{
  if (this != &that) {
    company = that.company;
    street = that.street;
    city = that.city;
    state = that.state;
    zipCode = that.zipCode;
    country = that.country;
    jobTitle = that.jobTitle;
    department = that.department;
    office = that.office;
    phone = that.phone;
    fax = that.fax;
    pager = that.pager;
    ipPhone = that.ipPhone;
    webPage = that.webPage;
  }
  return *this;
}

std::ostream & operator<< (std::ostream& os, BusinessInfo & out_obj)
{
  write_string(os, out_obj.company);
  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.jobTitle);
  write_string(os, out_obj.department);
  write_string(os, out_obj.office);
  write_string(os, out_obj.phone);
  write_string(os, out_obj.fax);
  write_string(os, out_obj.pager);
  write_string(os, out_obj.ipPhone);
  write_string(os, out_obj.webPage);
  return os;
}

std::istream & operator>> (std::istream & is, BusinessInfo & in_obj)
{
  read_string(is, in_obj.company);
  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.jobTitle);
  read_string(is, in_obj.department);
  read_string(is, in_obj.office);
  read_string(is, in_obj.phone);
  read_string(is, in_obj.fax);
  read_string(is, in_obj.pager);
  read_string(is, in_obj.ipPhone);
  read_string(is, in_obj.webPage);
  return is;
}

void BusinessInfo::clear(void)
{
  company = "";
  street = "";
  city = "";
  state = "";
  zipCode = "";
  country = "";
  jobTitle = "";
  department = "";
  office = "";
  phone = "";
  fax = "";
  pager = "";
  ipPhone = "";
  webPage = "";
}

void BusinessInfo::populateEditView(void)
{
  company = "The Company Inc.";
  street = "1131 Busy Ave.";
  city = "Uptown";
  state = "Texas";
  zipCode = "74411";
  country = "USA";
  jobTitle = "COO";
  department = "Executive";
  office = "Suite 1121";
  phone = "317-437-7825";
  fax = "N/A";
  pager = "N/A";
  ipPhone = "N/A";
  webPage = "www.thecompany.com";
}

Copyright 2002-2007 Outerface Technologies, Inc.