Alf::IAlfScrollBarModel Class Reference

class Alf::IAlfScrollBarModel : public Alf::IAlfModel

An interface of the scrollbar model.

Inherits from

Member Functions Documentation

changeData(int, int, int)

voidchangeData(intaTotalLength,
intaViewLength,
intaViewStartPosition
)[pure virtual]

Sets TotalLength, View length and ViewStartPosition for the Scrollbar.

See the documentation of initializeData() to know valid values of each model data. If the value passed are not valid, they are changed to the closest valid value.

Parameters

int aTotalLength- total length
int aViewLength- view Length
int aViewStartPosition- View Start Position

getTotalLength()

intgetTotalLength()const [pure virtual]

Length of the document or viewable data. (refer setter function for detailed concept).

getViewLength()

intgetViewLength()const [pure virtual]

Length of the view (refer setter function for detailed concept).

getViewStartPosition()

intgetViewStartPosition()const [pure virtual]

Position in arbitrary units of the start of the currently viewed data (refer setter function for detailed concept).

initializeData(int, int, int)

voidinitializeData(intaTotalLength,
intaViewLength,
intaViewStartPosition
)[pure virtual]

Function for initializing the model.

The unit of paremeters aTotalLength, aViewLength, aViewStartPosition depends on the user of scrollbar. For example editor may decide to support scrolling by line,means in case of editor aTotalLenght can be total number of lines in the document, aViewlength can be the number of lines which fit inside a page/view, aViewstartPosition can be the line number from which view starts and

(currently no visualization is there for focus position inside scrollbar)

Parameters

int aTotalLength- Total length of the content or document if it were laid out. Minimum Value of total length can be 1. If a value less than 1 is passed it is converted to 1 automatically.
int aViewLength- Amount of TotalLength which is viewable. Minmum value of viewlength is 1 and maximum value is equal to total length. If a value less than 1 is passed it is converted to 1 similarly, if a value greater than aTotalLength is passed it is converted to aTotalLength.
int aViewStartPosition- view start position. This can be between 0 and (aTotalLength - aViewLength). As in case of total length and view length, if a value out side range is passed it is convered to the nearest boundary value (0 or aTotalLength - aViewLength).

setTotalLength(int)

voidsetTotalLength(intaTotalLength)[pure virtual]

Sets the Total Length for the Scrollbar which is the length of the document or viewable data.

Arbitrary units are used, but the same units as the rest of the model. This length is best current estimate of the length of the entire viewable data in this model's direction.(i.e, vertical, horizontal). It represents physical extent (e.g. could be pixels), not logical size of the data. It is understood to represent the physical laid out size of the data if it were possible to view it all at once.

Parameters

int aTotalLength- Total length of the content or document. Minimum Value of total length can be 1. If a value less than 1 is passed, it is converted to 1 automatically. If the value passed is less than the current view length, current view length is also changed to the passed total length so that view length is still valid. Similarly if required, view start position is also changed so that it is still valid. See the documentation of initializeData() to know valid values of each model data. If change of more than one model data is required, use changeData() function.

setViewLength(int)

voidsetViewLength(intaViewLength)[pure virtual]

Sets the View Length for the Scrollbar For horizontal models, this is the width of the view. For veritcal, this is the height of the view.

Note the units are arbitrary but uniform with the rest of the model. Note that this measure is proportional to the physical width or height of the view.This metric is sometimes called the Thumb size.

Parameters

int aViewLength

setViewStartPosition(int)

voidsetViewStartPosition(intaViewStartPosition)[pure virtual]

Sets the View Start Position for the Scrollbar Position in arbitrary units of the start of the currently viewed data. For horizontal models, this is the position of the left of the view relative to the far left end of the document. For veritcal, this is the position of the top of the view from the top of the viewable data.

Note the units are arbitrary but uniform with the rest of the model. Position is in physical space as if the entire data were laid out. This metric is sometimes called the Thumb position.

Parameters

int aViewStartPosition- start position of the viewable area. This can be between 0 and (aTotalLength - aViewLength ). If a value out side range is passed, it is convered to the nearest boundary value (0 or totalLength - viewLength) See the documentation of initializeData() to know valid values of each model data. If change of more than one model data is required, use changeData() function.

type()

const IfId &type()[static, inline]

Getter for the type identifier of this interface.