mCtrl  0.9.4
Data Structures | Typedefs
propset.h File Reference

Item set (data model for property view control) More...

Go to the source code of this file.

Data Structures

struct  MC_PROPSETITEMW
 Structure describing a single property (unicode variant). More...
 
struct  MC_PROPSETITEMA
 Structure describing a single property (ANSI variant). More...
 

Typedefs

typedef void * MC_HPROPSET
 Opaque property set handle. More...
 

MC_PROPSETITEM::fMask Bits

#define MC_PSIMF_TEXT   (0x00000001)
 
#define MC_PSIMF_VALUE   (0x00000002)
 
#define MC_PSIMF_LPARAM   (0x00000004)
 
#define MC_PSIMF_FLAGS   (0x00000008)
 

Property set flags

#define MC_PSF_SORTITEMS   (0x00000004L)
 Sort items alphabetically. More...
 

Functions

MC_HPROPSET mcPropSet_Create (DWORD dwFlags)
 Create new property set. More...
 
BOOL mcPropSet_AddRef (MC_HPROPSET hPropSet)
 Increment reference counter of the property set. More...
 
BOOL mcPropSet_Release (MC_HPROPSET hPropSet)
 Decrement reference counter of the property set. More...
 
int mcPropSet_GetItemCount (MC_HPROPSET hPropSet)
 Get count of properties in the property set. More...
 
int mcPropSet_InsertItemW (MC_HPROPSET hPropSet, MC_PROPSETITEMW *pItem)
 Insert new item into the property set (unicode variant). More...
 
int mcPropSet_InsertItemA (MC_HPROPSET hPropSet, MC_PROPSETITEMA *pItem)
 Insert new item into the property set (ANSI variant). More...
 
BOOL mcPropSet_GetItemW (MC_HPROPSET hPropSet, MC_PROPSETITEMW *pItem)
 Get some attributes of an item in the property set (unicode variant). More...
 
BOOL mcPropSet_GetItemA (MC_HPROPSET hPropSet, MC_PROPSETITEMA *pItem)
 Get some attributes of an item in the property set (ANSI variant). More...
 
int mcPropSet_SetItemW (MC_HPROPSET hPropSet, MC_PROPSETITEMW *pItem)
 Set some attributes of an item int the property set (unicode variant). More...
 
int mcPropSet_SetItemA (MC_HPROPSET hPropSet, MC_PROPSETITEMA *pItem)
 Set some attributes of an item int the property set (ANSI variant). More...
 
BOOL mcPropSet_DeleteItem (MC_HPROPSET hPropSet, int iItem)
 Delete an item from the proprty set. More...
 
BOOL mcPropSet_DeleteAllItems (MC_HPROPSET hPropSet)
 Delete all items of the proprty set. More...
 

Unicode Resolution

#define MC_PROPSETITEM   MCTRL_NAME_AW(MC_PROPSETITEM)
 
#define mcPropSet_InsertItem   MCTRL_NAME_AW(mcPropSet_InsertItem)
 
#define mcPropSet_SetItem   MCTRL_NAME_AW(mcPropSet_SetItem)
 
#define mcPropSet_GetItem   MCTRL_NAME_AW(mcPropSet_GetItem)
 

Detailed Description

Item set (data model for property view control)

The property set is a container of property items. It serves as a back-end for the property view control (MC_WC_PROPVIEW).


Data Structure Documentation

struct MC_PROPSETITEMW

Structure describing a single property (unicode variant).

Before using the structure you have always have to set bits of the member fMask to indicate what structure members are valid (on input) or expected (on output), and also set the member iItem to determine an index of property in the set.

See Also
mcPropSet_InsertItemW mcPropSet_SetItemW mcPropSet_GetItemW
Data Fields
DWORD fMask

Bitmask specifying what members are valid. See MC_PSIMF_xxxx.

int iItem

Index of the property.

LPWSTR pszText

Text label of the property.

int cchTextMax

Maximal number of characters in pszText. Used only on output.

MC_HVALUE hValue

Handle of property value.

LPARAM lParam

User data.

DWORD dwFlags

Property flags.

struct MC_PROPSETITEMA

Structure describing a single property (ANSI variant).

Before using the structure you have always have to set bits of the member fMask to indicate what structure members are valid (on input) or expected (on output), and also set the member iItem to determine an index of property in the set.

See Also
mcPropSet_InsertItemA mcPropSet_SetItemA mcPropSet_GetItemA
Data Fields
DWORD fMask

Bitmask specifying what members are valid. See MC_PSIMF_xxxx.

int iItem

Index of the property.

LPSTR pszText

Text label of the property.

int cchTextMax

Maximal number of characters in pszText. Used only on output.

MC_HVALUE hValue

Handle of property value type.

LPARAM lParam

User data.

DWORD dwFlags

Property flags.

Macro Definition Documentation

#define MC_PSIMF_TEXT   (0x00000001)
#define MC_PSIMF_VALUE   (0x00000002)
#define MC_PSIMF_LPARAM   (0x00000004)
#define MC_PSIMF_FLAGS   (0x00000008)
#define MC_PSF_SORTITEMS   (0x00000004L)

Sort items alphabetically.

#define MC_PROPSETITEM   MCTRL_NAME_AW(MC_PROPSETITEM)

Unicode-resolution alias.

See Also
MC_PROPERTYW MC_PROPERTYA
#define mcPropSet_InsertItem   MCTRL_NAME_AW(mcPropSet_InsertItem)

Unicode-resolution alias.

See Also
mcPropSet_InsertItemW mcPropSet_InsertItemA
#define mcPropSet_SetItem   MCTRL_NAME_AW(mcPropSet_SetItem)

Unicode-resolution alias.

See Also
mcPropSet_SetItemW mcPropSet_SetItemA
#define mcPropSet_GetItem   MCTRL_NAME_AW(mcPropSet_GetItem)

Unicode-resolution alias.

See Also
mcPropSet_GetItemW mcPropSet_GetItemA

Typedef Documentation

typedef void* MC_HPROPSET

Opaque property set handle.

Function Documentation

MC_HPROPSET mcPropSet_Create ( DWORD  dwFlags)

Create new property set.

Parameters
[in]dwFlagsFlags of the new property set.
Returns
Handle of the property set, or NULL if the function fails.
BOOL mcPropSet_AddRef ( MC_HPROPSET  hPropSet)

Increment reference counter of the property set.

Parameters
[in]hPropSetThe property set.
Returns
TRUE on success, FALSE on failure.
BOOL mcPropSet_Release ( MC_HPROPSET  hPropSet)

Decrement reference counter of the property set.

If the reference counter drops to zero, all resources allocated for the property set are released.

Parameters
[in]hPropSetThe property set.
Returns
TRUE on success, FALSE on failure.
int mcPropSet_GetItemCount ( MC_HPROPSET  hPropSet)

Get count of properties in the property set.

Parameters
[in]hPropSetThe property set.
Returns
The count, or -1 on failure.
int mcPropSet_InsertItemW ( MC_HPROPSET  hPropSet,
MC_PROPSETITEMW pItem 
)

Insert new item into the property set (unicode variant).

Note the item may be inserted to different position then requested with pItem->iItem, if the property set was created with the flag MC_PSF_SORTITEMS.

Parameters
[in]hPropSetThe property set.
[in]pItemThe item.
Returns
Index of the inserted item, or -1 on failure.
int mcPropSet_InsertItemA ( MC_HPROPSET  hPropSet,
MC_PROPSETITEMA pItem 
)

Insert new item into the property set (ANSI variant).

Note the item may be inserted to different position then requested with pItem->iItem, if the property set was created with the flag MC_PSF_SORTITEMS.

Parameters
[in]hPropSetThe property set.
[in]pItemThe item.
Returns
Index of the inserted item, or -1 on failure.
BOOL mcPropSet_GetItemW ( MC_HPROPSET  hPropSet,
MC_PROPSETITEMW pItem 
)

Get some attributes of an item in the property set (unicode variant).

Application has to set pItem->dwMask prior sending the message to indicate what attributes of the item to retrieve. If the application uses MC_PSIMF_TEXT, then it also has to set pItem->pszText to point to a buffer where the text will be stored and set pItem->cchTextMax to specify size of the buffer.

Parameters
[in]hPropSetThe property set.
[out]pItemItem structure.
Returns
TRUE on success, FALSE on failure.
BOOL mcPropSet_GetItemA ( MC_HPROPSET  hPropSet,
MC_PROPSETITEMA pItem 
)

Get some attributes of an item in the property set (ANSI variant).

Application has to set pItem->dwMask prior sending the message to indicate what attributes of the item to retrieve. If the application uses MC_PSIMF_TEXT, then it also has to set pItem->pszText to point to a buffer where the text will be stored and set pItem->cchTextMax to specify size of the buffer.

Parameters
[in]hPropSetThe property set.
[out]pItemItem structure to be filled.
Returns
TRUE on success, FALSE on failure.
int mcPropSet_SetItemW ( MC_HPROPSET  hPropSet,
MC_PROPSETITEMW pItem 
)

Set some attributes of an item int the property set (unicode variant).

Note that if the property set was created with the flag MC_PSF_SORTITEMS then the item can be moved to a new position in the property set. You can detect this by examining the return value.

Parameters
[in]hPropSetThe property set.
[in]pItemItem structure.
Returns
Index of the item after the operation, or -1 on failure.
int mcPropSet_SetItemA ( MC_HPROPSET  hPropSet,
MC_PROPSETITEMA pItem 
)

Set some attributes of an item int the property set (ANSI variant).

Note that if the property set was created with the flag MC_PSF_SORTITEMS then the item can be moved to a new position in the property set. You can detect this by examining the return value.

Parameters
[in]hPropSetThe property set.
[in]pItemItem structure.
Returns
Index of the item after the operation, or -1 on failure.
BOOL mcPropSet_DeleteItem ( MC_HPROPSET  hPropSet,
int  iItem 
)

Delete an item from the proprty set.

Parameters
[in]hPropSetThe property set.
[in]iItemIndex of the item.
Returns
TRUE on success, FALSE on failure.
BOOL mcPropSet_DeleteAllItems ( MC_HPROPSET  hPropSet)

Delete all items of the proprty set.

Parameters
[in]hPropSetThe property set.
Returns
TRUE on success, FALSE on failure.