history.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (c) 2009 Openmoko Inc.
  3. *
  4. * Authors Holger Hans Peter Freyther <zecke@openmoko.org>
  5. * Matt Hsu <matt_hsu@openmoko.org>
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef WL_HISTORY_H
  21. #define WL_HISTORY_H
  22. #include "search.h"
  23. #define HISTORY_RESULT_START 31
  24. //#define HISTORY_RESULT_HEIGHT 10
  25. #define HISTORY_RESULT_HEIGHT 19
  26. #define MAX_HISTORY 256
  27. #define HISTORY_PIXEL_START (HISTORY_RESULT_START - HISTORY_RESULT_HEIGHT + 2)
  28. /*
  29. * Interface for the History feature
  30. */
  31. void history_clear(void);
  32. void history_add(long idx_article, const char *title, int b_keep_pos);
  33. unsigned int history_get_count();
  34. void history_list_init(void);
  35. int history_list_save(int level);
  36. void history_open_article(int new_selection);
  37. void history_reload();
  38. void history_log_y_pos(const long y_pos);
  39. void history_set_y_pos(const long idx_article);
  40. long history_get_y_pos();
  41. void draw_clear_history(int bFlag);
  42. long history_get_previous_idx(long current_idx_article, int b_drop_from_list);
  43. typedef struct _HISTORY {
  44. long idx_article;
  45. long last_y_pos;
  46. char title[MAX_TITLE_SEARCH];
  47. } HISTORY;
  48. enum history_save_e {
  49. HISTORY_SAVE_NONE,
  50. HISTORY_SAVE_POWER_OFF,
  51. HISTORY_SAVE_NORMAL,
  52. };
  53. #endif