Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
1.8 KiB

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. //
  3. // wizard base class
  4. //
  5. // 12-15-97 sburns
  6. #ifndef WIZARD_HPP_INCLUDED
  7. #define WIZARD_HPP_INCLUDED
  8. // A Wizard manages the traversal of 1+ WizardPage instances.
  9. class Wizard
  10. {
  11. public:
  12. Wizard(
  13. unsigned titleStringResID,
  14. unsigned banner16BitmapResID,
  15. unsigned banner256BitmapResID,
  16. unsigned watermark16BitmapResID,
  17. unsigned watermark1256BitmapResID);
  18. ~Wizard();
  19. // Adds the page to the wizard. Takes ownership of the instance, and
  20. // will delete it when the Wizard is deleted.
  21. void
  22. AddPage(WizardPage* page);
  23. // Invokes Create on all of the pages that have been added.
  24. // Calls Win32 ::PropertySheet to display and (modally) execute the
  25. // wizard. Returns same values as ::PropertySheet.
  26. //
  27. // parentWindow - in, optional, handle to parent window. Default is 0,
  28. // for which the current desktop window will be used.
  29. INT_PTR
  30. ModalExecute(HWND parentWindow = 0);
  31. void
  32. SetNextPageID(HWND wizardPage, int pageResID);
  33. void
  34. Backtrack(HWND wizardPage);
  35. bool
  36. IsBacktracking();
  37. private:
  38. // not implemented: copy not allowed
  39. Wizard(const Wizard&);
  40. const Wizard& operator=(const Wizard&);
  41. typedef
  42. std::list<WizardPage*, Burnslib::Heap::Allocator<WizardPage*> >
  43. PageList;
  44. typedef
  45. std::vector<unsigned, Burnslib::Heap::Allocator<unsigned> >
  46. UIntVector;
  47. typedef
  48. std::stack<unsigned, UIntVector>
  49. PageIdStack;
  50. unsigned banner16ResId;
  51. unsigned banner256ResId;
  52. bool isBacktracking;
  53. PageIdStack pageIdHistory;
  54. PageList pages;
  55. unsigned titleResId;
  56. unsigned watermark16ResId;
  57. unsigned watermark256ResId;
  58. };
  59. #endif // WIZARD_HPP_INCLUDED