method.h 2.0 KB

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