/* imap-search-command.c generated by valac 0.56.19, the Vala compiler
 * generated from imap-search-command.vala, do not modify */

/*
 * Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */

#include "geary-engine.h"
#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	GEARY_IMAP_SEARCH_COMMAND_0_PROPERTY,
	GEARY_IMAP_SEARCH_COMMAND_NUM_PROPERTIES
};
static GParamSpec* geary_imap_search_command_properties[GEARY_IMAP_SEARCH_COMMAND_NUM_PROPERTIES];

static gpointer geary_imap_search_command_parent_class = NULL;

static GType geary_imap_search_command_get_type_once (void);

GearyImapSearchCommand*
geary_imap_search_command_construct (GType object_type,
                                     GearyImapSearchCriteria* criteria,
                                     GCancellable* should_send)
{
	GearyImapSearchCommand * self = NULL;
	GearyImapListParameter* _tmp0_;
	GearyImapListParameter* _tmp1_;
	g_return_val_if_fail (GEARY_IMAP_IS_SEARCH_CRITERIA (criteria), NULL);
	g_return_val_if_fail ((should_send == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (should_send, g_cancellable_get_type ()), NULL);
	self = (GearyImapSearchCommand*) geary_imap_command_construct (object_type, GEARY_IMAP_SEARCH_COMMAND_NAME, NULL, (gint) 0, should_send);
	_tmp0_ = geary_imap_command_get_args (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_IMAP_TYPE_COMMAND, GearyImapCommand));
	_tmp1_ = _tmp0_;
	geary_imap_list_parameter_extend (_tmp1_, G_TYPE_CHECK_INSTANCE_CAST (criteria, GEARY_IMAP_TYPE_LIST_PARAMETER, GearyImapListParameter));
	return self;
}

GearyImapSearchCommand*
geary_imap_search_command_new (GearyImapSearchCriteria* criteria,
                               GCancellable* should_send)
{
	return geary_imap_search_command_construct (GEARY_IMAP_TYPE_SEARCH_COMMAND, criteria, should_send);
}

GearyImapSearchCommand*
geary_imap_search_command_construct_uid (GType object_type,
                                         GearyImapSearchCriteria* criteria,
                                         GCancellable* should_send)
{
	GearyImapSearchCommand * self = NULL;
	GearyImapListParameter* _tmp0_;
	GearyImapListParameter* _tmp1_;
	g_return_val_if_fail (GEARY_IMAP_IS_SEARCH_CRITERIA (criteria), NULL);
	g_return_val_if_fail ((should_send == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (should_send, g_cancellable_get_type ()), NULL);
	self = (GearyImapSearchCommand*) geary_imap_command_construct (object_type, GEARY_IMAP_SEARCH_COMMAND_UID_NAME, NULL, (gint) 0, should_send);
	_tmp0_ = geary_imap_command_get_args (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_IMAP_TYPE_COMMAND, GearyImapCommand));
	_tmp1_ = _tmp0_;
	geary_imap_list_parameter_extend (_tmp1_, G_TYPE_CHECK_INSTANCE_CAST (criteria, GEARY_IMAP_TYPE_LIST_PARAMETER, GearyImapListParameter));
	return self;
}

GearyImapSearchCommand*
geary_imap_search_command_new_uid (GearyImapSearchCriteria* criteria,
                                   GCancellable* should_send)
{
	return geary_imap_search_command_construct_uid (GEARY_IMAP_TYPE_SEARCH_COMMAND, criteria, should_send);
}

static void
geary_imap_search_command_class_init (GearyImapSearchCommandClass * klass,
                                      gpointer klass_data)
{
	geary_imap_search_command_parent_class = g_type_class_peek_parent (klass);
}

static void
geary_imap_search_command_instance_init (GearyImapSearchCommand * self,
                                         gpointer klass)
{
}

/**
 * A representation of the IMAP SEARCH command.
 *
 * See [[http://tools.ietf.org/html/rfc3501#section-6.4.4]].
 */
 G_GNUC_NO_INLINE static GType
geary_imap_search_command_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GearyImapSearchCommandClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) geary_imap_search_command_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GearyImapSearchCommand), 0, (GInstanceInitFunc) geary_imap_search_command_instance_init, NULL };
	GType geary_imap_search_command_type_id;
	geary_imap_search_command_type_id = g_type_register_static (GEARY_IMAP_TYPE_COMMAND, "GearyImapSearchCommand", &g_define_type_info, 0);
	return geary_imap_search_command_type_id;
}

GType
geary_imap_search_command_get_type (void)
{
	static gsize geary_imap_search_command_type_id__once = 0;
	if (g_once_init_enter (&geary_imap_search_command_type_id__once)) {
		GType geary_imap_search_command_type_id;
		geary_imap_search_command_type_id = geary_imap_search_command_get_type_once ();
		g_once_init_leave (&geary_imap_search_command_type_id__once, geary_imap_search_command_type_id);
	}
	return geary_imap_search_command_type_id__once;
}

