#ifndef EFL_GENERATED_EFL_FILE_HH
#define EFL_GENERATED_EFL_FILE_HH

extern "C"
{
#include <Efl.h>
}
#include <Eo.hh>

#include <eo_cxx_interop.hh>

extern "C"
{
#include "efl_file.eo.h"
}

#include <string>

namespace efl {

struct file;

}

namespace eo_cxx {

namespace efl {

struct file
{
   /// @brief Save the given image object's contents to an (image) file.
   ///
   /// The extension suffix on @p file will determine which <b>saver
   /// module</b> Evas is to use when saving, thus the final file's
   /// format. If the file supports multiple data stored in it (Eet ones),
   /// you can specify the key to be used as the index of the image in it.
   ///
   /// You can specify some flags when saving the image.  Currently
   /// acceptable flags are @c quality and @c compress. Eg.: @c
   /// "quality=100 compress=9"
   ///
   /// @param file The filename to be used to save the image (extension
   /// obligatory).
   /// @param key The image key in the file (if an Eet one), or @c NULL,
   /// otherwise.
   /// @param flags String containing the flags to be used (@c NULL for
   /// none).
   ///
   bool save(std::string file_, ::efl::eina::optional< std::string > key_, ::efl::eina::optional< std::string > flags_) const;


   /// @brief Eject the represented object.
   ///
   /// Get rid of and clean the pointed resource.
   ///
   void eject() const;


   /// @brief Retrieve the source file from where an image object is to fetch the
   /// real image data (it may be an Eet file, besides pure image ones).
   ///
   /// You must @b not modify the strings on the returned pointers.
   ///
   /// @note Use @c NULL pointers on the file components you're not
   /// interested in: they'll be ignored by the function.
   ///
   /// @param file The image file path.
   /// @param key The image key in @p file (if its an Eet one), or @c
   /// NULL, otherwise.
   ///
   void file_get(const char ** file_, const char ** key_) const;


   /// @brief Set the source file from where an image object must fetch the real
   /// image data (it may be an Eet file, besides pure image ones).
   ///
   /// If the file supports multiple data stored in it (as Eet files do),
   /// you can specify the key to be used as the index of the image in
   /// this file.
   ///
   /// Example:
   /// @code
   /// img = evas_object_image_add(canvas);
   /// evas_object_image_file_set(img, "/path/to/img", NULL);
   /// err = evas_object_image_load_error_get(img);
   /// if (err != EVAS_LOAD_ERROR_NONE)
   /// {
   /// fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
   /// valid_path, evas_load_error_str(err));
   /// }
   /// else
   /// {
   /// evas_object_image_fill_set(img, 0, 0, w, h);
   /// evas_object_resize(img, w, h);
   /// evas_object_show(img);
   /// }
   /// @endcode
   ///
   /// @param file The image file path.
   /// @param key The image key in @p file (if its an Eet one), or @c
   /// NULL, otherwise.
   ///
   bool file_set(::efl::eina::optional< std::string > file_, ::efl::eina::optional< std::string > key_) const;



   static Eo_Class const* _eo_class()
   {
      return(EFL_FILE_INTERFACE);
   }

   operator ::efl::file() const;
   operator ::efl::file&();
   operator ::efl::file const&() const;

   template <typename D>
   struct address_of
   {
      operator ::efl::file*() const { return static_cast<::efl::file*>(static_cast<D const*>(this)->p); }
      operator ::efl::file const*() const { return static_cast<::efl::file const*>(static_cast<D const*>(this)->p); }
   };

   template <typename D>
   struct address_const_of
   {
      operator ::efl::file const*() const { return static_cast<::efl::file const*>(static_cast<D const*>(this)->p); }
   };

private:
   Eo* _concrete_eo_ptr() const
   {
      return static_cast<::efl::eo::concrete const*>(static_cast<void const*>(this))->_eo_ptr();
   }

};

}

}

namespace efl {

struct file
      : ::efl::eo::concrete
{
   file(::efl::eo::parent_type _p = (::efl::eo::parent = nullptr))
      : file(_ctors_call(_p))
   {}

   /// @brief Eo Constructor.
   ///
   /// Constructs the object from an Eo* pointer stealing its ownership.
   ///
   /// @param eo The Eo object pointer.
   ///
   explicit file(Eo* eo)
      : ::efl::eo::concrete(eo)
   {}

   /// @brief nullptr_t Constructor.
   ///
   /// Constructs an empty (null) object.
   ///
   explicit file(std::nullptr_t)
      : ::efl::eo::concrete(nullptr)
   {}

   /// @brief Copy Constructor.
   ///
   file(file const& other)
      : file(eo_ref(other._eo_ptr()))
   {}

   ~file() {}

   /// @brief Save the given image object's contents to an (image) file.
   ///
   /// The extension suffix on @p file will determine which <b>saver
   /// module</b> Evas is to use when saving, thus the final file's
   /// format. If the file supports multiple data stored in it (Eet ones),
   /// you can specify the key to be used as the index of the image in it.
   ///
   /// You can specify some flags when saving the image.  Currently
   /// acceptable flags are @c quality and @c compress. Eg.: @c
   /// "quality=100 compress=9"
   ///
   /// @param file The filename to be used to save the image (extension
   /// obligatory).
   /// @param key The image key in the file (if an Eet one), or @c NULL,
   /// otherwise.
   /// @param flags String containing the flags to be used (@c NULL for
   /// none).
   ///
   bool save(std::string file_, ::efl::eina::optional< std::string > key_, ::efl::eina::optional< std::string > flags_) const;


   /// @brief Eject the represented object.
   ///
   /// Get rid of and clean the pointed resource.
   ///
   void eject() const;


   /// @brief Retrieve the source file from where an image object is to fetch the
   /// real image data (it may be an Eet file, besides pure image ones).
   ///
   /// You must @b not modify the strings on the returned pointers.
   ///
   /// @note Use @c NULL pointers on the file components you're not
   /// interested in: they'll be ignored by the function.
   ///
   /// @param file The image file path.
   /// @param key The image key in @p file (if its an Eet one), or @c
   /// NULL, otherwise.
   ///
   void file_get(const char ** file_, const char ** key_) const;


   /// @brief Set the source file from where an image object must fetch the real
   /// image data (it may be an Eet file, besides pure image ones).
   ///
   /// If the file supports multiple data stored in it (as Eet files do),
   /// you can specify the key to be used as the index of the image in
   /// this file.
   ///
   /// Example:
   /// @code
   /// img = evas_object_image_add(canvas);
   /// evas_object_image_file_set(img, "/path/to/img", NULL);
   /// err = evas_object_image_load_error_get(img);
   /// if (err != EVAS_LOAD_ERROR_NONE)
   /// {
   /// fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
   /// valid_path, evas_load_error_str(err));
   /// }
   /// else
   /// {
   /// evas_object_image_fill_set(img, 0, 0, w, h);
   /// evas_object_resize(img, w, h);
   /// evas_object_show(img);
   /// }
   /// @endcode
   ///
   /// @param file The image file path.
   /// @param key The image key in @p file (if its an Eet one), or @c
   /// NULL, otherwise.
   ///
   bool file_set(::efl::eina::optional< std::string > file_, ::efl::eina::optional< std::string > key_) const;



   static Eo_Class const* _eo_class()
   {
      return(EFL_FILE_INTERFACE);
   }

   struct address_of
      : ::eo_cxx::efl::file::address_of<address_of>
      , ::efl::eo::detail::concrete_address_of
   {
      explicit address_of(::efl::file* p)
         : ::efl::eo::detail::concrete_address_of(p)
      {}
   };
   address_of operator&() { return address_of(this); }

   struct address_const_of
      : ::eo_cxx::efl::file::address_const_of<address_const_of>
      , ::efl::eo::detail::concrete_address_const_of
   {
      explicit address_const_of(::efl::file const* p)
         : ::efl::eo::detail::concrete_address_const_of(p)
      {}
   };
   address_const_of operator&() const { return address_const_of(this); }

private:
   static Eo* _ctors_call(::efl::eo::parent_type _p)
   {
      Eo* _ret_eo = eo_add_ref(EFL_FILE_INTERFACE, _p._eo_raw, );

      return _ret_eo;
   }

      Eo* _concrete_eo_ptr() const { return _eo_ptr(); }
};

static_assert(sizeof(::efl::file) == sizeof(Eo*), "");
static_assert(std::is_standard_layout<::efl::file>::value, "");

}

inline bool efl::file::save(std::string file_, ::efl::eina::optional< std::string > key_, ::efl::eina::optional< std::string > flags_) const
{
   Eina_Bool _tmp_ret;
   eo_do(_concrete_eo_ptr(), _tmp_ret = ::efl_file_save(::efl::eolian::to_c(file_), ::efl::eolian::to_c(key_), ::efl::eolian::to_c(flags_)));
   return ::efl::eolian::to_cxx<bool>(_tmp_ret, std::tuple<std::false_type>());
}


inline void efl::file::eject() const
{
   eo_do(_concrete_eo_ptr(), ::efl_file_eject());
}


inline void efl::file::file_get(const char ** file_, const char ** key_) const
{
   eo_do(_concrete_eo_ptr(), ::efl_file_get(file_, key_));
}


inline bool efl::file::file_set(::efl::eina::optional< std::string > file_, ::efl::eina::optional< std::string > key_) const
{
   Eina_Bool _tmp_ret;
   eo_do(_concrete_eo_ptr(), _tmp_ret = ::efl_file_set(::efl::eolian::to_c(file_), ::efl::eolian::to_c(key_)));
   return ::efl::eolian::to_cxx<bool>(_tmp_ret, std::tuple<std::false_type>());
}


inline bool eo_cxx::efl::file::save(std::string file_, ::efl::eina::optional< std::string > key_, ::efl::eina::optional< std::string > flags_) const
{
   Eina_Bool _tmp_ret;
   eo_do(_concrete_eo_ptr(), _tmp_ret = ::efl_file_save(::efl::eolian::to_c(file_), ::efl::eolian::to_c(key_), ::efl::eolian::to_c(flags_)));
   return ::efl::eolian::to_cxx<bool>(_tmp_ret, std::tuple<std::false_type>());
}


inline void eo_cxx::efl::file::eject() const
{
   eo_do(_concrete_eo_ptr(), ::efl_file_eject());
}


inline void eo_cxx::efl::file::file_get(const char ** file_, const char ** key_) const
{
   eo_do(_concrete_eo_ptr(), ::efl_file_get(file_, key_));
}


inline bool eo_cxx::efl::file::file_set(::efl::eina::optional< std::string > file_, ::efl::eina::optional< std::string > key_) const
{
   Eina_Bool _tmp_ret;
   eo_do(_concrete_eo_ptr(), _tmp_ret = ::efl_file_set(::efl::eolian::to_c(file_), ::efl::eolian::to_c(key_)));
   return ::efl::eolian::to_cxx<bool>(_tmp_ret, std::tuple<std::false_type>());
}


inline ::eo_cxx::efl::file::operator ::efl::file() const
{
   return *static_cast<::efl::file const*>(static_cast<void const*>(this));
}

inline ::eo_cxx::efl::file::operator ::efl::file&()
{
   return *static_cast<::efl::file*>(static_cast<void*>(this));
}

inline ::eo_cxx::efl::file::operator ::efl::file const&() const
{
   return *static_cast<::efl::file const*>(static_cast<void const*>(this));
}

template <typename T>
bool efl_file_save_wrapper(Eo* objid EINA_UNUSED, ::efl::eo::detail::Inherit_Private_Data* self, const char * file_, const char * key_, const char * flags_)
{
   bool _tmp_ret{};
   try
      {
         _tmp_ret = static_cast<T*>(self->this_)->save(::efl::eolian::to_cxx<std::string>(file_, std::tuple<std::false_type>()), ::efl::eolian::to_cxx<::efl::eina::optional< std::string >>(key_, std::tuple<std::false_type>()), ::efl::eolian::to_cxx<::efl::eina::optional< std::string >>(flags_, std::tuple<std::false_type>()));
      }
   catch (...)
      {
         eina_error_set( ::efl::eina::unknown_error() );
      }
   return _tmp_ret;
}

template <typename T>
void efl_file_eject_wrapper(Eo* objid EINA_UNUSED, ::efl::eo::detail::Inherit_Private_Data* self)
{
   try
      {
         static_cast<T*>(self->this_)->eject();
      }
   catch (...)
      {
         eina_error_set( ::efl::eina::unknown_error() );
      }
}

template <typename T>
void efl_file_file_get_wrapper(Eo* objid EINA_UNUSED, ::efl::eo::detail::Inherit_Private_Data* self, const char ** file_, const char ** key_)
{
   try
      {
         static_cast<T*>(self->this_)->file_get(file_, key_);
      }
   catch (...)
      {
         eina_error_set( ::efl::eina::unknown_error() );
      }
}

template <typename T>
bool efl_file_file_set_wrapper(Eo* objid EINA_UNUSED, ::efl::eo::detail::Inherit_Private_Data* self, const char * file_, const char * key_)
{
   bool _tmp_ret{};
   try
      {
         _tmp_ret = static_cast<T*>(self->this_)->file_set(::efl::eolian::to_cxx<::efl::eina::optional< std::string >>(file_, std::tuple<std::false_type>()), ::efl::eolian::to_cxx<::efl::eina::optional< std::string >>(key_, std::tuple<std::false_type>()));
      }
   catch (...)
      {
         eina_error_set( ::efl::eina::unknown_error() );
      }
   return _tmp_ret;
}

namespace efl { namespace eo { namespace detail {

template<>
struct operations< ::efl::file >
{
   template <typename T>
   struct type
   {
      virtual bool save(std::string file_, ::efl::eina::optional< std::string > key_, ::efl::eina::optional< std::string > flags_)
      {
         Eina_Bool _tmp_ret = {};

         eo_do_super(dynamic_cast<T*>(this)->_eo_ptr(),
               dynamic_cast<T*>(this)->_eo_class(),
               _tmp_ret = ::efl_file_save(::efl::eolian::to_c(file_), ::efl::eolian::to_c(key_), ::efl::eolian::to_c(flags_)));
            return ::efl::eolian::to_cxx<bool>(_tmp_ret, std::tuple<std::false_type>());
      }

      virtual void eject()
      {

         eo_do_super(dynamic_cast<T*>(this)->_eo_ptr(),
               dynamic_cast<T*>(this)->_eo_class(),
               ::efl_file_eject());
      }

      virtual void file_get(const char ** file_, const char ** key_)
      {

         eo_do_super(dynamic_cast<T*>(this)->_eo_ptr(),
               dynamic_cast<T*>(this)->_eo_class(),
               ::efl_file_get(file_, key_));
      }

      virtual bool file_set(::efl::eina::optional< std::string > file_, ::efl::eina::optional< std::string > key_)
      {
         Eina_Bool _tmp_ret = {};

         eo_do_super(dynamic_cast<T*>(this)->_eo_ptr(),
               dynamic_cast<T*>(this)->_eo_class(),
               _tmp_ret = ::efl_file_set(::efl::eolian::to_c(file_), ::efl::eolian::to_c(key_)));
            return ::efl::eolian::to_cxx<bool>(_tmp_ret, std::tuple<std::false_type>());
      }

   };
};


template<>
struct operation_description_class_size< ::efl::file >
{
   static const int value = 4;
};

template <typename T>
int initialize_operation_description(::efl::eo::detail::tag<::efl::file>
                                 , Eo_Op_Description* ops)
{
   (void)ops;
   ops[0].func = reinterpret_cast<void*>(& ::efl_file_save_wrapper<T>);
   ops[0].api_func = reinterpret_cast<void*>(& ::efl_file_save);
   ops[0].op = EO_OP_OVERRIDE;
   ops[0].op_type = EO_OP_TYPE_REGULAR;
   ops[0].doc = NULL;

   ops[1].func = reinterpret_cast<void*>(& ::efl_file_eject_wrapper<T>);
   ops[1].api_func = reinterpret_cast<void*>(& ::efl_file_eject);
   ops[1].op = EO_OP_OVERRIDE;
   ops[1].op_type = EO_OP_TYPE_REGULAR;
   ops[1].doc = NULL;

   ops[2].func = reinterpret_cast<void*>(& ::efl_file_file_get_wrapper<T>);
   ops[2].api_func = reinterpret_cast<void*>(& ::efl_file_get);
   ops[2].op = EO_OP_OVERRIDE;
   ops[2].op_type = EO_OP_TYPE_REGULAR;
   ops[2].doc = NULL;

   ops[3].func = reinterpret_cast<void*>(& ::efl_file_file_set_wrapper<T>);
   ops[3].api_func = reinterpret_cast<void*>(& ::efl_file_set);
   ops[3].op = EO_OP_OVERRIDE;
   ops[3].op_type = EO_OP_TYPE_REGULAR;
   ops[3].doc = NULL;

   return 0;
}
inline void
call_constructor(::efl::eo::detail::tag< ::efl::file >
               , Eo* eo, Eo_Class const* cls EINA_UNUSED,
               ::efl::eo::detail::args_class<::efl::file, ::std::tuple<::efl::eo::parent_type> > const& args)
{
   eo_do(eo, ::eo_parent_set(args.get<0>()._eo_raw));
}

inline Eo_Class const* get_eo_class(tag<::efl::file>)
{
   return (EFL_FILE_INTERFACE);
}

} } }
#endif // EFL_GENERATED_EFL_FILE_HH

