method.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* -*- c++ -*-
  2. * dselect - Debian package maintenance user interface
  3. * method.h - access method handling declarations
  4. *
  5. * Copyright (C) 1995 Ian Jackson <ian@chiark.greenend.org.uk>
  6. * Copyright (C) 2001 Wichert Akkerman <wakkerma@debian.org>
  7. *
  8. * This is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2,
  11. * or (at your option) any later version.
  12. *
  13. * This is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public
  19. * License along with dpkg; if not, write to the Free Software
  20. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. */
  22. #ifndef METHOD_H
  23. #define METHOD_H
  24. struct method {
  25. struct method *next, *back;
  26. char *name, *path, *pathinmeth;
  27. };
  28. struct dselect_option {
  29. dselect_option *next;
  30. method *meth;
  31. char index[OPTIONINDEXMAXLEN];
  32. char *name, *summary;
  33. char *description;
  34. };
  35. class methodlist : public baselist {
  36. protected:
  37. int status_width, gap_width, name_width, description_width;
  38. int name_column, description_column;
  39. // Table of methods
  40. struct dselect_option **table;
  41. // Misc.
  42. char searchstring[50];
  43. // Information displays
  44. void itd_description();
  45. // Define these virtuals
  46. void redraw1itemsel(int index, int selected);
  47. void redrawcolheads();
  48. void redrawthisstate();
  49. void redrawinfo();
  50. void redrawtitle();
  51. void setwidths();
  52. void setheights();
  53. const char *itemname(int index);
  54. const struct helpmenuentry *helpmenulist();
  55. public:
  56. // Keybinding functions */
  57. void kd_quit();
  58. void kd_abort();
  59. methodlist();
  60. quitaction display();
  61. ~methodlist();
  62. };
  63. extern int noptions;
  64. extern struct dselect_option *options, *coption;
  65. extern struct method *methods;
  66. extern void readmethods(const char *pathbase, dselect_option **optionspp, int *nread);
  67. extern void getcurrentopt();
  68. extern void writecurrentopt();
  69. #endif /* METHOD_H */