1 // Copyright 2010 Google Inc. All Rights Reserved
3 // thorcarpenter@google.com (Thor Carpenter)
5 #ifndef TALK_BASE_WINDOWPICKER_H_
6 #define TALK_BASE_WINDOWPICKER_H_
11 #include "talk/base/window.h"
15 class WindowDescription {
17 WindowDescription() : id_() {}
18 WindowDescription(const WindowId& id, const std::string& title)
19 : id_(id), title_(title) {
21 const WindowId& id() const { return id_; }
22 void set_id(const WindowId& id) { id_ = id; }
23 const std::string& title() const { return title_; }
24 void set_title(const std::string& title) { title_ = title; }
31 class DesktopDescription {
33 DesktopDescription() : id_() {}
34 DesktopDescription(const DesktopId& id, const std::string& title)
35 : id_(id), title_(title), primary_(false) {
37 const DesktopId& id() const { return id_; }
38 void set_id(const DesktopId& id) { id_ = id; }
39 const std::string& title() const { return title_; }
40 void set_title(const std::string& title) { title_ = title; }
41 // Indicates whether it is the primary desktop in the system.
42 bool primary() const { return primary_; }
43 void set_primary(bool primary) { primary_ = primary; }
51 typedef std::vector<WindowDescription> WindowDescriptionList;
52 typedef std::vector<DesktopDescription> DesktopDescriptionList;
56 virtual ~WindowPicker() {}
57 virtual bool Init() = 0;
59 // TODO: Move this two methods to window.h when we no longer need to load
60 // CoreGraphics dynamically.
61 virtual bool IsVisible(const WindowId& id) = 0;
62 virtual bool MoveToFront(const WindowId& id) = 0;
64 // Gets a list of window description and appends to descriptions.
65 // Returns true if successful.
66 virtual bool GetWindowList(WindowDescriptionList* descriptions) = 0;
67 // Gets a list of desktop descriptions and appends to descriptions.
68 // Returns true if successful.
69 virtual bool GetDesktopList(DesktopDescriptionList* descriptions) = 0;
70 // Gets the width and height of a desktop.
71 // Returns true if successful.
72 virtual bool GetDesktopDimensions(const DesktopId& id, int* width,
76 } // namespace talk_base
78 #endif // TALK_BASE_WINDOWPICKER_H_