ImageDisplayManager.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * NICE-Core - efficient algebra and computer vision methods
  3. * - libimagedisplay - A library for image and video display
  4. * See file License for license information.
  5. */
  6. #ifndef _IMAGEDISPLAY_IMAGEDISPLAYMANAGER_H
  7. #define _IMAGEDISPLAY_IMAGEDISPLAYMANAGER_H
  8. #include <list>
  9. #include <core/imagedisplay/ImageDisplay.h>
  10. namespace NICE {
  11. /**
  12. * Keep track of all stand alone ImageDisplay widgets. Singleton pattern.
  13. * Note that only "stand alone" ImageDisplay widgets are managed.
  14. * This means that widgets contained in other widgets are completely ignored
  15. * by ImageDisplayManager.
  16. *
  17. * @author Ferid Bajramovic
  18. *
  19. * @note
  20. * This class is experimental and might change in the future.
  21. */
  22. class ImageDisplayManager {
  23. public:
  24. //! Destructor
  25. virtual ~ImageDisplayManager();
  26. static inline ImageDisplayManager& instance() {
  27. if (s_instance.get() == NULL) {
  28. s_instance.reset(new ImageDisplayManager());
  29. }
  30. return *s_instance;
  31. }
  32. void registerWidget(ImageDisplay* widget);
  33. void unregisterWidget(ImageDisplay* widget);
  34. void hideAll();
  35. void showAll();
  36. void deleteAll();
  37. private:
  38. /**
  39. * Constructor.
  40. */
  41. ImageDisplayManager();
  42. static std::auto_ptr<ImageDisplayManager> s_instance;
  43. std::list<ImageDisplay*> widgets;
  44. };
  45. } // namespace
  46. #endif /* _IMAGEDISPLAY_IMAGEDISPLAYMANAGER_H */