#ifndef _WB_OVERVIEW_WORKSPACE_H_
#define _WB_OVERVIEW_WORKSPACE_H_

#include "wb_overview.h"

namespace wb
{
  //
  // Node Layout:
  //
  // -root: ORoot  (model)   (stable nodeid)
  //   -workbench central: ODivision (OSpecial)
  //   -models: ODivision  (stable noteid)  <RefreshChildren>
  //     -[diagram nodes]: OItem   <RefreshNode>
  //   -connections: ODivision (stable nodeid)  <RefreshChildren>
  //     -[connection nodes] OItem  <RefreshNode>
  //
  // Nodes marked <RefreshChildren> must have their contents refreshable when
  // Refresh message is received by the frontend. Arguments are paths.
  class MYSQLWBBACKEND_PUBLIC_FUNC WorkspaceOverviewBE : public OverviewBE
  {
  public: // backend internal
    enum 
    {
      LinkDescription= 100,
      LinkURL= 101
    };
    
    virtual std::string identifier() const;
    virtual std::string get_form_context_name() const;

    void send_refresh_connections();
    void send_refresh_model_files();

  public:
    WorkspaceOverviewBE(WBContext *wb);
    
    void reset(WBContext *wb);
    
    virtual model_ModelRef get_model() { return model_ModelRef(); }

    virtual bool get_field(const bec::NodeId &node, int column, std::string &value);
    
    virtual std::string get_node_drag_type(const bec::NodeId &node);
    virtual bool should_accept_file_drop_to_node(const bec::NodeId &node, const std::string &path);
    virtual void add_file_to_node(const bec::NodeId &node, const std::string &path);
    virtual std::string get_file_for_node(const bec::NodeId &node);

    virtual void refresh_node(const bec::NodeId &node, bool children);

  };
};

#endif /* _WB_OVERVIEW_WORKSPACE_H_ */
