1 // Copyright (c) 2012 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.
5 #ifndef PPAPI_CPP_FULLSCREEN_H_
6 #define PPAPI_CPP_FULLSCREEN_H_
8 #include "ppapi/cpp/instance_handle.h"
11 /// This file defines the API for handling transitions of a module instance to
12 /// and from fullscreen mode.
18 /// The Fullscreen class allowing you to check and toggle fullscreen mode.
21 /// A constructor for creating a <code>Fullscreen</code>.
23 /// @param[in] instance The instance with which this resource will be
25 explicit Fullscreen(const InstanceHandle
& instance
);
28 virtual ~Fullscreen();
30 /// IsFullscreen() checks whether the module instance is currently in
33 /// @return <code>true</code> if the module instance is in fullscreen mode,
34 /// <code>false</code> if the module instance is not in fullscreen mode.
37 /// SetFullscreen() switches the module instance to and from fullscreen
40 /// The transition to and from fullscreen mode is asynchronous. During the
41 /// transition, IsFullscreen() will return the previous value and
42 /// no 2D or 3D device can be bound. The transition ends at DidChangeView()
43 /// when IsFullscreen() returns the new value. You might receive other
44 /// DidChangeView() calls while in transition.
46 /// The transition to fullscreen mode can only occur while the browser is
47 /// processing a user gesture, even if <code>true</code> is returned.
49 /// @param[in] fullscreen <code>true</code> to enter fullscreen mode, or
50 /// <code>false</code> to exit fullscreen mode.
52 /// @return <code>true</code> on success or <code>false</code> on
54 bool SetFullscreen(bool fullscreen
);
56 /// GetScreenSize() gets the size of the screen in pixels. The module instance
57 /// will be resized to this size when SetFullscreen() is called to enter
60 /// @param[out] size The size of the entire screen in pixels.
62 /// @return <code>true</code> on success or <code>false</code> on
64 bool GetScreenSize(Size
* size
);
67 InstanceHandle instance_
;
72 #endif // PPAPI_CPP_FULLSCREEN_H_