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.
6 /* From dev/ppb_scrollbar_dev.idl modified Wed Oct 5 14:06:02 2011. */
8 #ifndef PPAPI_C_DEV_PPB_SCROLLBAR_DEV_H_
9 #define PPAPI_C_DEV_PPB_SCROLLBAR_DEV_H_
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_point.h"
15 #include "ppapi/c/pp_rect.h"
16 #include "ppapi/c/pp_resource.h"
17 #include "ppapi/c/pp_size.h"
18 #include "ppapi/c/pp_stdint.h"
20 #define PPB_SCROLLBAR_DEV_INTERFACE_0_5 "PPB_Scrollbar(Dev);0.5"
21 #define PPB_SCROLLBAR_DEV_INTERFACE PPB_SCROLLBAR_DEV_INTERFACE_0_5
25 * This file defines the <code>PPB_Buffer_Dev</code> interface.
34 PP_SCROLLBY_PIXEL
= 0,
37 PP_SCROLLBY_DOCUMENT
= 3
39 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_ScrollBy_Dev
, 4);
45 * @addtogroup Interfaces
49 * The interface for a scrollbar. A scrollbar is a widget, so the functions
50 * in PPB_Widget can also be used with scrollbar objects.
52 struct PPB_Scrollbar_Dev_0_5
{
54 * Create a new scrollbar. Returns 0 if the instance is invalid.
56 PP_Resource (*Create
)(PP_Instance instance
, PP_Bool vertical
);
58 * Returns PP_TRUE if the given resource is a Scrollbar. Returns PP_FALSE if
59 * the resource is invalid or some type other than a scrollbar.
61 PP_Bool (*IsScrollbar
)(PP_Resource resource
);
63 * Gets the thickness of a scrollbar.
65 uint32_t (*GetThickness
)(PP_Resource resource
);
67 * Returns PP_TRUE if the system scrollbar style is an overlap scrollbar.
69 PP_Bool (*IsOverlay
)(PP_Resource scrollbar
);
71 * Gets the value of the scrollbar.
73 uint32_t (*GetValue
)(PP_Resource scrollbar
);
75 * Sets the value of the scrollbar.
77 void (*SetValue
)(PP_Resource scrollbar
, uint32_t value
);
79 * Set the document size (i.e. total length of the region that's being
82 void (*SetDocumentSize
)(PP_Resource scrollbar
, uint32_t size
);
84 * Updates the tickmarks. Only valid for vertical scrollbars. "tick_marks"
85 * contains "count" PP_Rect objects.
87 void (*SetTickMarks
)(PP_Resource scrollbar
,
88 const struct PP_Rect tick_marks
[],
91 * Scroll by "multiplier" pixels/lines/pages units. Positive values are
92 * forward and negative are backward. If "unit" is document then any positive
93 * value goes to the end while any negative value goes to the beginning.
95 void (*ScrollBy
)(PP_Resource scrollbar
,
100 typedef struct PPB_Scrollbar_Dev_0_5 PPB_Scrollbar_Dev
;
105 #endif /* PPAPI_C_DEV_PPB_SCROLLBAR_DEV_H_ */