Bible eBook Prototype More details at: http://mbed.org/users/davervw/notebook/ebible-abstract/

Dependencies:   SDHCFileSystem TextLCD mbed BibleIO

Committer:
davervw
Date:
Sun Feb 27 18:54:37 2011 +0000
Revision:
0:b9d9145827e2
NXP mbed Design Challenge Entry

Who changed what in which revision?

UserRevisionLine numberNew contents of line
davervw 0:b9d9145827e2 1 /* Bible UI Class Definition - KJV Bible eBook Browser
davervw 0:b9d9145827e2 2 *
davervw 0:b9d9145827e2 3 * Copyright (c) 2011 David R. Van Wagner davervw@yahoo.com
davervw 0:b9d9145827e2 4 *
davervw 0:b9d9145827e2 5 * Permission is hereby granted, free of charge, to any person obtaining a copy
davervw 0:b9d9145827e2 6 * of this software and associated documentation files (the "Software"), to deal
davervw 0:b9d9145827e2 7 * in the Software without restriction, including without limitation the rights
davervw 0:b9d9145827e2 8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
davervw 0:b9d9145827e2 9 * copies of the Software, and to permit persons to whom the Software is
davervw 0:b9d9145827e2 10 * furnished to do so, subject to the following conditions:
davervw 0:b9d9145827e2 11 *
davervw 0:b9d9145827e2 12 * The above copyright notice and this permission notice shall be included in
davervw 0:b9d9145827e2 13 * all copies or substantial portions of the Software.
davervw 0:b9d9145827e2 14 *
davervw 0:b9d9145827e2 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
davervw 0:b9d9145827e2 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
davervw 0:b9d9145827e2 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
davervw 0:b9d9145827e2 18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
davervw 0:b9d9145827e2 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
davervw 0:b9d9145827e2 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
davervw 0:b9d9145827e2 21 * THE SOFTWARE.
davervw 0:b9d9145827e2 22 */
davervw 0:b9d9145827e2 23
davervw 0:b9d9145827e2 24 #include <mbed.h>
davervw 0:b9d9145827e2 25 #include "BibleIO.h"
davervw 0:b9d9145827e2 26 #include "TextLCD.h"
davervw 0:b9d9145827e2 27
davervw 0:b9d9145827e2 28 class BibleUI
davervw 0:b9d9145827e2 29 {
davervw 0:b9d9145827e2 30 private:
davervw 0:b9d9145827e2 31 short book;
davervw 0:b9d9145827e2 32 short chapter;
davervw 0:b9d9145827e2 33 short verse;
davervw 0:b9d9145827e2 34 short offset;
davervw 0:b9d9145827e2 35 short disp_len;
davervw 0:b9d9145827e2 36 BibleIO &HolyBible;
davervw 0:b9d9145827e2 37 TextLCD &lcd;
davervw 0:b9d9145827e2 38 DigitalIn& lb;
davervw 0:b9d9145827e2 39 DigitalIn& rb;
davervw 0:b9d9145827e2 40 DigitalOut led1;
davervw 0:b9d9145827e2 41 DigitalOut led2;
davervw 0:b9d9145827e2 42 DigitalOut led3;
davervw 0:b9d9145827e2 43 DigitalOut led4;
davervw 0:b9d9145827e2 44
davervw 0:b9d9145827e2 45 public:
davervw 0:b9d9145827e2 46 BibleUI(BibleIO &bible, TextLCD &textlcd, DigitalIn& left, DigitalIn& right);
davervw 0:b9d9145827e2 47 void start();
davervw 0:b9d9145827e2 48 static void indexing(int progress, void* context);
davervw 0:b9d9145827e2 49
davervw 0:b9d9145827e2 50 private:
davervw 0:b9d9145827e2 51 void display_nav();
davervw 0:b9d9145827e2 52 void display_verse();
davervw 0:b9d9145827e2 53 void show_title();
davervw 0:b9d9145827e2 54 void main();
davervw 0:b9d9145827e2 55 bool append_next_verse(char*& text, short len, short book, short chapter, short verse);
davervw 0:b9d9145827e2 56 void remove_string(char* &text, char* find);
davervw 0:b9d9145827e2 57 int word_wrap(char* &text);
davervw 0:b9d9145827e2 58 };