Home | History | Annotate | Download | only in dev
      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.
      4  */
      5 
      6 /**
      7  * This file defines the <code>PPB_Buffer_Dev</code> interface.
      8  */
      9 label Chrome {
     10   M14 = 0.5
     11 };
     12 
     13 [assert_size(4)]
     14 enum PP_ScrollBy_Dev {
     15   PP_SCROLLBY_PIXEL = 0,
     16   PP_SCROLLBY_LINE = 1,
     17   PP_SCROLLBY_PAGE = 2,
     18   PP_SCROLLBY_DOCUMENT = 3
     19 };
     20 
     21 /**
     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.
     24  */
     25 interface PPB_Scrollbar_Dev {
     26   /**
     27    * Create a new scrollbar.  Returns 0 if the instance is invalid.
     28    */
     29   PP_Resource Create([in] PP_Instance instance,
     30                      [in] PP_Bool vertical);
     31 
     32   /**
     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.
     35    */
     36   PP_Bool IsScrollbar([in] PP_Resource resource);
     37 
     38   /**
     39    * Gets the thickness of a scrollbar.
     40    */
     41   uint32_t GetThickness([in] PP_Resource resource);
     42 
     43   /**
     44    * Returns PP_TRUE if the system scrollbar style is an overlap scrollbar.
     45    */
     46   PP_Bool IsOverlay([in] PP_Resource scrollbar);
     47 
     48   /**
     49    * Gets the value of the scrollbar.
     50    */
     51   uint32_t GetValue([in] PP_Resource scrollbar);
     52 
     53   /**
     54    * Sets the value of the scrollbar.
     55    */
     56   void SetValue([in] PP_Resource scrollbar,
     57                 [in] uint32_t value);
     58 
     59   /**
     60    * Set the document size (i.e. total length of the region that's being
     61    * scrolled).
     62    */
     63   void SetDocumentSize([in] PP_Resource scrollbar,
     64                        [in] uint32_t size);
     65 
     66   /**
     67    * Updates the tickmarks.  Only valid for vertical scrollbars.  "tick_marks"
     68    * contains "count" PP_Rect objects.
     69    */
     70   void SetTickMarks([in] PP_Resource scrollbar,
     71                     [in, size_as=count] PP_Rect[] tick_marks,
     72                     [in] uint32_t count);
     73 
     74   /**
     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.
     78    */
     79   void ScrollBy([in] PP_Resource scrollbar,
     80                 [in] PP_ScrollBy_Dev unit,
     81                 [in] int32_t multiplier);
     82 };
     83