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.

additioncheckerlistener.h 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
  2. *
  3. * Copyright (C) 1995-2011 Opera Software AS. All rights reserved.
  4. *
  5. * This file is part of the Opera web browser. It may not be distributed
  6. * under any circumstances.
  7. *
  8. * @author Michal Zajaczkowski
  9. */
  10. #ifdef AUTO_UPDATE_SUPPORT
  11. #ifndef AUTOUPDATE_ADDITION_CHECKER_LISTENER_H
  12. #define AUTOUPDATE_ADDITION_CHECKER_LISTENER_H
  13. /**
  14. * The listener interface for the AdditionChecker. Implement this to get notifications about an addition resolve result.
  15. * In order to receive the notifications, register with the g_autoupdate_manager->AddListener().
  16. */
  17. class AdditionCheckerListener
  18. {
  19. public:
  20. virtual ~AdditionCheckerListener() {};
  21. /**
  22. * Called if an addition was able to resolve succesfully. You need to check if this call is for you, since notifications for ALL queued items
  23. * are broadcasted to ALL registered listeners.
  24. * You need to know what you have requested and ignore calls that are not meant for you.
  25. *
  26. * @param type - the type of the addition that was just resolved.
  27. * @param key - the key of the addition that was just resolved.
  28. * @param resource - a pointer to an UpdatableResource object representing the addition that was resolved. You receive the ownership of this
  29. * resource with this call, so be very careful to filter out the calls that are meant for you.
  30. */
  31. virtual void OnAdditionResolved(UpdatableResource::UpdatableResourceType type, const OpStringC& key, UpdatableResource* resource) = 0;
  32. /**
  33. * Called when an addition finally failed to resolve after a few retries (RESOLVE_MAX_RETRY_COUNT_PER_ITEM). Since this might still be
  34. * a network or the autoupdate server issue it might have sense to ask about this addition later on.
  35. * The autoupdate server should be configured in such a way that is sends a meaningful resources for calls that request an addition that
  36. * can't be served by it, i.e. a request for a plugin that we don't offer for automatic installation still returns an XML with a plugin
  37. * description that has a <has-installer> XML element with a zero value.
  38. * This call is meant to inform that there was a problem with receiving any answer about this addition from the server.
  39. */
  40. virtual void OnAdditionResolveFailed(UpdatableResource::UpdatableResourceType type, const OpStringC& key) = 0;
  41. };
  42. #endif // AUTOUPDATE_ADDITION_CHECKER_LISTENER_H
  43. #endif // AUTO_UPDATE_SUPPORT