ui: bookmarks
can now bookmark tokens
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
#include "Bookmark.h"
|
||||
|
||||
Bookmark::Bookmark()
|
||||
: m_id(-1)
|
||||
, m_tokenTypes()
|
||||
, m_tokenIds()
|
||||
, m_tokenNames()
|
||||
, m_comment("")
|
||||
, m_displayName("")
|
||||
, m_valid(false)
|
||||
, m_timeStamp()
|
||||
, m_category()
|
||||
{
|
||||
}
|
||||
|
||||
Bookmark::Bookmark(const std::string& displayName, const std::vector<Id>& tokens, const std::vector<std::string>& tokenNames, const std::string& comment, const TimePoint& timeStamp)
|
||||
: m_id(-1)
|
||||
, m_tokenTypes()
|
||||
, m_tokenIds(tokens)
|
||||
, m_tokenNames(tokenNames)
|
||||
, m_comment(comment)
|
||||
, m_displayName(displayName)
|
||||
, m_valid(false)
|
||||
, m_timeStamp(timeStamp)
|
||||
, m_category()
|
||||
{
|
||||
}
|
||||
|
||||
Bookmark::~Bookmark()
|
||||
{
|
||||
}
|
||||
|
||||
Id Bookmark::getId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
void Bookmark::setId(const Id id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
std::vector<int> Bookmark::getTokenTypes() const
|
||||
{
|
||||
return m_tokenTypes;
|
||||
}
|
||||
|
||||
void Bookmark::setTokenTypes(const std::vector<int>& types)
|
||||
{
|
||||
m_tokenTypes = types;
|
||||
}
|
||||
|
||||
std::vector<Id> Bookmark::getTokenIds() const
|
||||
{
|
||||
return m_tokenIds;
|
||||
}
|
||||
|
||||
void Bookmark::setTokenIds(const std::vector<Id>& ids)
|
||||
{
|
||||
m_tokenIds = ids;
|
||||
}
|
||||
|
||||
std::vector<std::string> Bookmark::getTokenNames() const
|
||||
{
|
||||
return m_tokenNames;
|
||||
}
|
||||
|
||||
void Bookmark::setTokenNames(const std::vector<std::string>& names)
|
||||
{
|
||||
m_tokenNames = names;
|
||||
}
|
||||
|
||||
std::string Bookmark::getComment() const
|
||||
{
|
||||
return m_comment;
|
||||
}
|
||||
|
||||
void Bookmark::setComment(const std::string& comment)
|
||||
{
|
||||
m_comment = comment;
|
||||
}
|
||||
|
||||
std::string Bookmark::getDisplayName() const
|
||||
{
|
||||
return m_displayName;
|
||||
}
|
||||
|
||||
void Bookmark::setDisplayName(const std::string& name)
|
||||
{
|
||||
m_displayName = name;
|
||||
}
|
||||
|
||||
bool Bookmark::isValid() const
|
||||
{
|
||||
return m_valid;
|
||||
}
|
||||
|
||||
void Bookmark::setValid(const bool valid)
|
||||
{
|
||||
m_valid = valid;
|
||||
}
|
||||
|
||||
TimePoint Bookmark::getTimeStamp() const
|
||||
{
|
||||
return m_timeStamp;
|
||||
}
|
||||
|
||||
BookmarkCategory Bookmark::getCategory() const
|
||||
{
|
||||
return m_category;
|
||||
}
|
||||
|
||||
void Bookmark::setCategory(const BookmarkCategory& category)
|
||||
{
|
||||
m_category = category;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
#ifndef BOOKMARK_H
|
||||
#define BOOKMARK_H
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "utility/TimePoint.h"
|
||||
#include "utility/types.h"
|
||||
|
||||
#include "BookmarkCategory.h"
|
||||
|
||||
class Bookmark
|
||||
{
|
||||
public:
|
||||
Bookmark();
|
||||
Bookmark(const std::string& displayName, const std::vector<Id>& tokens, const std::vector<std::string>& tokenNames, const std::string& comment, const TimePoint& timeStamp);
|
||||
virtual ~Bookmark();
|
||||
|
||||
Id getId() const;
|
||||
void setId(const Id id);
|
||||
|
||||
std::vector<int> getTokenTypes() const;
|
||||
void setTokenTypes(const std::vector<int>& types);
|
||||
|
||||
std::vector<Id> getTokenIds() const;
|
||||
void setTokenIds(const std::vector<Id>& ids);
|
||||
|
||||
std::vector<std::string> getTokenNames() const;
|
||||
void setTokenNames(const std::vector<std::string>& names);
|
||||
|
||||
std::string getComment() const;
|
||||
void setComment(const std::string& comment);
|
||||
|
||||
std::string getDisplayName() const;
|
||||
void setDisplayName(const std::string& name);
|
||||
|
||||
bool isValid() const;
|
||||
void setValid(const bool valid);
|
||||
|
||||
TimePoint getTimeStamp() const;
|
||||
|
||||
BookmarkCategory getCategory() const;
|
||||
void setCategory(const BookmarkCategory& category);
|
||||
|
||||
private:
|
||||
Id m_id;
|
||||
std::vector<int> m_tokenTypes;
|
||||
std::vector<Id> m_tokenIds;
|
||||
std::vector<std::string> m_tokenNames;
|
||||
std::string m_comment;
|
||||
std::string m_displayName;
|
||||
|
||||
bool m_valid;
|
||||
|
||||
TimePoint m_timeStamp;
|
||||
|
||||
BookmarkCategory m_category;
|
||||
};
|
||||
|
||||
#endif // BOOKMARK_H
|
||||
@@ -0,0 +1,31 @@
|
||||
#include "BookmarkCategory.h"
|
||||
|
||||
BookmarkCategory::BookmarkCategory()
|
||||
: m_id(-1)
|
||||
, m_name("")
|
||||
{
|
||||
}
|
||||
|
||||
BookmarkCategory::~BookmarkCategory()
|
||||
{
|
||||
}
|
||||
|
||||
Id BookmarkCategory::getId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
void BookmarkCategory::setId(const Id id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
std::string BookmarkCategory::getName() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
void BookmarkCategory::setName(const std::string& name)
|
||||
{
|
||||
m_name = name;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef BOOKMARK_CATEGORY_H
|
||||
#define BOOKMARK_CATEGORY_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "utility/types.h"
|
||||
|
||||
class BookmarkCategory
|
||||
{
|
||||
public:
|
||||
BookmarkCategory();
|
||||
~BookmarkCategory();
|
||||
|
||||
Id getId() const;
|
||||
void setId(const Id id);
|
||||
|
||||
std::string getName() const;
|
||||
void setName(const std::string& name);
|
||||
|
||||
private:
|
||||
Id m_id;
|
||||
std::string m_name;
|
||||
};
|
||||
|
||||
#endif // BOOKMARK_CATEGORY_H
|
||||
@@ -0,0 +1,55 @@
|
||||
#include "EdgeBookmark.h"
|
||||
|
||||
EdgeBookmark::EdgeBookmark()
|
||||
: Bookmark()
|
||||
{
|
||||
}
|
||||
|
||||
EdgeBookmark::EdgeBookmark(const std::string& displayName, const std::vector<Id>& tokens, const std::vector<std::string>& tokenNames, const std::string& comment, const TimePoint& timeStamp)
|
||||
: Bookmark(displayName, tokens, tokenNames, comment, timeStamp)
|
||||
{
|
||||
}
|
||||
|
||||
EdgeBookmark::~EdgeBookmark()
|
||||
{
|
||||
}
|
||||
|
||||
std::vector<int> EdgeBookmark::getEdgeTokenTypes() const
|
||||
{
|
||||
return m_edgeTokenTypes;
|
||||
}
|
||||
|
||||
void EdgeBookmark::setEdgeTokenTypes(const std::vector<int>& tokenTypes)
|
||||
{
|
||||
m_edgeTokenTypes = tokenTypes;
|
||||
}
|
||||
|
||||
std::vector<Id> EdgeBookmark::getEdgeTokenIds() const
|
||||
{
|
||||
return m_edgeTokenIds;
|
||||
}
|
||||
|
||||
void EdgeBookmark::setEdgeTokenIds(const std::vector<Id>& tokenIds)
|
||||
{
|
||||
m_edgeTokenIds = tokenIds;
|
||||
}
|
||||
|
||||
std::vector<std::string> EdgeBookmark::getEdgeTokenNames() const
|
||||
{
|
||||
return m_edgeTokenNames;
|
||||
}
|
||||
|
||||
void EdgeBookmark::setEdgeTokenNames(const std::vector<std::string>& tokenNames)
|
||||
{
|
||||
m_edgeTokenNames = tokenNames;
|
||||
}
|
||||
|
||||
NodeBookmark EdgeBookmark::getBaseBookmark() const
|
||||
{
|
||||
return m_baseBookmark;
|
||||
}
|
||||
|
||||
void EdgeBookmark::setBaseBookmark(const NodeBookmark& baseBookmark)
|
||||
{
|
||||
m_baseBookmark = baseBookmark;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef EDGE_BOOKMARK_H
|
||||
#define EDGE_BOOKMARK_H
|
||||
|
||||
#include "Bookmark.h"
|
||||
#include "NodeBookmark.h"
|
||||
|
||||
class EdgeBookmark
|
||||
: public Bookmark
|
||||
{
|
||||
public:
|
||||
EdgeBookmark();
|
||||
EdgeBookmark(const std::string& displayName, const std::vector<Id>& tokens, const std::vector<std::string>& tokenNames, const std::string& comment, const TimePoint& timeStamp);
|
||||
virtual ~EdgeBookmark();
|
||||
|
||||
std::vector<int> getEdgeTokenTypes() const;
|
||||
void setEdgeTokenTypes(const std::vector<int>& tokenTypes);
|
||||
|
||||
std::vector<Id> getEdgeTokenIds() const;
|
||||
void setEdgeTokenIds(const std::vector<Id>& tokenIds);
|
||||
|
||||
std::vector<std::string> getEdgeTokenNames() const;
|
||||
void setEdgeTokenNames(const std::vector<std::string>& tokenNames);
|
||||
|
||||
NodeBookmark getBaseBookmark() const;
|
||||
void setBaseBookmark(const NodeBookmark& baseBookmark);
|
||||
|
||||
private:
|
||||
std::vector<int> m_edgeTokenTypes;
|
||||
std::vector<Id> m_edgeTokenIds;
|
||||
std::vector<std::string> m_edgeTokenNames;
|
||||
|
||||
NodeBookmark m_baseBookmark;
|
||||
};
|
||||
|
||||
#endif // EDGE_BOOKMARK_H
|
||||
@@ -0,0 +1,15 @@
|
||||
#include "NodeBookmark.h"
|
||||
|
||||
NodeBookmark::NodeBookmark()
|
||||
: Bookmark()
|
||||
{
|
||||
}
|
||||
|
||||
NodeBookmark::NodeBookmark(const std::string& displayName, const std::vector<Id>& tokens, const std::vector<std::string>& tokenNames, const std::string& comment, const TimePoint& timeStamp)
|
||||
: Bookmark(displayName, tokens, tokenNames, comment, timeStamp)
|
||||
{
|
||||
}
|
||||
|
||||
NodeBookmark::~NodeBookmark()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef NODE_BOOKMARK_H
|
||||
#define NODE_BOOKMARK_H
|
||||
|
||||
#include "Bookmark.h"
|
||||
|
||||
class NodeBookmark
|
||||
: public Bookmark
|
||||
{
|
||||
public:
|
||||
NodeBookmark();
|
||||
NodeBookmark(const std::string& displayName, const std::vector<Id>& tokens, const std::vector<std::string>& tokenNames, const std::string& comment, const TimePoint& timeStamp);
|
||||
virtual ~NodeBookmark();
|
||||
};
|
||||
|
||||
#endif // NODE_BOOKMARK_H
|
||||
Reference in New Issue
Block a user