2020-11-28 00:33:26 +01:00
|
|
|
#pragma once
|
|
|
|
|
2022-02-01 18:09:40 +01:00
|
|
|
#include <hex/ui/view.hpp>
|
2020-11-28 00:33:26 +01:00
|
|
|
|
2023-12-02 23:11:31 +01:00
|
|
|
#include <TextEditor.h>
|
|
|
|
|
2020-11-28 00:33:26 +01:00
|
|
|
#include <list>
|
|
|
|
|
2021-12-07 22:47:41 +01:00
|
|
|
namespace hex::plugin::builtin {
|
2020-11-28 00:33:26 +01:00
|
|
|
|
2023-11-21 13:47:50 +01:00
|
|
|
class ViewBookmarks : public View::Window {
|
2020-11-28 00:33:26 +01:00
|
|
|
public:
|
2021-01-20 20:16:24 +01:00
|
|
|
ViewBookmarks();
|
2020-11-28 00:33:26 +01:00
|
|
|
~ViewBookmarks() override;
|
|
|
|
|
2020-12-22 18:10:01 +01:00
|
|
|
void drawContent() override;
|
2022-02-01 18:09:40 +01:00
|
|
|
|
2022-08-14 14:45:32 +02:00
|
|
|
private:
|
2023-04-17 16:18:48 +02:00
|
|
|
bool importBookmarks(hex::prv::Provider *provider, const nlohmann::json &json);
|
|
|
|
bool exportBookmarks(hex::prv::Provider *provider, nlohmann::json &json);
|
2022-08-14 14:45:32 +02:00
|
|
|
|
|
|
|
void registerMenuItems();
|
2022-02-01 18:09:40 +01:00
|
|
|
private:
|
2022-07-23 20:38:38 +02:00
|
|
|
std::string m_currFilter;
|
2022-09-28 21:40:31 +02:00
|
|
|
|
2023-12-02 23:11:31 +01:00
|
|
|
struct Bookmark {
|
|
|
|
ImHexApi::Bookmarks::Entry entry;
|
|
|
|
TextEditor editor;
|
|
|
|
};
|
|
|
|
|
|
|
|
PerProvider<std::list<Bookmark>> m_bookmarks;
|
2023-11-25 12:43:48 +01:00
|
|
|
PerProvider<u64> m_currBookmarkId;
|
2020-11-28 00:33:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|