Opera 12.15 Source Code
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.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
  2. *
  3. * Copyright (C) 1995-2007 Opera Software AS. All rights reserved.
  4. *
  5. * This file is part of the Opera web browser.
  6. * It may not be distributed under any circumstances.
  7. */
  8. /** \file
  9. * This file declares the PlatformUpdater interface.
  10. *
  11. * @author Marius Blomli mariusab@opera.com
  12. */
  13. #ifndef _PLATFORMUPDATER_H_INCLUDED_
  14. #define _PLATFORMUPDATER_H_INCLUDED_
  15. #ifdef AUTO_UPDATE_SUPPORT
  16. /**
  17. * Interface to the platform used to manage updating of the
  18. * installation. Implement this interface and supply an instance
  19. * of the subclass when calling AutoUpdater::Init to activate auto
  20. * updating on the platform.
  21. */
  22. class PlatformUpdater
  23. {
  24. public:
  25. /**
  26. * Virtual destructor.
  27. */
  28. virtual ~PlatformUpdater() {}
  29. /**
  30. * Creates a new PlatformUpdater instance. This function must be
  31. * implemented by the platform code. The implementation must
  32. * create an instance of the platform's implementation of
  33. * PlatformUpdater which is returned through the new_object parameter.
  34. *
  35. * The instance is owned by the calling code and must be deleted by the
  36. * caller. (The desturctor is public and virtual.)
  37. *
  38. * @param new_instance pointer that the function sets to the newly
  39. * created instance.
  40. *
  41. * @return OK if the instance was successfully created, some error
  42. * otherwise.
  43. */
  44. static OP_STATUS Create(PlatformUpdater** new_instance);
  45. /**
  46. * Call this function to check the integrity of a downloaded update
  47. * package.
  48. */
  49. virtual BOOL CheckUpdate(/* Supply the package in some way */) = 0;
  50. /**
  51. * Call this function to initiate the update.
  52. *
  53. * @todo Think through the sequence, we can't have the platform code
  54. * just restarting opera or locking resources.
  55. */
  56. virtual OP_STATUS InitiateUpdate(/* Supply the package in some way */) = 0;
  57. /**
  58. * This function is used by the AutoUpdater to determine if automatic
  59. * updating is available to the user. (Depending on OS, user privileges,
  60. * install location, ...)
  61. */
  62. virtual BOOL HasInstallPrivileges() = 0;
  63. };
  64. // This class will move into platform code, and be reimplemented on the other platforms as autoupdate is added.
  65. class WindowsUpdater : public PlatformUpdater
  66. {
  67. public:
  68. WindowsUpdater();
  69. ~WindowsUpdater();
  70. BOOL CheckUpdate();
  71. OP_STATUS InitiateUpdate();
  72. BOOL HasInstallPrivileges();
  73. };
  74. #endif // AUTO_UPDATE_SUPPORT
  75. #endif // _PLATFORMUPDATER_H_INCLUDED_