2019-09-01 21:40:08 +00:00
|
|
|
#ifndef EBOOK_READER_BOOK_READER_HPP
|
|
|
|
#define EBOOK_READER_BOOK_READER_HPP
|
|
|
|
|
|
|
|
#include <mupdf/pdf.h>
|
|
|
|
#include <string>
|
|
|
|
#include "PageLayout.hpp"
|
|
|
|
|
|
|
|
struct SDL_Texture;
|
|
|
|
|
2019-09-02 02:55:49 +00:00
|
|
|
typedef enum {
|
2019-09-01 21:40:08 +00:00
|
|
|
BookPageLayoutPortrait,
|
|
|
|
BookPageLayoutLandscape
|
|
|
|
} BookPageLayout;
|
|
|
|
|
2019-09-02 02:55:49 +00:00
|
|
|
class BookReader {
|
2019-09-01 21:40:08 +00:00
|
|
|
public:
|
2019-10-30 16:56:10 +00:00
|
|
|
BookReader(const char *path, int *result);
|
2019-09-01 21:40:08 +00:00
|
|
|
~BookReader();
|
2019-09-03 22:17:53 +00:00
|
|
|
|
|
|
|
bool permStatusBar = false;
|
|
|
|
|
2019-09-01 21:40:08 +00:00
|
|
|
void previous_page(int n);
|
|
|
|
void next_page(int n);
|
|
|
|
void zoom_in();
|
|
|
|
void zoom_out();
|
|
|
|
void move_page_up();
|
|
|
|
void move_page_down();
|
|
|
|
void move_page_left();
|
|
|
|
void move_page_right();
|
|
|
|
void reset_page();
|
|
|
|
void switch_page_layout();
|
2019-09-20 00:12:38 +00:00
|
|
|
void draw(bool drawHelp);
|
2019-09-01 21:40:08 +00:00
|
|
|
|
2019-09-02 02:55:49 +00:00
|
|
|
BookPageLayout currentPageLayout() {
|
2019-09-01 21:40:08 +00:00
|
|
|
return _currentPageLayout;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void show_status_bar();
|
|
|
|
void switch_current_page_layout(BookPageLayout bookPageLayout, int current_page);
|
|
|
|
|
|
|
|
fz_document *doc = NULL;
|
|
|
|
int status_bar_visible_counter = 0;
|
|
|
|
|
|
|
|
BookPageLayout _currentPageLayout = BookPageLayoutPortrait;
|
|
|
|
PageLayout *layout = NULL;
|
|
|
|
|
|
|
|
std::string book_name;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|