(* OCaml-Win32
 * win32_flatscrollbar.ml
 * Copyright (c) 2002-2004 by Harry Chomsky
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *)

open Win32_core

(********************************************************************)
(* User Interface: Windows User Experience: Windows Shell: SDK: Windows Controls: Individual Control Information: Flat Scroll Bars *)

type flat_sb_mode =
    FSB_ENCARTA_MODE
  | FSB_FLAT_MODE
  | FSB_REGULAR_MODE

type flat_sb_int_prop =
    WSB_PROP_CXHSCROLL
  | WSB_PROP_CXHTHUMB
  | WSB_PROP_CXVSCROLL
  | WSB_PROP_CYHSCROLL
  | WSB_PROP_CYVSCROLL
  | WSB_PROP_CYVTHUMB

type flat_sb_color_prop =
    WSB_PROP_HBKGCOLOR
  | WSB_PROP_VBKGCOLOR

type flat_sb_mode_prop =
    WSB_PROP_HSTYLE
  | WSB_PROP_VSTYLE

external flat_sb_enable_scroll_bar :
    wnd:hwnd ->
    typ:scroll_bar_type ->
    option:enable_scroll_bar_option ->
    bool = "flat_sb_enable_scroll_bar"

external flat_sb_get_scroll_info : wnd:hwnd -> typ:scroll_bar_type -> get_scroll_info = "flat_sb_get_scroll_info"

external flat_sb_get_scroll_pos : wnd:hwnd -> typ:scroll_bar_type -> int = "flat_sb_get_scroll_pos"

external flat_sb_get_int_prop : wnd:hwnd -> prop:flat_sb_int_prop -> int = "flat_sb_get_int_prop"
external flat_sb_get_color_prop : wnd:hwnd -> prop:flat_sb_color_prop -> color = "flat_sb_get_color_prop"
external flat_sb_get_mode_prop : wnd:hwnd -> prop:flat_sb_mode_prop -> flat_sb_mode = "flat_sb_get_mode_prop"
external flat_sb_get_palette : wnd:hwnd -> hpalette = "flat_sb_get_palette"
external flat_sb_get_winstyle : wnd:hwnd -> style = "flat_sb_get_winstyle"

external flat_sb_get_scroll_range : wnd:hwnd -> typ:scroll_bar_type -> (int * int) = "flat_sb_get_scroll_range"

external flat_sb_set_scroll_info :
    wnd:hwnd ->
    typ:scroll_bar_type ->
    info:set_scroll_info ->
    redraw:bool ->
    int = "flat_sb_set_scroll_info"

external flat_sb_set_scroll_pos : wnd:hwnd -> typ:scroll_bar_type -> pos:int -> redraw:bool -> int = "flat_sb_set_scroll_pos"

external flat_sb_set_int_prop : wnd:hwnd -> prop:flat_sb_int_prop -> value:int -> redraw:bool -> unit = "flat_sb_set_int_prop"
external flat_sb_set_color_prop : wnd:hwnd -> prop:flat_sb_color_prop -> color:color -> redraw:bool -> unit = "flat_sb_set_color_prop"
external flat_sb_set_mode_prop : wnd:hwnd -> prop:flat_sb_mode_prop -> mode:flat_sb_mode -> redraw:bool -> unit = "flat_sb_set_mode_prop"
external flat_sb_set_palette : wnd:hwnd -> palette:hpalette -> redraw:bool -> unit = "flat_sb_set_palette"
external flat_sb_set_winstyle : wnd:hwnd -> style:style -> redraw:bool -> unit = "flat_sb_set_winstyle"

external flat_sb_set_scroll_range : wnd:hwnd -> typ:scroll_bar_type -> range:(int * int) -> redraw:bool -> unit = "flat_sb_set_scroll_range"

external flat_sb_show_scroll_bar : wnd:hwnd -> typ:scroll_bar_type -> show:bool -> unit = "flat_sb_show_scroll_bar"

external initialize_flat_sb : wnd:hwnd -> unit = "initialize_flat_sb"

type uninitialize_flat_sb_result =
    Ufsbr_ok
  | Ufsbr_not_initialized
  | Ufsbr_fail
external uninitialize_flat_sb : wnd:hwnd -> uninitialize_flat_sb_result = "uninitialize_flat_sb"
