/**
 * document.hxx
 *
 *      Copyright (c) 2025 CHBXUE. All rights reserved.
 *
 * THIS FILE AND THE SOFTWARE CONTAINED HEREIN IS PROVIDED 'AS IS' AND
 * COMES WITH NO WARRANTIES OF ANY KIND.
 */

#ifndef DOCUMENT_CPP_INTERFACE_H
#define DOCUMENT_CPP_INTERFACE_H

#include "port.h"
#include "enum.h"


namespace oo {

struct iWorkbook;
class iCSVPolicy;

struct iDocument
{
    virtual iWorkbook* get_workbook() = 0;
    virtual      bool  save(const char* filename = 0) const = 0;
    virtual      bool  save_to_csv(const char* filename = 0) const = 0;

    virtual      void  release() = 0;

protected:
    virtual ~iDocument() { }
};

}


#ifdef __cplusplus
extern "C" {
#endif

DYLIB_PORT     const char* DYLIB_CALL lib_version();
DYLIB_PORT           void  DYLIB_CALL set_product_key(const char* user, const char* key);
DYLIB_PORT  oo::iDocument* DYLIB_CALL create_document();
DYLIB_PORT  oo::iDocument* DYLIB_CALL load_document(const char* filename);
DYLIB_PORT oo::iCSVPolicy* DYLIB_CALL create_csv_policy();
DYLIB_PORT  oo::iDocument* DYLIB_CALL load_csv(const char* filename, const oo::iCSVPolicy* policy);

#ifdef __cplusplus
}
#endif

#endif // DOCUMENT_CPP_INTERFACE_H

