#ifndef SIMPLENAVIGATOR_H #define SIMPLENAVIGATOR_H #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "utils.h" #include "SwordIndex.h" #include "NavPage.h" //using namespace sword; #define NUM_MENUS 5 #define MODE_BOOK 0 #define MODE_CHAP 1 #define MODE_VERSE 2 #define MODE_TEXT 3 #define MODE_FIND 4 #define BUTTON_BACKGROUND 0x00A0A0A0 extern RECT RECT_SCREEN; class NavNumbers; class NavBooks; class NavRenderText; class NavFind; class SimpleNavigator { protected: std::map pages; std::map menus; int mode; HMENU menuTranslations; HMENU menuOptions; int nextID; int transStartID; int transEndID; int optStartID; int optEndID; SWBuf *options; int opCount; WCString getVerseHeader(); void setModule(int id); void checkModuleMenu(int id); public: SwordIndex position; NavPage* chapters; NavPage* verses; NavPage* books; NavPage* text; NavPage* find; SimpleNavigator(RECT* screen); virtual ~SimpleNavigator(); void saveState(); // Navigation void setBook(int number); void setChap(int number); void setVerse(int number); void setModule(const char *module); int getBook() {return position.getBook();}; int getChap() {return position.verse->Chapter();}; int getVerse() {return position.verse->Verse();}; int chapCount() {return position.chapCount();} int verseCount() {return position.verseCount();} // Change user interface void updateTitle(); void fillTranslationsMenu(HMENU menuTranslations); void fillGlobalOptionsMenu(HMENU menuTranslations); void toggleOptionMenu(int id); // Interface with pages int getID(); void setMode(int mode); bool chapterCache; // to be set to false if 'text' should reload // its chapter void refresh(); // Interface with system bool initialized() {return position.initialized();} void buttonClicked(int id); void keyDown(WPARAM id, LPARAM lparam); void urlClicked(const WCHAR *target); bool menuClicked(int id); void mouseDown(int x, int y); void paint(); }; #endif