/indra/viewer_components/updater/llupdatechecker.h

https://bitbucket.org/lindenlab/viewer-beta/ · C Header · 82 lines · 28 code · 18 blank · 36 comment · 0 complexity · 854a37e88903507e305eaef38aee77a2 MD5 · raw file

  1. /**
  2. * @file llupdatechecker.h
  3. *
  4. * $LicenseInfo:firstyear=2010&license=viewerlgpl$
  5. * Second Life Viewer Source Code
  6. * Copyright (C) 2010, Linden Research, Inc.
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation;
  11. * version 2.1 of the License only.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. *
  22. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  23. * $/LicenseInfo$
  24. */
  25. #ifndef LL_UPDATERCHECKER_H
  26. #define LL_UPDATERCHECKER_H
  27. #include <boost/shared_ptr.hpp>
  28. //
  29. // Implements asynchronous checking for updates.
  30. //
  31. class LLUpdateChecker {
  32. public:
  33. class Client;
  34. class Implementation;
  35. // An exception that may be raised on check errors.
  36. class CheckError;
  37. LLUpdateChecker(Client & client);
  38. // Check status of current app on the given host for the channel and version provided.
  39. void check(std::string const & protocolVersion, std::string const & hostUrl,
  40. std::string const & servicePath, std::string channel, std::string version);
  41. private:
  42. boost::shared_ptr<Implementation> mImplementation;
  43. };
  44. class LLURI; // From lluri.h
  45. //
  46. // The client interface implemented by a requestor checking for an update.
  47. //
  48. class LLUpdateChecker::Client
  49. {
  50. public:
  51. // An error occurred while checking for an update.
  52. virtual void error(std::string const & message) = 0;
  53. // A newer version is available, but the current version may still be used.
  54. virtual void optionalUpdate(std::string const & newVersion,
  55. LLURI const & uri,
  56. std::string const & hash) = 0;
  57. // A newer version is available, and the current version is no longer valid.
  58. virtual void requiredUpdate(std::string const & newVersion,
  59. LLURI const & uri,
  60. std::string const & hash) = 0;
  61. // The checked version is up to date; no newer version exists.
  62. virtual void upToDate(void) = 0;
  63. };
  64. #endif