/* Copyright (C) 2017 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 */

_DEFS(gdkmm,gdk)

#include <gdkmm/contentformats.h>

namespace Gdk
{

/** Helper class for building Gdk::ContentFormats.
 *
 * @newin{3,94}
 */
class GDKMM_API ContentFormatsBuilder final
{
  // ContentFormatsBuilder is registered as a boxed type, but it has custom
  // reference-counting instead of copy/free functions, so we use it via RefPtr.
  _CLASS_OPAQUE_REFCOUNTED(ContentFormatsBuilder, GdkContentFormatsBuilder, NONE, gdk_content_formats_builder_ref, gdk_content_formats_builder_unref, GDKMM_API)
  _IGNORE(gdk_content_formats_builder_ref, gdk_content_formats_builder_unref)

public:
  // It's possible to specify gdk_content_formats_builder_new in the _CLASS_OPAQUE_REFCOUNTED()
  // macro, and have the create() method generated from there, but then it would not
  // be possible to add documentation to create().
  /** Creates a new %ContentFormatsBuilder object.
   *
   * The resulting builder would create an empty ContentFormats.
   * Use addition functions to add types to it.
   *
   * @return A new %ContentFormatsBuilder.
   */
   _WRAP_METHOD(static Glib::RefPtr<ContentFormatsBuilder> create(), gdk_content_formats_builder_new)

  _WRAP_METHOD(void add_formats(const Glib::RefPtr<const ContentFormats>& formats),
    gdk_content_formats_builder_add_formats)
  _WRAP_METHOD(void add_mime_type(const Glib::ustring& mime_type),
    gdk_content_formats_builder_add_mime_type)
  _WRAP_METHOD(void add_gtype(GType gtype), gdk_content_formats_builder_add_gtype)

  /** Creates a new Gdk::ContentFormats.
   *
   * The %ContentFormatsBuilder is reset once this function returns;
   * you cannot call this function multiple times on the same builder instance.
   *
   * @return A newly created Gdk::ContentFormats with all the formats added to the builder.
   */
  _WRAP_METHOD(Glib::RefPtr<ContentFormats> to_formats(), gdk_content_formats_builder_to_formats)
  _IGNORE(gdk_content_formats_builder_free_to_formats)dnl// for C programmers
};

} // namespace Gdk
