////////////////////////////////////////////////////////////////////////////////
//
// PropertyManagerObject -      
// PropertyManagerEvent  -     
//
////////////////////////////////////////////////////////////////////////////////
#ifndef __PROPMEN_H
#define __PROPMEN_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifndef __LDEFIN2D_H
#include <ldefin2d.h>
#endif

#ifndef __BASEEVENT_H
#include "BaseEvent.h"
#endif

//-------------------------------------------------------------------------------
//     
// ---
int LibMessage( int     strId, int flags ); //    
int LibMessage( LPCTSTR str,   int flags ); //    


//-------------------------------------------------------------------------------
//   COM 
// ---
void DumpError(_com_error& e);              //    
void ShowError();                           //      HRESULT 


////////////////////////////////////////////////////////////////////////////////
//
//      
//
// ctrlID      
//      
//
////////////////////////////////////////////////////////////////////////////////
class PropertyManagerObject 
{
protected:
  int                  flagMode;         //    -
  IProcessParamPtr     procParam;        //            
  IPropertyTabsPtr     propTabs;         // 
  IPropertyControlsPtr curentCollection; //      
  IPropertyGridPtr     paramGrid;        //       
  IPropertySlideBoxPtr slideBox;         //   
  long                 rowIndex;         //  
  IProcessParamPtr     posLiaderParam;   //     

public:
           PropertyManagerObject();
  virtual ~PropertyManagerObject();

//   ##################################################################
  //  prButtonClick -  .
  virtual void OnButtonClick( long buttonID ){}     
  //  prChangeControlValue -   
  virtual void OnChangeControlValue( long ctrlID, const VARIANT& newVal ){}
 
  //    
  bool InitProcessParam( long toolBarID, SpecPropertyToolBarEnum toolBarType, long firstTabID = 0 );
  
  //  
  bool CreateTab( long tabID, BOOL visible = TRUE, BOOL active = FALSE ); 
  //     
  IPropertyListPtr CreateRealList ( double minVal = 0, double maxVal = 0 );
  //     
  IPropertyListPtr CreateStringList();
  //     
  IPropertyListPtr CreateIntList();
  //   
  IPropertySeparatorPtr CreateSeparator ( SeparatorTypeEnum type );
  //  CheckBox- 
  IPropertyCheckBoxPtr CreateCheckBox   ( bool checked );
  //    
  IPropertyMultiButtonPtr CreateMultiButton( ButtonTypeEnum type );  
  //    
  void AddButton( IPropertyMultiButtonPtr& buttons, long btnID, bool cheched = false,  bool enable = true );
  //    
  void AddButton2( IPropertyMultiButtonPtr& buttons, long btnID, long bmpID, bool cheched = false,  bool enable = true );

  //    Control    (   )
  IPropertyControlPtr  GetPropertyControl( int ctrlID ); 
  //   
  void SetControlEnable( long ctrlID, bool enabled = true ); 

  //    
  void InitPropertyControl( IPropertyControl* control, long ctrlID, UINT hint = 0, UINT tips = 0, 
                            BOOL enable = TRUE, PropertyControlNameVisibility nameVisibility = ksNameAlwaysVisible, 
                            BOOL visible = TRUE );

  //     
  virtual void ShowControls(){}  
  //  
  virtual void RedrawPhantom(){}

  //      
  virtual int  ParamCount(){ return 0; }
  //    
  virtual void ShowParam(){}
  //  
  virtual long GetSlideID(){ return 0; }

  //             
  //   
  void AddStringToGrig( long paramID, LPCTSTR value ); 
  //            
  void AddDoubleToGrig( long paramID, double  value ); 
  
  //   
  void EndProcess();
//   ##################################################################
};


////////////////////////////////////////////////////////////////////////////////
//
// PropertyManagerEvent -      
//
////////////////////////////////////////////////////////////////////////////////
class PropertyManagerEvent : public BaseEvent
{
protected:
  PropertyManagerObject&  obj; //    

public:
	PropertyManagerEvent( LPDISPATCH manager, PropertyManagerObject& _obj );           
  virtual ~PropertyManagerEvent();

public: 
  // prButtonClick
  afx_msg BOOL ButtonClick( long buttonID );  
  // prChangeControlValue
  afx_msg BOOL ChangeControlValue( LPDISPATCH ctrl );
  // prControlCommand
  afx_msg BOOL ControlCommand( LPDISPATCH  ctrl, long buttonID );

  DECLARE_EVENTSINK_MAP()
};


//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif 
