{-# LINE 2 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}-- -*-haskell-*--- GIMP Toolkit (GTK) Widget ProgressBar---- Author : Axel Simon---- Created: 23 May 2001---- Copyright (C) 1999-2005 Axel Simon---- This library is free software; you can redistribute it and/or-- modify it under the terms of the GNU Lesser General Public-- License as published by the Free Software Foundation; either-- version 2.1 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-- Lesser General Public License for more details.---- |-- Maintainer : gtk2hs-users@lists.sourceforge.net-- Stability : provisional-- Portability : portable (depends on GHC)---- A widget which indicates progress visually--moduleGraphics.UI.Gtk.Display.ProgressBar(-- * Detail---- | The 'ProgressBar' is typically used to display the progress of a long-- running operation. It provides a visual clue that processing is underway.-- The 'ProgressBar' can be used in two different modes: percentage mode and-- activity mode.---- When an application can determine how much work needs to take place (e.g.-- read a fixed number of bytes from a file) and can monitor its progress, it-- can use the 'ProgressBar' in percentage mode and the user sees a growing bar-- indicating the percentage of the work that has been completed. In this mode,-- the application is required to call 'progressBarSetFraction' periodically to-- update the progress bar.---- When an application has no accurate way of knowing the amount of work to-- do, it can use the 'ProgressBar' in activity mode, which shows activity by a-- block moving back and forth within the progress area. In this mode, the-- application is required to call 'progressBarPulse' perodically to update the-- progress bar.---- There is quite a bit of flexibility provided to control the appearance of-- the 'ProgressBar'. Functions are provided to control the orientation of the-- bar, optional text can be displayed along with the bar, and the step size-- used in activity mode can be set.-- * Class Hierarchy-- |-- @-- | 'GObject'-- | +----'Object'-- | +----'Widget'-- | +----ProgressBar-- @-- * TypesProgressBar,ProgressBarClass,castToProgressBar,gTypeProgressBar,toProgressBar,-- * ConstructorsprogressBarNew,-- * MethodsprogressBarPulse,progressBarSetText,progressBarSetFraction,progressBarSetPulseStep,progressBarGetFraction,progressBarGetPulseStep,progressBarGetText,ProgressBarOrientation(..),progressBarSetOrientation,progressBarGetOrientation,progressBarSetEllipsize,progressBarGetEllipsize,-- * AttributesprogressBarOrientation,progressBarDiscreteBlocks,progressBarFraction,progressBarPulseStep,progressBarText,progressBarEllipsize,)whereimportControl.Monad(liftM)importSystem.Glib.FFIimportSystem.Glib.UTFStringimportSystem.Glib.AttributesimportSystem.Glib.PropertiesimportGraphics.UI.Gtk.Abstract.Object(makeNewObject)importGraphics.UI.Gtk.Types{-# LINE 107 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}importGraphics.UI.Gtk.General.Enums(ProgressBarOrientation(..))importGraphics.Rendering.Pango.Enums(EllipsizeMode(..)){-# LINE 113 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}---------------------- Constructors-- | Creates a new 'ProgressBar'.--progressBarNew::IOProgressBarprogressBarNew=makeNewObjectmkProgressBar$liftM(castPtr::PtrWidget->PtrProgressBar)$gtk_progress_bar_new{-# LINE 124 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}---------------------- Methods-- | Indicates that some progress is made, but you don't know how much. Causes-- the progress bar to enter \"activity mode\", where a block bounces back and-- forth. Each call to 'progressBarPulse' causes the block to move by a little-- bit (the amount of movement per pulse is determined by-- 'progressBarSetPulseStep').--progressBarPulse::ProgressBarClassself=>self->IO()progressBarPulseself=(\(ProgressBararg1)->withForeignPtrarg1$\argPtr1->gtk_progress_bar_pulseargPtr1){-# LINE 137 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}(toProgressBarself)-- | Causes the given @text@ to appear superimposed on the progress bar.--progressBarSetText::ProgressBarClassself=>self->String->IO()progressBarSetTextselftext=withUTFStringtext$\textPtr->(\(ProgressBararg1)arg2->withForeignPtrarg1$\argPtr1->gtk_progress_bar_set_textargPtr1arg2){-# LINE 145 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}(toProgressBarself)textPtr-- | Causes the progress bar to \"fill in\" the given fraction of the bar. The-- fraction should be between 0.0 and 1.0, inclusive.--progressBarSetFraction::ProgressBarClassself=>self->Double-- ^ @fraction@ - fraction of the task that's been completed->IO()progressBarSetFractionselffraction=(\(ProgressBararg1)arg2->withForeignPtrarg1$\argPtr1->gtk_progress_bar_set_fractionargPtr1arg2){-# LINE 156 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}(toProgressBarself)(realToFracfraction)-- | Sets the fraction of total progress bar length to move the bouncing block-- for each call to 'progressBarPulse'.--progressBarSetPulseStep::ProgressBarClassself=>self->Double-- ^ @fraction@ - fraction between 0.0 and 1.0->IO()progressBarSetPulseStepselffraction=(\(ProgressBararg1)arg2->withForeignPtrarg1$\argPtr1->gtk_progress_bar_set_pulse_stepargPtr1arg2){-# LINE 167 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}(toProgressBarself)(realToFracfraction)-- | Returns the current fraction of the task that's been completed.--progressBarGetFraction::ProgressBarClassself=>self->IODouble-- ^ returns a fraction from 0.0 to 1.0progressBarGetFractionself=liftMrealToFrac$(\(ProgressBararg1)->withForeignPtrarg1$\argPtr1->gtk_progress_bar_get_fractionargPtr1){-# LINE 177 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}(toProgressBarself)-- | Retrieves the pulse step set with 'progressBarSetPulseStep'--progressBarGetPulseStep::ProgressBarClassself=>self->IODouble-- ^ returns a fraction from 0.0 to 1.0progressBarGetPulseStepself=liftMrealToFrac$(\(ProgressBararg1)->withForeignPtrarg1$\argPtr1->gtk_progress_bar_get_pulse_stepargPtr1){-# LINE 186 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}(toProgressBarself)-- | Retrieves the text displayed superimposed on the progress bar, if any,-- otherwise @Nothing@.--progressBarGetText::ProgressBarClassself=>self->IO(MaybeString)-- ^ returns text, or @Nothing@progressBarGetTextself=(\(ProgressBararg1)->withForeignPtrarg1$\argPtr1->gtk_progress_bar_get_textargPtr1){-# LINE 195 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}(toProgressBarself)>>=maybePeekpeekUTFString-- | Causes the progress bar to switch to a different orientation-- (left-to-right, right-to-left, top-to-bottom, or bottom-to-top).--progressBarSetOrientation::ProgressBarClassself=>self->ProgressBarOrientation->IO()progressBarSetOrientationselforientation=(\(ProgressBararg1)arg2->withForeignPtrarg1$\argPtr1->gtk_progress_bar_set_orientationargPtr1arg2){-# LINE 204 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}(toProgressBarself)((fromIntegral.fromEnum)orientation)-- | Retrieves the current progress bar orientation.--progressBarGetOrientation::ProgressBarClassself=>self->IOProgressBarOrientationprogressBarGetOrientationself=liftM(toEnum.fromIntegral)$(\(ProgressBararg1)->withForeignPtrarg1$\argPtr1->gtk_progress_bar_get_orientationargPtr1){-# LINE 213 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}(toProgressBarself)-- | Sets the mode used to ellipsize (add an ellipsis: \"...\") the text if-- there is not enough space to render the entire string.---- * Available since Gtk+ version 2.6--progressBarSetEllipsize::ProgressBarClassself=>self->EllipsizeMode->IO()progressBarSetEllipsizeselfmode=(\(ProgressBararg1)arg2->withForeignPtrarg1$\argPtr1->gtk_progress_bar_set_ellipsizeargPtr1arg2){-# LINE 224 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}(toProgressBarself)((fromIntegral.fromEnum)mode)-- | Returns the ellipsizing position of the progressbar. See-- 'progressBarSetEllipsize'.---- * Available since Gtk+ version 2.6--progressBarGetEllipsize::ProgressBarClassself=>self->IOEllipsizeModeprogressBarGetEllipsizeself=liftM(toEnum.fromIntegral)$(\(ProgressBararg1)->withForeignPtrarg1$\argPtr1->gtk_progress_bar_get_ellipsizeargPtr1){-# LINE 236 "./Graphics/UI/Gtk/Display/ProgressBar.chs" #-}(toProgressBarself)---------------------- Attributes-- | Orientation and growth direction of the progress bar.---- Default value: 'ProgressLeftToRight'--progressBarOrientation::ProgressBarClassself=>AttrselfProgressBarOrientationprogressBarOrientation=newAttrprogressBarGetOrientationprogressBarSetOrientation-- | The number of discrete blocks in a progress bar (when shown in the-- discrete style).---- Allowed values: >= 2---- Default value: 10--progressBarDiscreteBlocks::ProgressBarClassself=>AttrselfIntprogressBarDiscreteBlocks=newAttrFromUIntProperty"discrete-blocks"-- | The fraction of total work that has been completed.---- Allowed values: [0,1]---- Default value: 0--progressBarFraction::ProgressBarClassself=>AttrselfDoubleprogressBarFraction=newAttrprogressBarGetFractionprogressBarSetFraction-- | The fraction of total progress to move the bouncing block when pulsed.---- Allowed values: [0,1]---- Default value: 0.1--progressBarPulseStep::ProgressBarClassself=>AttrselfDoubleprogressBarPulseStep=newAttrprogressBarGetPulseStepprogressBarSetPulseStep-- | Text to be displayed in the progress bar.---- Default value: \"%P %%\"--progressBarText::ProgressBarClassself=>ReadWriteAttrself(MaybeString)StringprogressBarText=newAttrprogressBarGetTextprogressBarSetText-- | The preferred place to ellipsize the string, if the progressbar does not-- have enough room to display the entire string, specified as a-- 'EllipsizeMode'.---- Note that setting this property to a value other than 'EllipsizeNone' has-- the side-effect that the progressbar requests only enough space to display-- the ellipsis \"...\". Another means to set a progressbar's width is-- 'Graphics.UI.Gtk.Abstract.Widget.widgetSetSizeRequest'.---- Default value: 'EllipsizeNone'--progressBarEllipsize::ProgressBarClassself=>AttrselfEllipsizeModeprogressBarEllipsize=newAttrprogressBarGetEllipsizeprogressBarSetEllipsizeforeignimportccallunsafe"gtk_progress_bar_new"gtk_progress_bar_new::(IO(PtrWidget))foreignimportccallunsafe"gtk_progress_bar_pulse"gtk_progress_bar_pulse::((PtrProgressBar)->(IO()))foreignimportccallunsafe"gtk_progress_bar_set_text"gtk_progress_bar_set_text::((PtrProgressBar)->((PtrCChar)->(IO())))foreignimportccallunsafe"gtk_progress_bar_set_fraction"gtk_progress_bar_set_fraction::((PtrProgressBar)->(CDouble->(IO())))foreignimportccallunsafe"gtk_progress_bar_set_pulse_step"gtk_progress_bar_set_pulse_step::((PtrProgressBar)->(CDouble->(IO())))foreignimportccallunsafe"gtk_progress_bar_get_fraction"gtk_progress_bar_get_fraction::((PtrProgressBar)->(IOCDouble))foreignimportccallunsafe"gtk_progress_bar_get_pulse_step"gtk_progress_bar_get_pulse_step::((PtrProgressBar)->(IOCDouble))foreignimportccallunsafe"gtk_progress_bar_get_text"gtk_progress_bar_get_text::((PtrProgressBar)->(IO(PtrCChar)))foreignimportccallsafe"gtk_progress_bar_set_orientation"gtk_progress_bar_set_orientation::((PtrProgressBar)->(CInt->(IO())))foreignimportccallunsafe"gtk_progress_bar_get_orientation"gtk_progress_bar_get_orientation::((PtrProgressBar)->(IOCInt))foreignimportccallsafe"gtk_progress_bar_set_ellipsize"gtk_progress_bar_set_ellipsize::((PtrProgressBar)->(CInt->(IO())))foreignimportccallsafe"gtk_progress_bar_get_ellipsize"gtk_progress_bar_get_ellipsize::((PtrProgressBar)->(IOCInt))