//
//  Beta release only.
//
//  Copyright(c) Ivyware Pty Ltd 2013  (all rights reserved)
//               MELBOURNE, VICTORIA, AUSTRALIA, 3130
//
//  Provided no fee is charged (either by the distributer or user)
//  permission to use, copy, modify, and distribute this software and
//  its documentation for any purpose and without fee is hereby granted,
//  provided that the above copyright notice appear in all copies and
//  that both that copyright notice and this permission notice appear
//  in supporting documentation.
//
//  No waranty or suitablity for purpose is implied.
//
//
//  Extented IMAPIProp environment wrapper class
//  NOTES: Manages all subordinate IMAPIProp specific resources
//      
#pragma once
#include "P2PmsgMAPI.h"

class CMAPIEx;
class CMAPIFolder;

/////////////////////////////////////////////////////////////
//  CMAPIProp class
//  NOTES: Primarily wraps and manages the IMAPIProp interface

class P2PmsgMAPI_EXT CMAPIProp
{
    // Constructors and destructor
    public:
	      CMAPIProp ( );
      virtual
	     ~CMAPIProp ( );

    // Attributes
    protected:
	    IMAPIProp    *m_pIMAPIProp;
	    SBinary       m_oSBinEntryID;

    // Operations
    protected:
      HRESULT
        GetProperty ( ULONG ulProperty, LPSPropValue& prop );
      HRESULT
        GetPropTagArray ( LPCTSTR lpszFieldName, LPSPropTagArray& lppPropTags, int& nFieldType, BOOL bCreate);
    public:
      void
        SetSBinEntryID ( SBinary *pSBinEntryID = nullptr );
      SBinary*
        GetSBinEntryID ( );
      void
        Close ( );

	  // Properties
    public:
      HRESULT
        GetPropertyString ( ULONG ulProperty, CString& strProperty );
      HRESULT
        GetPropertyViaStream ( ULONG ulProperty, CString& strProperty );
      int
        GetPropertyValue ( ULONG ulProperty, int nDefaultValue );
      virtual BOOL
        SetPropertyString ( ULONG ulProperty, LPCTSTR lpszProperty, BOOL bStream=FALSE );
};
