///
/// HybridReadiumViewSpec.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#if __has_include(<NitroModules/HybridObject.hpp>)
#include <NitroModules/HybridObject.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif

// Forward declaration of `ReadiumFile` to properly resolve imports.
namespace margelo::nitro::readium { struct ReadiumFile; }
// Forward declaration of `Preferences` to properly resolve imports.
namespace margelo::nitro::readium { struct Preferences; }
// Forward declaration of `DecorationGroup` to properly resolve imports.
namespace margelo::nitro::readium { struct DecorationGroup; }
// Forward declaration of `SelectionAction` to properly resolve imports.
namespace margelo::nitro::readium { struct SelectionAction; }
// Forward declaration of `Locator` to properly resolve imports.
namespace margelo::nitro::readium { struct Locator; }
// Forward declaration of `PublicationReadyEvent` to properly resolve imports.
namespace margelo::nitro::readium { struct PublicationReadyEvent; }
// Forward declaration of `DecorationActivatedEvent` to properly resolve imports.
namespace margelo::nitro::readium { struct DecorationActivatedEvent; }
// Forward declaration of `SelectionEvent` to properly resolve imports.
namespace margelo::nitro::readium { struct SelectionEvent; }
// Forward declaration of `SelectionActionEvent` to properly resolve imports.
namespace margelo::nitro::readium { struct SelectionActionEvent; }

#include "ReadiumFile.hpp"
#include <optional>
#include "Preferences.hpp"
#include "DecorationGroup.hpp"
#include <vector>
#include "SelectionAction.hpp"
#include "Locator.hpp"
#include <functional>
#include "PublicationReadyEvent.hpp"
#include "DecorationActivatedEvent.hpp"
#include "SelectionEvent.hpp"
#include "SelectionActionEvent.hpp"

namespace margelo::nitro::readium {

  using namespace margelo::nitro;

  /**
   * An abstract base class for `ReadiumView`
   * Inherit this class to create instances of `HybridReadiumViewSpec` in C++.
   * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
   * @example
   * ```cpp
   * class HybridReadiumView: public HybridReadiumViewSpec {
   * public:
   *   HybridReadiumView(...): HybridObject(TAG) { ... }
   *   // ...
   * };
   * ```
   */
  class HybridReadiumViewSpec: public virtual HybridObject {
    public:
      // Constructor
      explicit HybridReadiumViewSpec(): HybridObject(TAG) { }

      // Destructor
      ~HybridReadiumViewSpec() override = default;

    public:
      // Properties
      virtual std::optional<ReadiumFile> getFile() = 0;
      virtual void setFile(const std::optional<ReadiumFile>& file) = 0;
      virtual std::optional<Preferences> getPreferences() = 0;
      virtual void setPreferences(const std::optional<Preferences>& preferences) = 0;
      virtual std::optional<std::vector<DecorationGroup>> getDecorations() = 0;
      virtual void setDecorations(const std::optional<std::vector<DecorationGroup>>& decorations) = 0;
      virtual std::optional<std::vector<SelectionAction>> getSelectionActions() = 0;
      virtual void setSelectionActions(const std::optional<std::vector<SelectionAction>>& selectionActions) = 0;
      virtual std::optional<std::function<void(const Locator& /* locator */)>> getOnLocationChange() = 0;
      virtual void setOnLocationChange(const std::optional<std::function<void(const Locator& /* locator */)>>& onLocationChange) = 0;
      virtual std::optional<std::function<void(const PublicationReadyEvent& /* event */)>> getOnPublicationReady() = 0;
      virtual void setOnPublicationReady(const std::optional<std::function<void(const PublicationReadyEvent& /* event */)>>& onPublicationReady) = 0;
      virtual std::optional<std::function<void(const DecorationActivatedEvent& /* event */)>> getOnDecorationActivated() = 0;
      virtual void setOnDecorationActivated(const std::optional<std::function<void(const DecorationActivatedEvent& /* event */)>>& onDecorationActivated) = 0;
      virtual std::optional<std::function<void(const SelectionEvent& /* event */)>> getOnSelectionChange() = 0;
      virtual void setOnSelectionChange(const std::optional<std::function<void(const SelectionEvent& /* event */)>>& onSelectionChange) = 0;
      virtual std::optional<std::function<void(const SelectionActionEvent& /* event */)>> getOnSelectionAction() = 0;
      virtual void setOnSelectionAction(const std::optional<std::function<void(const SelectionActionEvent& /* event */)>>& onSelectionAction) = 0;

    public:
      // Methods
      virtual void goTo(const Locator& locator) = 0;
      virtual void goForward() = 0;
      virtual void goBackward() = 0;
      virtual void destroy() = 0;

    protected:
      // Hybrid Setup
      void loadHybridMethods() override;

    protected:
      // Tag for logging
      static constexpr auto TAG = "ReadiumView";
  };

} // namespace margelo::nitro::readium
