DphFormat Namespace Reference


Detailed Description

Contains the public API of Delphi's NX format program.


Classes

class  Block
 Interface to a format block. More...
class  Format
 Main Interface to the drawing format. More...

Typedefs

typedef void(*) InsertBlockCB (const std::string &)
typedef void(*) AppendEntryCB (const std::string &, int)
typedef std::vector< std::string >(*) GetDisabledFieldsCB (const std::string &)
typedef boost::shared_ptr<
Block
BlockPtr
 Pointer to the block object.
typedef std::vector< BlockPtrBlockList
 List of block objects.

Functions

void registerInsertBlockCB (const std::string &blockId, InsertBlockCB callback)
void registerAppendEntryCB (const std::string &blockId, AppendEntryCB callback)
void registerGetDisabledFieldsCB (const std::string &blockId, GetDisabledFieldsCB callback)


Typedef Documentation

typedef void(*) DphFormat::InsertBlockCB(const std::string &)

Function type of callback when a block is inserted

Note:
Assumes that the drawing modified is active in callback

typedef void(*) DphFormat::AppendEntryCB(const std::string &, int)

Function type of callback when an entry is appended

Note:
Assumes that the drawing modified is active in callback

typedef std::vector<std::string>(*) DphFormat::GetDisabledFieldsCB(const std::string &)

Function type of callback when user is editing a block. A list of field IDs to be disabled is returned.


Function Documentation

void DPHFMTAPIEXPORT DphFormat::registerInsertBlockCB ( const std::string &  blockId,
InsertBlockCB  callback 
)

Register a callback to when a block is inserted.

Example usage:

      void blockInserted( const std::string& blockId )
      {
          std::cout << "Inserted block " << blockId << std::endl;
      }

      // some function or class method
      void setup()
      {
          // ...
          DphFormat::registerInsertBlockCB("dphTitle", &blockInserted);
          // ...
      }

Parameters:
blockId the block that will trigger the callback when inserted
callback the function to call
Note:
Registration replaces existing registered callback for the block

void DPHFMTAPIEXPORT DphFormat::registerAppendEntryCB ( const std::string &  blockId,
AppendEntryCB  callback 
)

Register a callback to when an entry is appended

Example usage:

      void entryAppended( const std::string& blockId, int entryIndex )
      {
          std::cout << "Appended entry " << entryIndex << " in block " << blockId << std::endl;
      }

      // some function or class method
      void setup()
      {
          // ...
          DphFormat::registerAppendEntryCB("dphRevision", &entryAppended);
          // ...
      }

Parameters:
blockId the block that will trigger the callback when an entry is added
callback the function to call
Note:
Registration replaces existing registered callback for the block

void DPHFMTAPIEXPORT DphFormat::registerGetDisabledFieldsCB ( const std::string &  blockId,
GetDisabledFieldsCB  callback 
)

Register a callback to when an user edits the block to return list of fields that the user can't edit.

Example usage:

      std::vector<std::string> getDisabledTitleblockFields( const std::string& blockId )
      {
          std::vector<std::string> disabledFields;
          // user should not be able to edit Drawing Number since it was
          // pulled and entered from a database
          disabledFields.push_back("drawingNumber");
          return ( disabledFields );
      }

      // some function or class method
      void setup()
      {
          // ...
          DphFormat::registerGetDisabledFieldsCB("dphTitle", &getDisabledTitleblockFields);
          // ...
      }

Parameters:
blockId the block that will trigger the callback when the user edits the block
callback the function to call
Note:
Registration replaces existing registered callback for the block


Generated on Mon Oct 16 10:42:45 2006 for Delphi NX Drawing Format API by  doxygen 1.4.7