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.

74 lines
2.1 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. // Copyright 2010 Google Inc. All Rights Reserved
  2. // thorcarpenter@google.com (Thor Carpenter)
  3. #ifndef TALK_BASE_WINDOWPICKER_H_
  4. #define TALK_BASE_WINDOWPICKER_H_
  5. #include <string>
  6. #include <vector>
  7. #include "talk/base/window.h"
  8. namespace talk_base {
  9. class WindowDescription {
  10. public:
  11. WindowDescription() : id_() {}
  12. WindowDescription(const WindowId& id, const std::string& title)
  13. : id_(id), title_(title) {
  14. }
  15. const WindowId& id() const { return id_; }
  16. void set_id(const WindowId& id) { id_ = id; }
  17. const std::string& title() const { return title_; }
  18. void set_title(const std::string& title) { title_ = title; }
  19. private:
  20. WindowId id_;
  21. std::string title_;
  22. };
  23. class DesktopDescription {
  24. public:
  25. DesktopDescription() : id_() {}
  26. DesktopDescription(const DesktopId& id, const std::string& title)
  27. : id_(id), title_(title) {
  28. }
  29. const DesktopId& id() const { return id_; }
  30. void set_id(const DesktopId& id) { id_ = id; }
  31. const std::string& title() const { return title_; }
  32. void set_title(const std::string& title) { title_ = title; }
  33. private:
  34. DesktopId id_;
  35. std::string title_;
  36. };
  37. typedef std::vector<WindowDescription> WindowDescriptionList;
  38. typedef std::vector<DesktopDescription> DesktopDescriptionList;
  39. class WindowPicker {
  40. public:
  41. virtual ~WindowPicker() {}
  42. virtual bool Init() = 0;
  43. // TODO: Move this two methods to window.h when we no longer need to load
  44. // CoreGraphics dynamically.
  45. virtual bool IsVisible(const WindowId& id) = 0;
  46. virtual bool MoveToFront(const WindowId& id) = 0;
  47. // Gets a list of window description and appends to descriptions.
  48. // Returns true if successful.
  49. virtual bool GetWindowList(WindowDescriptionList* descriptions) = 0;
  50. // Gets a list of desktop descriptions and appends to descriptions.
  51. // Returns true if successful.
  52. virtual bool GetDesktopList(DesktopDescriptionList* descriptions) = 0;
  53. // Gets the width and height of a desktop.
  54. // Returns true if successful.
  55. virtual bool GetDesktopDimensions(const DesktopId& id, int* width,
  56. int* height) = 0;
  57. };
  58. } // namespace talk_base
  59. #endif // TALK_BASE_WINDOWPICKER_H_