home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1996 November
/
VPR9611B.ISO
/
vabasic
/
ntclnt.exe
/
DISK8
/
data.8
/
datab
/
INCLUDE
/
VWINTMIX.HH
< prev
next >
Wrap
Text File
|
1996-07-29
|
22KB
|
587 lines
//------------------------------------------------------------------------
// $Source: /rcs/vwrcs/engine/vwintmix.hh,v $
// Checked in by: $Author: fulvio $
// $Date: 1996/07/25 15:18:48 $ $Revision: 1.2 $
//------------------------------------------------------------------------
// Copyright(c) 1993, Visual Edge Software Ltd.
//
// ALL RIGHTS RESERVED. This notice is intended as a precaution
// against inadvertent publication, and shall not be deemed to
// constitute an acknowledgment that publication has occurred
// nor to imply any waiver of confidentiality. The year included
// in the notice is the year of the creation of the work.
//------------------------------------------------------------------------
// DESCRIPTION: Mixins providing class specific data
//
//------------------------------------------------------------------------
// NOTE: This is a public API file
//------------------------------------------------------------------------
#ifndef VWINTMIX_HH
#define VWINTMIX_HH
#include <intmixin.hh>
//--------------------------------------------------------------------------
// The VwToolData mixin provides the data necessary to represent a class
// in the Toolbox.
//--------------------------------------------------------------------------
VCLASS VwMixToolData : public VeMixToolData, public VeDelegateMixin
{
public:
VOPERDECL VwMixToolData(VePrimary *obj);
static VMETHODDECL(void *) Creator(VePrimary *obj);
//------------------------------------------------------------------
// Returns the visible class name to be seen by the user. Used
// in the builder for the lable in the Toolbox. If not specified
// the class name is used.
//------------------------------------------------------------------
VMETHODDECL(VeString) IconLabel();
//------------------------------------------------------------------
// Returns a filename containing a icon. Used in the builder for
// the icon in the Toolbox, and for a default visual representation
// for instances of non-visual classes. A default icon is provided.
//------------------------------------------------------------------
VMETHODDECL(VeString) IconFilename();
VMETHODDECL(VTPixmap) Icon();
};
//--------------------------------------------------------------------------
// The VwHelpData mixin provides information for displaying context
// sensitive help about a class.
//--------------------------------------------------------------------------
VCLASS VwMixHelpData : public VeMixHelpData, public VeDelegateMixin
{
public:
VOPERDECL VwMixHelpData(VePrimary *);
static VMETHODDECL(void *) Creator(VePrimary *obj);
//------------------------------------------------------------------
// Returns the help context ID for the class.
//------------------------------------------------------------------
VMETHODDECL(VTHelpContextId) ContextID();
//------------------------------------------------------------------
// Returns the help file name where the help text is located.
// The default implementation returns the system help file.
//------------------------------------------------------------------
VMETHODDECL(VeString) HelpFile();
};
//--------------------------------------------------------------------------
// The VwVisualData mixin is used to specify configurable information
// for visual classes and for visuals of non-visual classes.
//--------------------------------------------------------------------------
VCLASS VwMixVisualData : public VeMixVisualData, public VeDelegateMixin
{
public:
VOPERDECL VwMixVisualData(VePrimary *obj);
static VMETHODDECL(void *) Creator(VePrimary *obj);
//------------------------------------------------------------------
// Returns the class name for a visual design time representation
// of non-visual objects. By default, non-visual instances are
// represented by an icon class.
// For a visual class it returns the visual class name.
//------------------------------------------------------------------
VMETHODDECL(VeString) VisualClass();
//------------------------------------------------------------------
// Returns whether objects of this class can have children. The
// default implementation returns False.
//------------------------------------------------------------------
VMETHODDECL(bool_t) IsManager();
//------------------------------------------------------------------
// Returns whether the object is graphically drawn on its parent
// i.e., has no window. The default implementation returns false.
//------------------------------------------------------------------
VMETHODDECL(bool_t) IsDrawnOnParent();
//------------------------------------------------------------------
// Returns whether the object can be constructed on the desktop.
// The default implementation returns false. If true, the
// VToplevelIface must be supplied.
//------------------------------------------------------------------
VMETHODDECL(bool_t) IsToplevel();
//------------------------------------------------------------------
// True if object can be interactively resized. True by default.
//------------------------------------------------------------------
VMETHODDECL(bool_t) IsResizable();
//------------------------------------------------------------------
// True if object can be interactively moved. True by default.
//------------------------------------------------------------------
VMETHODDECL(bool_t) IsMoveable();
//------------------------------------------------------------------
// Returns default width/height for instances. In pixels. 50x50
// pixels by default.
//------------------------------------------------------------------
VMETHODDECL(VTDimension) DefaultWidth();
VMETHODDECL(VTDimension) DefaultHeight();
//------------------------------------------------------------------
// True if object must be reconstructed when going to run mode
// Default is FALSE.
//------------------------------------------------------------------
VMETHODDECL(bool_t) ReconstructToRun();
VMETHODDECL(VTDimension) VerticalTolerance();
VMETHODDECL(VTDimension) HorizontalTolerance();
};
//--------------------------------------------------------------------------
// The VwVisualIface mixin is used to compute configurable information
// for visual classes (outline of a visual class)
//--------------------------------------------------------------------------
VCLASS VwMixVisualIface : public VeMixVisualIface, public VeDelegateMixin
{
public:
VOPERDECL VwMixVisualIface(VePrimary *obj);
static VMETHODDECL(void *) Creator(VePrimary *obj);
//------------------------------------------------------------------
// Returns the undelying toolkit gui for the object instance.
// An implementation for this method must be supplied.
//------------------------------------------------------------------
VMETHODDECL(VTGui) NativeGui(VeObjectRef object);
//------------------------------------------------------------------
// Called by the builder during a direct manipulation operation
// to set the new geometry for the instance. It is passed the
// bounding box measured in pixels. Returns a property value pairs
// list of the geometric properties of the object.
//------------------------------------------------------------------
VMETHODDECL(VePropertyList) SetGeometry(VeObjectRef obj,
VTPosition x, VTPosition y,
VTDimension width,
VTDimension height);
VMETHODDECL(VePropertyList) SetDimension(VeObjectRef parent,
VTDimension width,
VTDimension height);
VMETHODDECL(VePropertyList) SetPosition(VeObjectRef parent,
VTPosition x,
VTPosition y);
//-----------------------------------------------------------------
// Called by builder just after creation (and right before
// PostRealize) to set initial values for properties. Integration
// code returns a list of property-value pairs which will be set
// be the builder. A fragment will also be forced on each of these
// properties.
//------------------------------------------------------------------
VMETHODDECL(VePropertyList) ForcedValues(VeObjectRef obj);
//------------------------------------------------------------------
// Returns the bounding box area for the object, measured in
// pixels. X, and Y should be specified relative to its parent
// object.
//------------------------------------------------------------------
VMETHODDECL(status_t) GetGeometry(VeObjectRef obj, VTPosition &x,
VTPosition &y, VTDimension &width,
VTDimension &height);
//------------------------------------------------------------------
// Called before the underlying object is created.
//------------------------------------------------------------------
VMETHODDECL(void) PreRealize();
//-----------------------------------------------------------------
// Called after the underlying object is created.
//------------------------------------------------------------------
VMETHODDECL(void) PostRealize(VeObjectRef object);
//-----------------------------------------------------------------
// Called before the underlying object is destroyed.
//------------------------------------------------------------------
VMETHODDECL(void) PreDestroy(VeObjectRef object);
};
//--------------------------------------------------------------------------
// The VwManagerData mixin provides information for deciding what kind
// of children can be added to a manager.
//--------------------------------------------------------------------------
VCLASS VwMixManagerIface : public VeMixManagerIface, public VeDelegateMixin
{
public:
VOPERDECL VwMixManagerIface(VePrimary *obj);
static VMETHODDECL(void *) Creator(VePrimary *obj);
//------------------------------------------------------------------
// Returns true if the class of child specified in classname
// can be created on the object associated with this mixin.
//------------------------------------------------------------------
VMETHODDECL(bool_t) CanAcceptChild(VeString classname);
//------------------------------------------------------------------
// Returns true if the class of child specified in classname
// can be removed from the object associated with this mixin.
//------------------------------------------------------------------
VMETHODDECL(bool_t) CanLoseChild(VeString classname);
//------------------------------------------------------------------
// Returns the cursor to display during creation.
//------------------------------------------------------------------
VMETHODDECL(VTCursor) CreationCursor();
//------------------------------------------------------------------
// Returns the undelying toolkit gui which takes children for
// the object instance.
//------------------------------------------------------------------
VMETHODDECL(VTGui ) NativeChildSite(VeObjectRef object);
};
//--------------------------------------------------------------------------
// Provides class data for customizing Code Window presentation of
// objects
//-------------------------------------------------------------------------
VCLASS VwMixClassEventData : public VeMixClassEventData,
public VeDelegateMixin
{
public:
VOPERDECL VwMixClassEventData(VePrimary *);
//----------------------------------------------------------
// Get default event. If this mixin is not specified,
// the first event registered is assumed to be the default
// event.
//----------------------------------------------------------
VVIRTUALDECL(VeString) DefaultEvent();
//----------------------------------------------------------
// Get name of the method that will trigger the load
// event. Default is "Load".
//----------------------------------------------------------
VVIRTUALDECL(VeString) LoadEventTrigger();
protected:
};
//--------------------------------------------------------------------------
// Provides class data for customizing Property Editor presentation of
// objects
//-------------------------------------------------------------------------
VCLASS VwMixClassEditData : public VeMixClassEditData,
public VeDelegateMixin
{
public:
VOPERDECL VwMixClassEditData(VePrimary *obj);
//---------------------------------------------------------
// Determines whether objects of this class can be loaded
// into an editor, and be modified.
//----------------------------------------------------------
VMETHODDECL(VTEditorAccess) EditorAccess();
//----------------------------------------------------------
// Provides list of property categories for use by property
// editor.
//----------------------------------------------------------
VMETHODDECL(VTStringList) Categories();
//----------------------------------------------------------
// Provides list of properties for which setting order is
// relevant in the order that they must be set within a same
// pass number.
//----------------------------------------------------------
VVIRTUALDECL(VTStringList) PropsByPrecedence();
};
//---------------------------------------------------------------------
// This mixin is used to provide a specialized editor for a class
//---------------------------------------------------------------------
VCLASS VwMixClassEditIface : public VeMixClassEditIface,
public VeDelegateMixin
{
public:
VOPERDECL VwMixClassEditIface(VePrimary *obj);
//------------------------------------------------------------------
// Open a specialized object editor
//------------------------------------------------------------------
VMETHODDECL(VeObjectEditor *) OpenEditor(VeSupervisor *,
VEditorAdaptor *);
};
//-------------------------------------------------------------------------
// This mixin and the onew that follow are used to provide property
// editing information for an object editor.
//------------------------------------------------------------------------
VCLASS VwMixPropEditData : public VeMixPropEditData,
public VeDelegateMixin
{
public:
VOPERDECL VwMixPropEditData(VePrimary *obj);
//---------------------------------------------------------
// Determines whether property can be seen and modified
// in object editor
//----------------------------------------------------------
VMETHODDECL(VTEditorAccess) EditorAccess();
//-------------------------------------------------------------
// Determines if property values are only set when the builder
// switches to run mode. The default implementation returns
// False.
//-------------------------------------------------------------
VMETHODDECL(bool_t) DelayedSet();
//-------------------------------------------------------------
// Determines whether property can be edited when multiple
// objects are being edited.
//-------------------------------------------------------------
VMETHODDECL(bool_t) MultiEdit();
//-------------------------------------------------------------
// Determines whether property can be an expression or not
//-------------------------------------------------------------
VMETHODDECL(bool_t) CannotBeExpression();
//-------------------------------------------------------------
// Determines whether property is volatile or not.
//-------------------------------------------------------------
VMETHODDECL(bool_t) Volatile();
//-------------------------------------------------------------
// Provides the list of allowable values.
//-------------------------------------------------------------
VMETHODDECL(VTStringList) ValuesList(VeObjectRef);
//-------------------------------------------------------------
// Determines it the ValuesList is fixed or if the use can
// supply his own value.
//-------------------------------------------------------------
VMETHODDECL(bool_t) FixedList(VeObjectRef);
//-------------------------------------------------------------
// Provides the list of allowable constants when above values
// represent enumeration constants. If this list is not empty,
// make sure that it has the same number of items as ValuesList.
//-------------------------------------------------------------
VMETHODDECL(VeEnumTable) ValuesConstsList(VeObjectRef);
//---------------------------------------------------------------
// When an object editor applies a batch of changes, it will
// submit changes for all properties of pass n before any of
// pass n+1. Pass zero properties are constructor arguments
//---------------------------------------------------------------
VMETHODDECL(int) Pass();
//---------------------------------------------------------
// List categories this properties can appear in.
//---------------------------------------------------------
VMETHODDECL(VTStringList) Categories();
//------------------------------------------------------------------
// Returns the help context ID for a property
//------------------------------------------------------------------
VMETHODDECL(VTHelpContextId) ContextID();
};
//------------------------------------------------------------------------
// This mixin should be provided when default value for a property
// needs to be specified.
//------------------------------------------------------------------------
VCLASS VwMixPropDefaultData : public VeMixPropDefaultData,
public VeDelegateMixin
{
public:
VOPERDECL VwMixPropDefaultData(VePrimary *obj);
//------------------------------------------------------------------
// Returns the default value for property. Value is returned
// as a string, It is converted to the right type internally.
// Method should be used for property that are also default
// constructor arguments.
//------------------------------------------------------------------
VMETHODDECL(VeSourceText) DefaultValue();
};
//-------------------------------------------------------------------------
// This mixin and the one that follow are used to provide property
// editing behavior for an object editor.
//------------------------------------------------------------------------
VCLASS VwMixPropEditIface : public VeMixPropEditIface,
public VeDelegateMixin
{
public:
VOPERDECL VwMixPropEditIface(VePrimary *obj);
//-------------------------------------------------------------
// Allows two values to be compared for equality.
//-------------------------------------------------------------
VMETHODDECL(bool_t) Equal(VeObjectRef, VeValue&, VeValue&);
//-------------------------------------------------------------
// Allows the editor string value to be retreived from the object.
//-------------------------------------------------------------
VMETHODDECL(char *) Value(VeObjectRef);
//-----------------------------------------------------
// Provides the displayable string for a property value
//-----------------------------------------------------
VMETHODDECL(VeString) FormatForDisplay(VeString);
};
//------------------------------------------------------------------------
// This mixin should be provided when a property tool is available for
// this property.
//------------------------------------------------------------------------
VCLASS VwMixPropToolIface : public VeMixPropToolIface,
public VeDelegateMixin
{
public:
VOPERDECL VwMixPropToolIface(VePrimary *obj);
//--------------------------------------------------------------
// Popup a property tool for this property.
//-------------------------------------------------------------
VMETHODDECL(VePropertyTool *) OpenPropTool(VeObjectEditor *parent,
VTGeometry *geom);
};
//------------------------------------------------------------------------
// This mixin should be provided when a type editor is available for
// this property.
//------------------------------------------------------------------------
VCLASS VwMixTypeEditorIface : public VeMixTypeEditorIface,
public VeDelegateMixin
{
public:
VOPERDECL VwMixTypeEditorIface(VePrimary *obj);
//--------------------------------------------------------------
// Popup a type editor for this propety.
//-------------------------------------------------------------
VMETHODDECL(VeTypeEditor *) OpenTypeEditor(VeSupervisor *,
VTypeEditorAdaptor *);
};
VCLASS VwMixValidationIface : public VeMixValidationIface,
public VeDelegateMixin
{
public:
VOPERDECL VwMixValidationIface(VePrimary *obj);
//-----------------------------------------------------------------
// Validates given property value. Default is OKStatus.
//-----------------------------------------------------------------
VMETHODDECL(status_t) Validate(VeObjectRef, VeValue);
//------------------------------------------------------------------
// A converter can be used to convert default property values into
// more presentable form.
//------------------------------------------------------------------
VMETHODDECL(VeValue) Convert(VeObjectRef, VeValue);
};
VCLASS VwMixCopyValueIface : public VeMixCopyValueIface,
public VeDelegateMixin
{
public:
VOPERDECL VwMixCopyValueIface(VePrimary *obj);
static VMETHODDECL(VeMixin *) Creator(VePrimary *obj);
//----------------------------------------------------------------
// Returns a new copy of the given property value. Values that
// are pointers to memory should use this to allocate a copy.
//----------------------------------------------------------------
VMETHODDECL(VeSourceText) CopyValue(VeObjectRef,
VeValue,
VeMultiStream&);
//----------------------------------------------------------------
// Frees a copied property value
//----------------------------------------------------------------
VMETHODDECL(void) FreeValue(VeObjectRef, VeValue);
};
#endif // VWINTMIX_HH