class Alf::AlfGridLayoutPolicyImpl : public Alf::IAlfGridLayoutPolicy |
layoutmanager implementation class
Public Member Functions | |
---|---|
AlfGridLayoutPolicyImpl(AlfGridLayoutManager &) | |
~AlfGridLayoutPolicyImpl() | |
void | appendWeight(IAlfGridLayoutPolicy::gridLayoutDimension, const TAlfMetric &) |
int | count(IAlfGridLayoutPolicy::gridLayoutDimension) |
void | fillWeights(IAlfGridLayoutPolicy::gridLayoutDimension, int, const TAlfMetric &) |
void | insertWeight(IAlfGridLayoutPolicy::gridLayoutDimension, const TAlfMetric &, int) |
IAlfInterfaceBase * | makeInterface(const IfId &) |
void | removeWeight(IAlfGridLayoutPolicy::gridLayoutDimension, int) |
void | replaceWeight(IAlfGridLayoutPolicy::gridLayoutDimension, const TAlfMetric &, int) |
TAlfMetric | weight(IAlfGridLayoutPolicy::gridLayoutDimension, int) |
Private Member Functions | |
---|---|
CAlfGridLayout & | layout() |
Inherited Enumerations | |
---|---|
Alf::IAlfGridLayoutPolicy:gridLayoutDimension |
Private Attributes | |
---|---|
AlfGridLayoutManager & | mGridLayoutManager |
AlfGridLayoutPolicyImpl | ( | AlfGridLayoutManager & | aGridLayoutManager | ) |
layout manager constructor
AlfGridLayoutManager & aGridLayoutManager |
void | appendWeight | ( | IAlfGridLayoutPolicy::gridLayoutDimension | aDim, |
const TAlfMetric & | aWeight | |||
) | [virtual] |
Add a new line of blocks to this grid layout at the last position in the direction of the specified dimension. It will have the supplied weight. Weights can be any metric value, hence different units can be used for each block. In particular, EAlfUnitWeight can be used to represent weight values in aribtrary proportional units.
In the case of proportional weights, the effect of this will be to cause the other blocks to resize according to the new total weight.
If non-relative coordinates are specified (e.g., real pixels), the combined blocks might not fill the entire layout area. However, weights will always stretch to fill all available space after the fixed units have been determined. Therefore, depending on circumstances it may be better to use EAlfUnitWeight
For example [2 weights, 1 weight, 2 weights] in a layout of 100 pixels would result in [40 pixels, 20 pixels, 40 pixels].
For example [10 pixels, 1 weight, 15 pixels] in a layout of 100 pixels would result in [10 pixels, 75 pixels, 15 pixels].
AlfVisualException(ECommonError)if |
memory allocation error |
IAlfGridLayoutPolicy::gridLayoutDimension aDim | the dimension to which the weight corresponds |
const TAlfMetric & aWeight | the weight to be used for the block in the specified dimension, replacing any previously existing weight for that block |
int | count | ( | IAlfGridLayoutPolicy::gridLayoutDimension | aDim | ) | const [virtual] |
Return the number of lines of blocks in this grid, along the specified dimension
IAlfGridLayoutPolicy::gridLayoutDimension aDim | the dimension along which to count |
void | fillWeights | ( | IAlfGridLayoutPolicy::gridLayoutDimension | aDim, |
int | aCount, | |||
const TAlfMetric & | aWeight | |||
) | [virtual] |
Sets the number and weights of blocks in this grid layout in the direction of the specified dimension. Each block's weight will be set to equal the supplied value, the result of which is that all blocks will be equally spaced, whatever the units.
This API could be useful if then subsequent calls to replaceWeight are made to change specific values, depending on how many of the values are different.
Calling this with aCount set to 0 will clear all of the existing weights in the direction of the specified dimension.
this is the same as using metrics with unit type EAlfUnitWeight.
AlfVisualException(EInvalidArgument)if | aPos is out of bounds |
IAlfGridLayoutPolicy::gridLayoutDimension aDim | the dimension along which to fill |
int aCount | The number of lines of blocks to fill |
const TAlfMetric & aWeight | the weights to be used for all blocks |
void | insertWeight | ( | IAlfGridLayoutPolicy::gridLayoutDimension | aDim, |
const TAlfMetric & | aWeight, | |||
int | aPos | |||
) | [virtual] |
Add a new line of blocks to this grid layout at the specified position in the direciton of the specified dimension. It will have the supplied weight. In the case of proportional weights, the effect of this will be to cause the other blocks to resize according to the new total weight. It will also mean that many child visuals will now occupy different blocks within the grid according to how the blocks wrap.
will leave if the specified position is greater than the number of objects currently in the array, so check first by calling preferredDimensionCount
AlfVisualException(EInvalidArrayIndex)if | aPos is out of bounds |
IAlfGridLayoutPolicy::gridLayoutDimension aDim | the dimension to which the weight corresponds |
const TAlfMetric & aWeight | the weight to be used for the block in the specified dimension, replacing any previously existing weight for that block |
int aPos | the index of the block |
IAlfInterfaceBase * | makeInterface | ( | const IfId & | aType | ) | [virtual] |
const IfId & aType | The type id of the queried interface. |
void | removeWeight | ( | IAlfGridLayoutPolicy::gridLayoutDimension | aDim, |
int | aPos | |||
) | [virtual] |
Remove a line of blocks from this grid layout at the specified position in the specified dimension. In the case of proportional weights, the effect of this will be to cause the other blocks to resize according to the new total weight. It will also mean that many child visuals will now occupy different blocks within the grid according to how the blocks wrap.
AlfVisualException(EInvalidArrayIndex)if | aPos is out of bounds |
IAlfGridLayoutPolicy::gridLayoutDimension aDim | the dimension to which the weight corresponds |
int aPos | the index of the cell |
void | replaceWeight | ( | IAlfGridLayoutPolicy::gridLayoutDimension | aDim, |
const TAlfMetric & | aWeight, | |||
int | aPos | |||
) | [virtual] |
Sets the weight of a specific line of blocks in this grid layout, in the direction of the supplied dimension. In the case of proportional weights, the effect of this will be to cause the other blocks to resize according to the new total weight.
AlfVisualException(EInvalidArrayIndex)if | aPos is out of bounds |
IAlfGridLayoutPolicy::gridLayoutDimension aDim | the dimension to which the weight corresponds |
const TAlfMetric & aWeight | the weight to be used for the block in the specified dimension, replacing any previously existing weight for that cell |
int aPos | the index of the cell |
TAlfMetric | weight | ( | IAlfGridLayoutPolicy::gridLayoutDimension | aDim, |
int | aPos | |||
) | const [virtual] |
Returns the weight of a specific line of blocks in this grid layout, in the specified dimension.
AlfVisualException(EInvalidArrayIndex)if | aPos is out of bounds |
IAlfGridLayoutPolicy::gridLayoutDimension aDim | the dimension to which the weight corresponds |
int aPos | the index of the cell |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.