#include <ShapeUpAPI.h>
Inheritance diagram for SUTheme:
Public Member Functions | |
SUTheme () | |
SUTheme (SUHANDLE hTheme) | |
SUShape | AddShape (const CShapeRecord *shapeData) |
void | BatchAddShapeBegin () |
void | BatchAddShapeEnd () |
void | ReplaceShapeData (SUHANDLE hShape, const CShapeRecord *shapeData) |
void | DeleteShape (SUHANDLE hShape) |
bool | IsSelected () |
bool | IsReadOnly () |
bool | IsVisible () |
std::string | GetName () |
void | SetName (const char *name) |
size_t | GetAttributeCount () |
std::string | GetAttributeName (size_t column) |
unsigned long | GetAttributeType (size_t column) |
size_t | GetAttributeIndex (const char *name) |
size_t | GetShapeCount () |
SUShape | GetShape (size_t index) |
SUShape | GetShapeFromIndex (size_t index) |
ShapeType | GetShapeType () |
void | GetBounds (SURectf &r) |
void | RecalcBounds () |
SURecordset | GetIntersectingShapes (SUShape shape) |
SURecordset | GetShapesInRect (const SURectf &r, bool bPartiallyInRectOk) |
size_t | GetSelectionCount () |
SURecordset | GetSelectedShapes () |
SURecordset | GetSelectedShapesInRect (const SURectf &r, bool bPartiallyInRectOk) |
std::string | GetInfoTip (SUShape shape) |
void | GetFont (LOGFONT *font, COLORREF *clr) |
SURecordset | GetShapesByQuery (const char *where) |
SUHANDLE | LookupWorkspace () |
size_t | AddAttribute (unsigned long type, const char *name, const char *defaultval=NULL) |
void | DeleteAttribute (size_t index) |
void | SetAttributeComment (size_t index, const char *comment) |
std::string | GetComment () |
void | SetComment (const char *comment) |
COLORREF | GetPenColor () |
void | SetPenColor (COLORREF clr) |
COLORREF | GetFillColor () |
void | SetFillColor (COLORREF clr) |
size_t | GetPenWidth () |
void | SetPenWidth (size_t width) |
size_t | GetPenStyle () |
void | SetPenStyle (size_t style) |
void | SetRasterImage (HBITMAP hbm, double west, double south, double east, double north, const char *sourceHint) |
void | SetSerialData (size_t byteCount, const void *bytes) |
void | ClearSelection () |
void | Select (bool select) |
void | InvertSelection () |
Even though ShapeUp supports different types of vector data, such as points, lines and polygons, a single theme may currently not contain more than one type.
An SUTheme is normally retrieved from an SUWorkspace object.
SUTheme::SUTheme | ( | ) | [inline] |
Default constructor.
SUTheme::SUTheme | ( | SUHANDLE | hTheme | ) | [inline] |
Constructor.
hTheme | is a handle to a ShapeUp theme. |
SUShape SUTheme::AddShape | ( | const CShapeRecord * | shapeData | ) | [inline] |
Adds a new shape to this theme. Adding a shape updates the themes bounding box automatically.
shapeData | is the shape to be added. ShapeUp makes a copy of this shape. |
void SUTheme::BatchAddShapeBegin | ( | ) | [inline] |
Turns off indexing and other time consuming tasks when calling AddShape(). Use this if many shapes should be added at once. After the shapes have been added, call BatchAddShapeEnd() to turn the features back on again.
void SUTheme::BatchAddShapeEnd | ( | ) | [inline] |
Turns on indexing and other tasks after calling AddShape().
void SUTheme::ReplaceShapeData | ( | SUHANDLE | hShape, | |
const CShapeRecord * | shapeData | |||
) | [inline] |
Replaces a shape in this theme. After this operation, the handle hShape is still valid, but points to the new shape instead. Also, after a call to this function, the themes bounding box must be updated via a call to SUTheme::RecalcBounds()
hShape | is a handle to the shape to replace. | |
shapeData | is the shape to be inserted. ShapeUp makes a copy of this shape. |
void SUTheme::DeleteShape | ( | SUHANDLE | hShape | ) | [inline] |
Deletes a shape in this theme. After this operation, the handle hShape is invalid. Also, after a call to this function, the themes bounding box must be updated via a call to SUTheme::RecalcBounds()
hShape | is a handle to the shape to delete. |
bool SUTheme::IsSelected | ( | ) | [inline] |
Queries ShapeUp if this theme is selected or not.
bool SUTheme::IsReadOnly | ( | ) | [inline] |
Queries ShapeUp if this theme is read-only or not.
bool SUTheme::IsVisible | ( | ) | [inline] |
Queries ShapeUp if this theme is visible or not.
std::string SUTheme::GetName | ( | ) | [inline] |
Queries ShapeUp for the name of this theme.
void SUTheme::SetName | ( | const char * | name | ) | [inline] |
Sets a new name for this theme.
name | is a null-terminated string containing the new name for this theme. |
size_t SUTheme::GetAttributeCount | ( | ) | [inline] |
Queries ShapeUp for the number of attributes this theme has.
std::string SUTheme::GetAttributeName | ( | size_t | column | ) | [inline] |
Queries ShapeUp for the name of this themes attributes.
column | is the zero-based index of the attribute. |
unsigned long SUTheme::GetAttributeType | ( | size_t | column | ) | [inline] |
Queries ShapeUp for the type of this themes attributes.
column | is the zero-based index of the attribute. |
size_t SUTheme::GetAttributeIndex | ( | const char * | name | ) | [inline] |
Queries ShapeUp for the index of a named attribute in this theme.
name | is the name of the attribute to look up. |
size_t SUTheme::GetShapeCount | ( | ) | [inline] |
Queries ShapeUp for the number of shapes this theme has.
SUShape SUTheme::GetShape | ( | size_t | index | ) | [inline] |
Queries ShapeUp for a shape of this theme.
index | is the zero-based index of the shape in this theme. |
SUShape SUTheme::GetShapeFromIndex | ( | size_t | index | ) | [inline] |
Queries ShapeUp for a shape of this theme.
index | is the shape index of the shape in this theme. |
ShapeType SUTheme::GetShapeType | ( | ) | [inline] |
Queries ShapeUp for the shape type of this theme.
void SUTheme::GetBounds | ( | SURectf & | r | ) | [inline] |
Gets the layers bounding box.
r | [out] is a rectangle that will receive the shape bounds. |
void SUTheme::RecalcBounds | ( | ) | [inline] |
Call this function to recalculate the layers bounding box after its data has been manipulated.
SURecordset SUTheme::GetIntersectingShapes | ( | SUShape | shape | ) | [inline] |
Queries ShapeUp for the shapes in this theme that intersects the shape argument. If the shape argument is taken from this theme, it is excluded from the resulting recordset. It's important to close the resulting recordset using SURecordset::Close() to avoid resource leaks.
shape | is a shape to compare this theme's shapes to to find intersections. |
SURecordset SUTheme::GetShapesInRect | ( | const SURectf & | r, | |
bool | bPartiallyInRectOk | |||
) | [inline] |
Queries ShapeUp for the shapes in a given rectangle in this theme. It's important to close the resulting recordset using SURecordset::Close() to avoid resource leaks.
r | is a rectangle to compare this theme's shapes to to find intersections. | |
bPartiallyInRectOk | if true, this function returns shapes intersecting the rectangle r. If false, only shapes fully contained in the rectangle r is returned. |
size_t SUTheme::GetSelectionCount | ( | ) | [inline] |
Returns the number of selected objects in this theme.
SURecordset SUTheme::GetSelectedShapes | ( | ) | [inline] |
Queries ShapeUp for the selected shapes in this theme. It's important to close the resulting recordset using SURecordset::Close() to avoid resource leaks.
SURecordset SUTheme::GetSelectedShapesInRect | ( | const SURectf & | r, | |
bool | bPartiallyInRectOk | |||
) | [inline] |
Queries ShapeUp for the selected shapes in a given rectangle in this theme. It's important to close the resulting recordset using SURecordset::Close() to avoid resource leaks.
r | is a rectangle to compare this theme's shapes to to find intersections. | |
bPartiallyInRectOk | if true, this function returns selected shapes intersecting the rectangle r. If false, only selected shapes fully contained in the rectangle r is returned. |
std::string SUTheme::GetInfoTip | ( | SUShape | shape | ) | [inline] |
Gets the InfoTip of a shape in the theme. The InfoTip is translated from the themes InfoTip Template using attributes of the shape.
shape | is the shape for which the InfoTip should be retrieved. |
void SUTheme::GetFont | ( | LOGFONT * | font, | |
COLORREF * | clr | |||
) | [inline] |
Gets font information for this theme.
font | is a pointer to a LOGFONT struct that will receive the font information. May be NULL if not required. | |
clr | is a pointer to a COLORREF value that will receive the text color information. May be NULL if not required. |
SURecordset SUTheme::GetShapesByQuery | ( | const char * | where | ) | [inline] |
Queries ShapeUp for the shapes matching a query string in this theme. It's important to close the resulting recordset using SURecordset::Close() to avoid resource leaks.
where | is an SQL where-statement as found in the ShapeUp Query dialog. |
SUHANDLE SUTheme::LookupWorkspace | ( | ) | [inline] |
Queries this theme for its parent workspace.
size_t SUTheme::AddAttribute | ( | unsigned long | type, | |
const char * | name, | |||
const char * | defaultval = NULL | |||
) | [inline] |
Adds an attribute to this theme.
type | is an ATTRIBUTETYPE value indicating the type of the attribute. | |
name | is a null-terminated string containing the name of the new attribute. This value may not be NULL nor an empty string. | |
defaultval | is a null-terminated string containing an optional default value to be added to all shapes. This parameter may be NULL. |
void SUTheme::DeleteAttribute | ( | size_t | index | ) | [inline] |
Deletes an attribute from this theme.
index | is the zero-based index of the attribute. |
void SUTheme::SetAttributeComment | ( | size_t | index, | |
const char * | comment | |||
) | [inline] |
Sets the comment for an attribute.
index | is the zero-based index of the attribute. | |
comment | is the new attribute comment. Use NULL to clear the comment. |
std::string SUTheme::GetComment | ( | ) | [inline] |
void SUTheme::SetComment | ( | const char * | comment | ) | [inline] |
COLORREF SUTheme::GetPenColor | ( | ) | [inline] |
void SUTheme::SetPenColor | ( | COLORREF | clr | ) | [inline] |
Sets the theme's pen color.
clr | is the theme's new pen color. |
COLORREF SUTheme::GetFillColor | ( | ) | [inline] |
void SUTheme::SetFillColor | ( | COLORREF | clr | ) | [inline] |
Sets the theme's fill color.
clr | is the theme's new pen color. |
size_t SUTheme::GetPenWidth | ( | ) | [inline] |
void SUTheme::SetPenWidth | ( | size_t | width | ) | [inline] |
Sets the theme's pen width.
width | is the theme's new pen width. |
size_t SUTheme::GetPenStyle | ( | ) | [inline] |
Gets the theme's pen style.
void SUTheme::SetPenStyle | ( | size_t | style | ) | [inline] |
Sets the theme's pen style.
style | is the theme's new pen style. For a list of possible style values see PENSTYLE. |
void SUTheme::SetRasterImage | ( | HBITMAP | hbm, | |
double | west, | |||
double | south, | |||
double | east, | |||
double | north, | |||
const char * | sourceHint | |||
) | [inline] |
Sets the theme's pen width.
hbm | is a handle to a Windows bitmap. ShapeUp will take ownership of the bitmap and destroy it when its no longer needed. | |
west | is the western boudary of the raster. | |
south | is the southern boudary of the raster. | |
east | is the eastern boudary of the raster. | |
north | is the northern boudary of the raster. | |
sourceHint | is a description of where the data came from. E.g. if loaded from a file, this could be the file name. This parameter is informational only, and may be NULL. If supplied, it is displayed in the ShapeUp statistical view. |
void SUTheme::SetSerialData | ( | size_t | byteCount, | |
const void * | bytes | |||
) | [inline] |
Sets data to be serialized with a theme. This function can be called at any time setting new data. However, when this function is called, any old data is discarded and fully replaced with the new.
This data can later be restored from a ShapeUp workspace file when it is loaded, if the plug-in has set up a deserialize hook using the ShapeUp_AddDeserializeHook call.
byteCount | is the size of the bytes array. | |
bytes | is a pointer to a byte sequence containing the data to be serialized. |
void SUTheme::ClearSelection | ( | ) | [inline] |
Clears the current shape selection in a theme.
void SUTheme::Select | ( | bool | select | ) | [inline] |
Clears the current shape selection in a theme.
select | is true if selecting and false if deselecting. |
void SUTheme::InvertSelection | ( | ) | [inline] |
Inverts the current shape selection in this theme.