#ifndef GCDWGEXTRACTOR_H
#define GCDWGEXTRACTOR_H
#include "GcString.h"
#include "rxvalue.h"
#include "dbid.h"
#include "pimplapi.h"

#if defined(GCDWGEXTRACTOR_API)
#  define GCDWGEXTRACTOR_PORT GSOFT_EXPORT
#else
#  define GCDWGEXTRACTOR_PORT
#endif

namespace GcDwgExtractor
{
  class ExtractorImp;

  class BeginExtractionEventArgs
  {
    friend class ExtractorImp;
    BeginExtractionEventArgs();

  public:
    GCDWGEXTRACTOR_PORT Gcad::ErrorStatus queueForExtraction(const GcDbObjectId& idObject, const GcString& viewableId);
  };

  class EndExtractionEventArgs
  {
    friend class ExtractorImp;
    EndExtractionEventArgs();

  public:
    GCDWGEXTRACTOR_PORT Gcad::ErrorStatus addProperty(const GcDbObjectId& idEntity,
                                                      const GcString& propertyCategory,
                                                      const GcString& propertyName,
                                                      const GcRxValue& propertyValue,
                                                      const GcString& units = L"",
                                                      bool hidden = false);
  };

  class GSOFT_NO_VTABLE ExtractorReactor
  {
  public:
    virtual void beginExtraction(BeginExtractionEventArgs& args) = 0;
    virtual void endExtraction(EndExtractionEventArgs& args) = 0;
  };

  class Extractor : public Pimpl::ApiPart<void, ExtractorImp>
  {
  protected:
    using base_type = Pimpl::ApiPart<void, ExtractorImp>;

  public:
    Extractor(ExtractorImp* pImp);
    GCDWGEXTRACTOR_PORT void addReactor(ExtractorReactor* reactor);
    GCDWGEXTRACTOR_PORT void removeReactor(ExtractorReactor* reactor);
    GCDWGEXTRACTOR_PORT static Extractor& theOne();
  };
}
#endif