home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vile-src.zip / vile-8.1 / visvile / oleauto.h < prev    next >
C/C++ Source or Header  |  1998-09-07  |  3KB  |  101 lines

  1. /* oleauto.h - declarations for oleauto.cpp */
  2.  
  3. #ifndef OLEAUTO_H
  4. #define OLEAUTO_H
  5.  
  6. #define PROGNAM "VisVile"
  7.  
  8. #include "w32ole.h"    // located one directory "up".
  9.  
  10. typedef struct visvile_opts_struct
  11. {
  12.     DWORD cd_doc_dir;    // Boolean, T -> winvile cd's to directory of opened
  13.                          //               text document.
  14.     DWORD close_ds_doc;  // Boolean, T -> close DevStudio copy of document
  15.                          //               just opened by winvile.
  16.     DWORD enabled;       // Boolean, T -> add-in enabled?
  17.     DWORD sync_errbuf;   // Boolean, T -> after a build completes with errors
  18.                          //               or warnings, attempt to open the
  19.                          //               build log file (if it exists) in
  20.                          //               winvile's error buffer.
  21.     DWORD write_buffers; // Boolean, T -> write modified buffers to disk
  22.                          //               prior to build.
  23. } VISVILE_OPTS;
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26.  
  27. // Class to control the winvile ole automation server.
  28. class CVile
  29. {
  30.     private:
  31.         IVileAuto *pVileAuto;
  32.  
  33.     public:
  34.         CVile()  { pVileAuto = NULL; }
  35.         ~CVile() { Disconnect(); }
  36.         HRESULT  Connect(int restore_wdw, VARIANT_BOOL *in_insert_mode);
  37.         bool     Connected();
  38.                         // Is visvile connected to winvile?
  39.         void     Disconnect();
  40.         HRESULT  FileOpen(BSTR filename, long lineno);
  41.                         // A negative lineno is the same as BOF.
  42.         HRESULT  VileCmd(const char *cmd,
  43.                          bool       restore_wdw,
  44.                          bool       force_connection = TRUE);
  45.                         // Run an arbitrary command.
  46. };
  47.  
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CConfigDlg dialog
  51.  
  52. class CConfigDlg : public CDialog
  53. {
  54. // Construction
  55. public:
  56.     virtual BOOL OnInitDialog();
  57.     CConfigDlg(CWnd* pParent = NULL);   // standard constructor
  58.  
  59. // Dialog Data
  60.     //{{AFX_DATA(CConfigDlg)
  61.     enum { IDD = IDD_DIALOG1 };
  62.     BOOL    m_enabled;
  63.     BOOL    m_sync_errbuf;
  64.     BOOL    m_close_ds_doc;
  65.     BOOL    m_cd_doc_dir;
  66.     BOOL    m_write_buffers;
  67.     //}}AFX_DATA
  68.  
  69.  
  70. // Overrides
  71.     // ClassWizard generated virtual function overrides
  72.     //{{AFX_VIRTUAL(CConfigDlg)
  73.     protected:
  74.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  75.     //}}AFX_VIRTUAL
  76.  
  77. // Implementation
  78. protected:
  79.     void update_dlg_control_states(bool dialog_up);
  80.     void update_dlg_control(int ctrl_id, bool dialog_up);
  81.  
  82.     // Generated message map functions
  83.     //{{AFX_MSG(CConfigDlg)
  84.     afx_msg void OnEnabled();
  85.     //}}AFX_MSG
  86.     DECLARE_MESSAGE_MAP()
  87. };
  88.  
  89.  
  90. // *************************** Generic externs **********************
  91.  
  92. extern VISVILE_OPTS visvile_opts;
  93.  
  94. extern void         oleauto_exit(void);
  95. extern HRESULT      oleauto_init(void);
  96. extern CVile        *pVile;
  97. extern HRESULT      ReportLastError(HRESULT err);
  98. extern void         visvile_regdata_dirty(void);
  99.  
  100. #endif
  101.