Files
2026-07-26 20:53:25 +05:30

78 lines
2.5 KiB
C++
Generated

///
/// HybridEpubSpec.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 `EpubNovel` to properly resolve imports.
namespace margelo::nitro::nitroepub { struct EpubNovel; }
// Forward declaration of `EpubExportResult` to properly resolve imports.
namespace margelo::nitro::nitroepub { struct EpubExportResult; }
// Forward declaration of `EpubExportMetadata` to properly resolve imports.
namespace margelo::nitro::nitroepub { struct EpubExportMetadata; }
// Forward declaration of `EpubExportChapter` to properly resolve imports.
namespace margelo::nitro::nitroepub { struct EpubExportChapter; }
#include "EpubNovel.hpp"
#include <NitroModules/Promise.hpp>
#include <string>
#include "EpubExportResult.hpp"
#include "EpubExportMetadata.hpp"
#include "EpubExportChapter.hpp"
#include <vector>
#include <functional>
namespace margelo::nitro::nitroepub {
using namespace margelo::nitro;
/**
* An abstract base class for `Epub`
* Inherit this class to create instances of `HybridEpubSpec` in C++.
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
* @example
* ```cpp
* class HybridEpub: public HybridEpubSpec {
* public:
* HybridEpub(...): HybridObject(TAG) { ... }
* // ...
* };
* ```
*/
class HybridEpubSpec: public virtual HybridObject {
public:
// Constructor
explicit HybridEpubSpec(): HybridObject(TAG) { }
// Destructor
~HybridEpubSpec() override = default;
public:
// Properties
public:
// Methods
virtual std::shared_ptr<Promise<EpubNovel>> parseNovelAndChapters(const std::string& epubDirPath) = 0;
virtual std::shared_ptr<Promise<EpubExportResult>> exportEpub(const EpubExportMetadata& metadata, const std::vector<EpubExportChapter>& chapters, const std::string& outputPath, const std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<void>>>>(double /* completedChapters */, double /* totalChapters */, const std::string& /* chapterTitle */)>& onProgress) = 0;
protected:
// Hybrid Setup
void loadHybridMethods() override;
protected:
// Tag for logging
static constexpr auto TAG = "Epub";
};
} // namespace margelo::nitro::nitroepub