// Note: Instrumentation statements are highlighted in green

#ifndef __NAMEINFO_HPP
#define __NAMEINFO_HPP

#include <iostream>
#include <vobject.hpp>
#include <vutility.hpp>

using namespace visibility;


const unsigned short FIRST                    = 0x0001;
const unsigned short FIRST_MIDDLE_LAST        = 0x0002;
const unsigned short LAST_FIRST_MIDDLE        = 0x0003;
const unsigned short LAST_COMMA_FIRST_MIDDLE  = 0x0004;
const unsigned short NICKNAME                  = 0x0005;


///////////////////////////////////////////////////////////////////////////////
// Bitset definitions
///////////////////////////////////////////////////////////////////////////////

VBITSET_START(DisplayFormat)
VEXCLUSIVE_VALUE(FIRST, 0xffff, "First", 0)
VEXCLUSIVE_VALUE(FIRST_MIDDLE_LAST, 0xffff, "First Middle Last", 0)
VEXCLUSIVE_VALUE(LAST_FIRST_MIDDLE, 0xffff, "Last First Middle", 0)
VEXCLUSIVE_VALUE(LAST_COMMA_FIRST_MIDDLE, 0xffff, "Last, First Middle", 0)
VEXCLUSIVE_VALUE(NICKNAME, 0xffff, "Nickname", 0)
VBITSET_END

///////////////////////////////////////////////////////////////////////////////
// NameInfo class
///////////////////////////////////////////////////////////////////////////////

class NameInfo : public VObject   // Add VObject to the inheritance chain
{
  DECLARE_VISIBILITY(NameInfo)      // Instrumentation statement

public: // data
  std::string first;
  std::string middle;
  std::string last;
  std::string title;
  std::string nickName;
  std::string displayName;
  unsigned short displayFormat;

public: // functions
  NameInfo(void);
  NameInfo(const NameInfo & that);
  virtual ~NameInfo(void);
  NameInfo & operator =(const NameInfo & that);
  bool operator==(const NameInfo & that) const;
  bool operator!=(const NameInfo & that) const;
  bool operator<(const NameInfo & that) const;
  bool operator>(const NameInfo & that) const;
  virtual char * createDisplayName(void);
  void clear(void);
  virtual void populateEditView(void);
  friend std::ostream & operator<< (std::ostream & os, NameInfo & obj);
  friend std::istream & operator>> (std::istream & is, NameInfo & obj);
};
DECLARE_VISIBILITY_CREATOR(NameInfo)      // Instrumentation statement

#endif // __NAMEINFO_HPP
Copyright 2002-2007 Outerface Technologies, Inc.