1f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org/* 2f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org * Copyright 2010 The WebRTC Project Authors. All rights reserved. 3f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org * 4f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org * Use of this source code is governed by a BSD-style license 5f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org * that can be found in the LICENSE file in the root of the source 6f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org * tree. An additional intellectual property rights grant can be found 7f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org * in the file PATENTS. All contributing project authors may 8f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org * be found in the AUTHORS file in the root of the source tree. 9f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org */ 10f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org 11f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org#ifndef WEBRTC_BASE_WINDOWPICKER_H_ 12f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org#define WEBRTC_BASE_WINDOWPICKER_H_ 13f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org 14f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org#include <string> 15f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org#include <vector> 16f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org 17f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org#include "webrtc/base/window.h" 18f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org 19f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.orgnamespace rtc { 20f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org 21f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.orgclass WindowDescription { 22f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org public: 23f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org WindowDescription() : id_() {} 24f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org WindowDescription(const WindowId& id, const std::string& title) 25f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org : id_(id), title_(title) { 26f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org } 27f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org const WindowId& id() const { return id_; } 28f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org void set_id(const WindowId& id) { id_ = id; } 29f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org const std::string& title() const { return title_; } 30f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org void set_title(const std::string& title) { title_ = title; } 31f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org 32f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org private: 33f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org WindowId id_; 34f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org std::string title_; 35f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org}; 36f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org 37f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.orgclass DesktopDescription { 38f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org public: 39f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org DesktopDescription() : id_() {} 40f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org DesktopDescription(const DesktopId& id, const std::string& title) 41f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org : id_(id), title_(title), primary_(false) { 42f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org } 43f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org const DesktopId& id() const { return id_; } 44f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org void set_id(const DesktopId& id) { id_ = id; } 45f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org const std::string& title() const { return title_; } 46f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org void set_title(const std::string& title) { title_ = title; } 47f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org // Indicates whether it is the primary desktop in the system. 48f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org bool primary() const { return primary_; } 49f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org void set_primary(bool primary) { primary_ = primary; } 50f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org 51f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org private: 52f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org DesktopId id_; 53f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org std::string title_; 54f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org bool primary_; 55f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org}; 56f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org 57f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.orgtypedef std::vector<WindowDescription> WindowDescriptionList; 58f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.orgtypedef std::vector<DesktopDescription> DesktopDescriptionList; 59f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org 60f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.orgclass WindowPicker { 61f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org public: 62f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org virtual ~WindowPicker() {} 63f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org virtual bool Init() = 0; 64f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org 65f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org // TODO: Move this two methods to window.h when we no longer need to load 66f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org // CoreGraphics dynamically. 67f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org virtual bool IsVisible(const WindowId& id) = 0; 68f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org virtual bool MoveToFront(const WindowId& id) = 0; 69f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org 70f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org // Gets a list of window description and appends to descriptions. 71f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org // Returns true if successful. 72f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org virtual bool GetWindowList(WindowDescriptionList* descriptions) = 0; 73f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org // Gets a list of desktop descriptions and appends to descriptions. 74f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org // Returns true if successful. 75f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org virtual bool GetDesktopList(DesktopDescriptionList* descriptions) = 0; 76f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org // Gets the width and height of a desktop. 77f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org // Returns true if successful. 78f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org virtual bool GetDesktopDimensions(const DesktopId& id, int* width, 79f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org int* height) = 0; 80f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org}; 81f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org 82f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org} // namespace rtc 83f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org 84f048872e915a3ee229044ec4bc541f6cbf9e4de1henrike@webrtc.org#endif // WEBRTC_BASE_WINDOWPICKER_H_ 85