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.
7 * This file defines the <code>PPB_Buffer_Dev</code> interface.
14 enum PP_ScrollBy_Dev
{
15 PP_SCROLLBY_PIXEL
= 0,
18 PP_SCROLLBY_DOCUMENT
= 3
22 * The interface for a scrollbar. A scrollbar is a widget, so the functions
23 * in PPB_Widget can also be used with scrollbar objects.
25 interface PPB_Scrollbar_Dev
{
27 * Create a new scrollbar. Returns 0 if the instance is invalid.
29 PP_Resource Create
([in] PP_Instance instance
,
30 [in] PP_Bool vertical
);
33 * Returns PP_TRUE if the given resource is a Scrollbar. Returns PP_FALSE if
34 * the resource is invalid or some type other than a scrollbar.
36 PP_Bool IsScrollbar
([in] PP_Resource resource
);
39 * Gets the thickness of a scrollbar.
41 uint32_t GetThickness
([in] PP_Resource resource
);
44 * Returns PP_TRUE if the system scrollbar style is an overlap scrollbar.
46 PP_Bool IsOverlay
([in] PP_Resource scrollbar
);
49 * Gets the value of the scrollbar.
51 uint32_t GetValue
([in] PP_Resource scrollbar
);
54 * Sets the value of the scrollbar.
56 void SetValue
([in] PP_Resource scrollbar
,
60 * Set the document size (i.e. total length of the region that's being
63 void SetDocumentSize
([in] PP_Resource scrollbar
,
67 * Updates the tickmarks. Only valid for vertical scrollbars. "tick_marks"
68 * contains "count" PP_Rect objects.
70 void SetTickMarks
([in] PP_Resource scrollbar
,
71 [in, size_as
=count
] PP_Rect
[] tick_marks
,
75 * Scroll by "multiplier" pixels/lines/pages units. Positive values are
76 * forward and negative are backward. If "unit" is document then any positive
77 * value goes to the end while any negative value goes to the beginning.
79 void ScrollBy
([in] PP_Resource scrollbar
,
80 [in] PP_ScrollBy_Dev unit
,
81 [in] int32_t multiplier
);