1// Copyright 2014 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#ifndef ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ 6#define ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ 7 8#include <string> 9 10#include "athena/athena_export.h" 11#include "ui/gfx/display.h" 12 13namespace aura { 14class Window; 15} 16 17namespace athena { 18class ScreenManagerDelegate; 19 20// Mananges basic UI components on the screen such as background, and provide 21// API for other UI components, such as window manager, home card, to 22// create and manage their windows on the screen. 23class ATHENA_EXPORT ScreenManager { 24 public: 25 struct ContainerParams { 26 ContainerParams(const std::string& name, int z_order_priority); 27 std::string name; 28 29 // True if the container can activate its child window. 30 bool can_activate_children; 31 32 // True if the container will grab all of input events. 33 bool grab_inputs; 34 35 // Defines the z_order priority of the container. 36 int z_order_priority; 37 }; 38 39 // Creates, returns and deletes the singleton object of the ScreenManager 40 // implementation. 41 static ScreenManager* Create(aura::Window* root); 42 static ScreenManager* Get(); 43 static void Shutdown(); 44 45 virtual ~ScreenManager() {} 46 47 // Creates the container window that is used when creating a normal 48 // widget without specific parent. 49 virtual aura::Window* CreateDefaultContainer( 50 const ContainerParams& params) = 0; 51 52 // Creates the container window on the screen. 53 virtual aura::Window* CreateContainer(const ContainerParams& params) = 0; 54 55 // Return the context object to be used for widget creation. 56 virtual aura::Window* GetContext() = 0; 57 58 // Set screen rotation. 59 // TODO(flackr): Extract and use ash DisplayManager to set rotation 60 // instead: http://crbug.com/401044. 61 virtual void SetRotation(gfx::Display::Rotation rotation) = 0; 62 virtual void SetRotationLocked(bool rotation_locked) = 0; 63}; 64 65} // namespace athena 66 67#endif // ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ 68