home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / ADDON.PAK / TOOL2.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  3.0 KB  |  91 lines

  1. /*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2.  
  3.   tool2.h
  4.   Created: 12/21/95
  5.   Copyright (c) 1987, 1995 Borland International Inc.  All Rights Reserved.
  6.   $Revision:   1.15  $
  7.    
  8. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/  
  9. #ifndef __TOOL2_H
  10. #define __TOOL2_H
  11.  
  12. #include <ideaddon\itool.h>
  13. #include <ideaddon\iproj.h>
  14. #include <ideaddon\comhelp.h>
  15. #include "tests.h"
  16.  
  17. class ToolTestC;    
  18.  
  19. //.............................................................................
  20. class ToolInvoker : public IUnknownImp< IToolImplementor > {
  21.  public:
  22.   ToolInvoker() : IUNKNOWNIMPL_INIT( IToolImplementor ) {}
  23.   virtual ToolReturn Execute( 
  24.                 IPolyString * cmdLine, 
  25.                 ProjectNode * nodeArray, 
  26.                 int numNodes );
  27. };
  28. //.............................................................................
  29. //
  30. // This class inherits from two IUnknown decendents. The IUnknown methods
  31. // are overridden by the comhelp IUnknownImp template class in the 
  32. // ProjectClient class below.
  33. //
  34. class projectClientCombo : public IProjectClient, public IProjectSaveClient {
  35. };
  36.  
  37. class ProjectClient : public IUnknownImp< projectClientCombo > {
  38.  public:
  39.   ProjectClient() : 
  40.       IUnknownImp< projectClientCombo >( IID_Addon_IProjectClient ) { 
  41.     _toolTest = NULL; 
  42.   }
  43.   virtual void OpenNotify( IPolyString * projectName );
  44.   virtual void CloseNotify();
  45.   virtual void NodeDeleteNotify( ProjectNode node ) {}
  46.   virtual void NodeAddNotify( ProjectNode node ) {}
  47.   virtual void NodeCopyNotify( ProjectNode, ProjectNode, BOOL ) {}
  48.   virtual void NodeMoveNotify( ProjectNode, ProjectNode ) {}
  49.   virtual void NodeChangeNotify( ProjectNode ) {}
  50.   virtual BOOL HandleAddNodeUI() { return FALSE; }
  51.   virtual void DependencyQueryResponder( ProjectNode /*node*/, 
  52.                             IPolyString * outputName ) {
  53.     outputName->Release();
  54.   }
  55.   
  56.   // IProjectSaveClient implementation
  57.   virtual void BeforeSaveNotify();
  58.   virtual void AfterSaveNotify();
  59.   
  60.   void RegisterToolTest( ToolTestC * tt ) { _toolTest = tt; }
  61.   
  62.  protected:
  63.   ToolTestC * _toolTest;
  64.   
  65. };
  66. //.............................................................................
  67. class ToolTestC : public TestObject {
  68.  public:
  69.   ToolTestC();
  70.   virtual ~ToolTestC();
  71.   //........ TestObject Interface Methods .......
  72.   virtual BOOL Init() { return TRUE; }
  73.   virtual void UnInit() {}  
  74.   virtual const char * GetName() { return "ToolTestC"; }
  75.   virtual const char * GetTestDescription( int /*testNum*/ ) { return "Does Nothing"; }
  76.   virtual void DoTest( int /*testNum*/ ) {}
  77.   
  78.   void RegisterTool();
  79.   void UnregisterTool();
  80.   void SetToolName( IPolyString * name ) { _toolName = name; }
  81.   
  82.  protected:
  83.   IToolServer * _toolServer;
  84.   IProjectServer * _projectServer;
  85.   ProjectClient *_projectClient;
  86.   ToolInvoker  *_toolInvoker;
  87.   IPolyString * _toolName;
  88. }; 
  89.  
  90. #endif    //  __TOOL2_H
  91.