VCOM:VectorWorks:Workspaces:IWorkspaceFile

From Vectorworks Developer
Jump to navigation Jump to search

.SDK|SDK ..SDK:Types|SDK Types ..VCOM:VCOM (Vectorworks Component Object Model)|VCOM Basics ..VCOM:Class Reference|VCOM Class Reference

Description

namespace VectorWorks::Workspaces

Interface

static const VWIID IID_WorkspaceFile = { 0xE0574BF4, 0x85C8, 0x4782, { 0x8F, 0x4B, 0x58, 0xF7, 0xE8, 0xA0, 0xB2, 0xC0 } };

class IWorkspaceFile : public IVWUnknown
{
public:
  virtual VCOMError VCOM_CALLTYPE Create(const TXString& inWorkspaceFileToCreate) = 0;
  virtual VCOMError VCOM_CALLTYPE Open(const TXString& inWorkspaceFileToOpen, long inPermissions) = 0;
  virtual VCOMError VCOM_CALLTYPE IsOpen(bool& openStatus) = 0;
  virtual VCOMError VCOM_CALLTYPE Close() = 0;
  virtual VCOMError VCOM_CALLTYPE Save(const TXString& inSavedFileName = "") = 0;

  virtual VCOMError VCOM_CALLTYPE SetVersion(long inWorkspaceVersionCurrent) = 0;
  virtual VCOMError VCOM_CALLTYPE GetVersion(long& outWorkspaceFileVersion) = 0;

  virtual VCOMError VCOM_CALLTYPE GetMenuBar(IWorkspaceMenuBar** outMenuBar) = 0;

  virtual VCOMError VCOM_CALLTYPE SetShortcutKeys(TSpecialKeys inSpecialKeys, TConstraintsKeys inConstraintsKeys) = 0;
  virtual VCOMError VCOM_CALLTYPE GetShortcutKeys(TSpecialKeys& outSpecialKeys, TConstraintsKeys& outConstraintsKeys) = 0;

  virtual VCOMError VCOM_CALLTYPE SetWindowsOSData(const TXString& inData) = 0;
  virtual VCOMError VCOM_CALLTYPE GetWindowsOSData(TXString& outData) = 0;

  virtual VCOMError VCOM_CALLTYPE SetApplicationOrMonitorRect(Sint16 inTop, Sint16 inLeft, Sint16 inWidth, Sint16 inHeight) = 0;
  virtual VCOMError VCOM_CALLTYPE GetApplicationOrMonitorRect(Sint16& outTop, Sint16& outLeft, Sint16& outWidth, Sint16& outHeight) = 0;

  virtual VCOMError VCOM_CALLTYPE CreateMenuItem(const TXString& inIdentifier, IWorkspaceMenuItem** outMenuItem) = 0;
  virtual VCOMError VCOM_CALLTYPE CreateMenuChunk(const TXString& inIdentifier, EWorkspaceMenuChunkType inChunkType, IWorkspaceMenuChunk** outMenuChunk) = 0;
  virtual VCOMError VCOM_CALLTYPE CreateMenu(const TXString& inIdentifier, IWorkspaceMenu** outMenu) = 0;
  virtual VCOMError VCOM_CALLTYPE CreateTool(const TXString& inIdentifier, IWorkspaceTool** outTool) = 0;
  virtual VCOMError VCOM_CALLTYPE CreateToolSet(const TXString& inIdentifier, IWorkspaceToolSet** outToolSet) = 0;
  virtual VCOMError VCOM_CALLTYPE CreateToolPalette(const TXString& inIdentifier, IWorkspaceToolPalette** outToolPalette) = 0;
  virtual VCOMError VCOM_CALLTYPE GetToolUsingIdentifier(const TXString& inIdentifier, IWorkspaceTool** outTool) = 0;
  virtual VCOMError VCOM_CALLTYPE GetToolSetUsingIdentifier(const TXString& inIdentifier, IWorkspaceToolSet** outToolSet) = 0;
  virtual VCOMError VCOM_CALLTYPE GetToolPaletteUsingIdentifier(const TXString& inIdentifier, IWorkspaceToolPalette** outToolPalette) = 0;
  virtual VCOMError VCOM_CALLTYPE GetMenuItemUsingIdentifier(const TXString& inIdentifier, IWorkspaceMenuItem** outMenuItem) = 0;
  virtual VCOMError VCOM_CALLTYPE GetMenuChunkUsingIdentifier(const TXString& inIdentifier, IWorkspaceMenuChunk** outMenuChunk) = 0;
  virtual VCOMError VCOM_CALLTYPE GetMenuUsingIdentifier(const TXString& inIdentifier, IWorkspaceMenu** outMenu) = 0;
  virtual VCOMError VCOM_CALLTYPE GetToolPaletteCount(Sint16& outCount) = 0;
  virtual VCOMError VCOM_CALLTYPE GetToolPaletteAtIndex(Sint16 inIndex, IWorkspaceToolPalette** outToolPalette) = 0;
  virtual VCOMError VCOM_CALLTYPE DeleteToolPalette(IWorkspaceToolPalette** ioToolPalette) = 0;
  virtual VCOMError VCOM_CALLTYPE GetAttributesPalette(IWorkspaceAttributesPalette** outAttributesPalette) = 0;
  virtual VCOMError VCOM_CALLTYPE GetConstraintsPalette(IWorkspaceConstraintsPalette** outConstraintsPalette) = 0;
  virtual VCOMError VCOM_CALLTYPE GetObjectInfoPalette(IWorkspaceObjectInfoPalette** outObjectInfoPalette) = 0;
  virtual VCOMError VCOM_CALLTYPE GetMessagePalette(IWorkspaceMessagePalette** outMessagePalette) = 0;
  virtual VCOMError VCOM_CALLTYPE GetNavigationPalette(IWorkspaceNavigationPalette** outNavigationPalette) = 0;
  virtual VCOMError VCOM_CALLTYPE GetVisualizationPalette(IWorkspaceVisualizationPalette** outVisualizationPalette) = 0;
  virtual VCOMError VCOM_CALLTYPE GetResourceBrowserPalette(IWorkspaceResourceBrowserPalette** outResourceBrowser) = 0;
  virtual VCOMError VCOM_CALLTYPE GetWorkingPlanePalette(IWorkspaceWorkingPlanePalette** outWorkingPlanePalette) = 0;
  virtual VCOMError VCOM_CALLTYPE GetDocumentContextualMenu(IWorkspaceMenu** outDocumentContextualMenu) = 0;
  virtual VCOMError VCOM_CALLTYPE GetObjectContextualMenu(IWorkspaceMenu** outObjectContextualMenu) = 0;
  virtual VCOMError VCOM_CALLTYPE CopyPaletteStateInfoFromWorkspace(IWorkspaceFile* inSourceWorkspaceFile) = 0;
  virtual VCOMError VCOM_CALLTYPE GetLastError(EWorkspacesError& outError) = 0;
  virtual VCOMError VCOM_CALLTYPE GetKeyDisplayString( char inKeyCode, TXString &outDisplayString ) = 0;
};

Members

Create Create a new workspace file.
Open Opens existing workspace file.
IsOpen Determines if the workspace file has been opened or not.
Close Closes an opened workspace file.
Save Saves the workspace.
SetVersion Set workspace file version.
GetVersion Get workspace file version.
GetMenuBar Gets the menu bar for the current workspace.
SetShortcutKeys Sets the various shortcut keys for the workspace.
GetShortcutKeys Gets the various shortcut keys for the workspace. Any parameter may be NULL if the client is not interested in a specific piece of data. The display string for the keycodes returned in outSpecialKeys and outConstraintsKeys can be converted into an equivalent string form with the GetKeyDisplayString function.
SetWindowsOSData Sets the OS data specific to the Windows palette.
GetWindowsOSData Gets the OS data specific to the Windows palette.
SetApplicationOrMonitorRect Sets a set of dimensions that represent either the Application Frame (for Windows) or the size of the Main Display (for Macintosh).
GetApplicationOrMonitorRect Gets a set of dimensions that represent either the Application Frame (for Windows) or the size of the Main Display (for Macintosh).
CreateMenuItem Creates a new menu item in the workspace that can be added to a menu if it does not yet exist.
CreateMenuChunk Creates a new menu chunk in the workspace that can be added to a menu if it does not yet exist.
CreateMenu Gets the menu, or if it does not exist, creates a new menu in the Workspace that can be referrenced either by the Menu Bar or a Menu Item or as a Menu Chunk.
CreateTool Creates a tool in the workspace if it does not exist.
CreateToolSet Creates a tool set in the workspace if it does not exist.
CreateToolPalette creates a tool palette in the workspace if it does not exist.
GetToolUsingIdentifier Gets the tool that corresponds to the given identifier.
GetToolSetUsingIdentifier Gets the tool set that corresponds to the given identifier.
GetToolPaletteUsingIdentifier Gets the tool palette that corresponds to the given identifier.
GetMenuItemUsingIdentifier Gets the menu item that corresponds to the given identifier.
GetMenuChunkUsingIdentifier Gets the menu chunk that corresponds to the given identifier.
GetMenuUsingIdentifier Gets the menu that corresponds to the given identifier.
GetToolPaletteCount Gets the count of tool palettes in the workspace.
GetToolPaletteAtIndex Gets the tool palette at the given index.
DeleteToolPalette Deletes the given tool palette from the workspace and sets the IWorkspaceToolPalette NULL.
GetAttributesPalette Gets the attributes palette.
GetConstraintsPalette Gets the constraints palette.
GetObjectInfoPalette Gets the object info palette.
GetMessagePalette Gets the message palette.
GetNavigationPalette Gets the navigation palette.
GetVisualizationPalette Gets the visualization palette.
GetResourceBrowserPalette Gets the resource browser palette.
GetWorkingPlanePalette Gets the working plane palette.
GetDocumentContextualMenu Gets the Document Contextual Menu.
GetObjectContextualMenu Gets the Object Contextual Menu.
CopyPaletteStateInfoFromWorkspace Copies all palette state information from the given Workspace file.
GetLastError Gets the last error that was generated by the IWorkspaces interface.
GetKeyDisplayString Converts the keycodes obtained by the GetShortcutKeys function.

Remarks

ESpecialKeys defines the information contained within the key array of the TSpecialKeys struct

enum ESpecialKeys {
  eSpecialKeys_GroupMode1			= 0,
  eSpecialKeys_GroupMode2			= 1,
  eSpecialKeys_GroupMode3			= 2,
  eSpecialKeys_GroupMode4			= 3,
  eSpecialKeys_GroupMode5			= 4,
  eSpecialKeys_GroupMode6			= 5,
  eSpecialKeys_ScreenHintsToggle		= 6,
  eSpecialKeys_SetDatum				= 7,
  eSpecialKeys_SetSmartPointEdgeVectorSnap	= 8,
  eSpecialKeys_SnapLoupe			= 9,
  eSpecialKeys_RelativeAnglesToggle		= 10,
  eSpecialKeys_SuspendSnapping			= 11,
  eSpecialKeys_AutomaticWorkingPlaneToggle	= 12,
  eSpecialKeys_XRayEdgeSelection		= 13,
  eSpecialKeys_CoincidentSelection		= 14,
};

The TSpecialKeys structure serves as a wrapper around an array of keys for the various mode bar short cut keys.

struct TSpecialKeys {
  char key[10];
};

The TConstraintsKeys structure serves as a wrapper around an array of keys for the various constraints short cut keys.

struct TConstraintsKeys {
  char key[8];
};

Version

Available from: VectorWorks 12

See Also

VCOM:VCOMPtr | VCOM:VectorWorks:Workspaces:IWorkspaces

[[VCOM:VCOMPtr]] | [[VCOM:VectorWorks:Workspaces:IWorkspaces]]