/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.8
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.pjsip.pjsua;

public class pjsua_msg_data {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected pjsua_msg_data(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(pjsua_msg_data obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        pjsuaJNI.delete_pjsua_msg_data(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void setHdr_list(SWIGTYPE_p_pjsip_hdr value) {
    pjsuaJNI.pjsua_msg_data_hdr_list_set(swigCPtr, this, SWIGTYPE_p_pjsip_hdr.getCPtr(value));
  }

  public SWIGTYPE_p_pjsip_hdr getHdr_list() {
    return new SWIGTYPE_p_pjsip_hdr(pjsuaJNI.pjsua_msg_data_hdr_list_get(swigCPtr, this), true);
  }

  public void setContent_type(pj_str_t value) {
    pjsuaJNI.pjsua_msg_data_content_type_set(swigCPtr, this, pj_str_t.getCPtr(value), value);
  }

  public pj_str_t getContent_type() {
    long cPtr = pjsuaJNI.pjsua_msg_data_content_type_get(swigCPtr, this);
    return (cPtr == 0) ? null : new pj_str_t(cPtr, false);
  }

  public void setMsg_body(pj_str_t value) {
    pjsuaJNI.pjsua_msg_data_msg_body_set(swigCPtr, this, pj_str_t.getCPtr(value), value);
  }

  public pj_str_t getMsg_body() {
    long cPtr = pjsuaJNI.pjsua_msg_data_msg_body_get(swigCPtr, this);
    return (cPtr == 0) ? null : new pj_str_t(cPtr, false);
  }

  public void setMultipart_ctype(SWIGTYPE_p_pjsip_media_type value) {
    pjsuaJNI.pjsua_msg_data_multipart_ctype_set(swigCPtr, this, SWIGTYPE_p_pjsip_media_type.getCPtr(value));
  }

  public SWIGTYPE_p_pjsip_media_type getMultipart_ctype() {
    return new SWIGTYPE_p_pjsip_media_type(pjsuaJNI.pjsua_msg_data_multipart_ctype_get(swigCPtr, this), true);
  }

  public void setMultipart_parts(SWIGTYPE_p_pjsip_multipart_part value) {
    pjsuaJNI.pjsua_msg_data_multipart_parts_set(swigCPtr, this, SWIGTYPE_p_pjsip_multipart_part.getCPtr(value));
  }

  public SWIGTYPE_p_pjsip_multipart_part getMultipart_parts() {
    return new SWIGTYPE_p_pjsip_multipart_part(pjsuaJNI.pjsua_msg_data_multipart_parts_get(swigCPtr, this), true);
  }

  public pjsua_msg_data() {
    this(pjsuaJNI.new_pjsua_msg_data(), true);
  }

}
