#pragma once

#include <vector>
#include <memory>

class MarkdownElement;
class MarkdownLink;
class MarkdownCustomMultilineElementContext;
class MarkdownCustomInlineElementContext;

class MarkdownDocument
{
public:
    ~MarkdownDocument();

    void addElement(std::unique_ptr<MarkdownElement> element);

    std::size_t getNumElements() const;

    MarkdownElement* getElement(std::size_t idx) const;

    std::vector<MarkdownLink*> getAllLinks() const;

    std::size_t getNumMultilineContexts() const;

    std::size_t getNumInlineContexts() const;

    MarkdownCustomMultilineElementContext* getMultilineContext(std::size_t idx) const;

    MarkdownCustomInlineElementContext* getInlineContext(std::size_t idx) const;

    void registerCustomInlineElement(std::unique_ptr<MarkdownCustomInlineElementContext> context);

    void registerCustomMultilineElement(std::unique_ptr<MarkdownCustomMultilineElementContext> context);

private:
    std::vector<std::unique_ptr<MarkdownElement> > mElements;
    std::vector<std::unique_ptr<MarkdownCustomMultilineElementContext> > mCustomMultilineContexts;
    std::vector<std::unique_ptr<MarkdownCustomInlineElementContext> > mCustomInlineContexts;
};


