ctkApplicationLauncher.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef CTKAPPLICATIONLAUNCHER_H
  16. #define CTKAPPLICATIONLAUNCHER_H
  17. #include <QObject>
  18. struct ctkApplicationRunnable;
  19. class QVariant;
  20. /**
  21. * A ctkApplicationLauncher is used to launch ctkApplicationRunnable objects using
  22. * the main thread.
  23. * <p>
  24. * This class is for use by platform-related plug-ins which implement application containers.
  25. * Clients outside of the base platform should not reference or subclass this class.
  26. * </p>
  27. */
  28. struct ctkApplicationLauncher
  29. {
  30. virtual ~ctkApplicationLauncher() {}
  31. /**
  32. * Launches the specified runnable using the main thread.
  33. * @param runnable a ParameterizedRunnalbe to run on the main thread.
  34. * @param context the context to launch the runnable with
  35. */
  36. virtual void launch(ctkApplicationRunnable* app, const QVariant& applicationContext) = 0;
  37. /**
  38. * Forces the current runnable which is running to be stopped.
  39. * This method will return after the currently running ctkApplicationRunnable
  40. * has completely stopped.
  41. * <p>
  42. * After this method returns this ctkApplicationLauncher will no longer allow
  43. * applications to be launched.
  44. */
  45. virtual void shutdown() = 0;
  46. };
  47. Q_DECLARE_INTERFACE(ctkApplicationLauncher, "org.commontk.service.application.ApplicationLauncher")
  48. #endif // CTKAPPLICATIONLAUNCHER_H