|
#include "stdafx.h"
#include "vvengine.h"
/////////////////////////////////////////////////////////////////////////////
// CVVEngine properties
/////////////////////////////////////////////////////////////////////////////
// CVVEngine operations
void CVVEngine::AboutBox()
{
InvokeHelper(0xfffffdd8, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
void CVVEngine::Connect()
{
InvokeHelper(0x1, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
BOOL CVVEngine::CanConnect()
{
BOOL result;
InvokeHelper(0x2, DISPATCH_METHOD, VT_BOOL, (void*)&result, NULL);
return result;
}
void CVVEngine::Disconnect()
{
InvokeHelper(0x3, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
void CVVEngine::ClearAllProperties()
{
InvokeHelper(0x4, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
void CVVEngine::ResetAllProperties()
{
InvokeHelper(0x5, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
long CVVEngine::GetAudioState()
{
long result;
InvokeHelper(0x6, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void CVVEngine::SetAudioState(long nNewValue)
{
static BYTE parms[] =
VTS_I4;
InvokeHelper(0x6, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
nNewValue);
}
BOOL CVVEngine::GetEventsEnabled(long Events)
{
BOOL result;
static BYTE parms[] =
VTS_I4;
InvokeHelper(0x7, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, parms,
Events);
return result;
}
void CVVEngine::SetEventsEnabled(long Events, BOOL bNewValue)
{
static BYTE parms[] =
VTS_I4 VTS_BOOL;
InvokeHelper(0x7, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
Events, bNewValue);
}
BOOL CVVEngine::GetAutoUI()
{
BOOL result;
InvokeHelper(0x8, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
void CVVEngine::SetAutoUI(BOOL bNewValue)
{
static BYTE parms[] =
VTS_BOOL;
InvokeHelper(0x8, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
bNewValue);
}
BOOL CVVEngine::GetAutoConnect()
{
BOOL result;
InvokeHelper(0x9, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
void CVVEngine::SetAutoConnect(BOOL bNewValue)
{
static BYTE parms[] =
VTS_BOOL;
InvokeHelper(0x9, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
bNewValue);
}
BOOL CVVEngine::GetIsConnected()
{
BOOL result;
InvokeHelper(0xa, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
BOOL CVVEngine::GetAutoStartAudio()
{
BOOL result;
InvokeHelper(0xb, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
void CVVEngine::SetAutoStartAudio(BOOL bNewValue)
{
static BYTE parms[] =
VTS_BOOL;
InvokeHelper(0xb, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
bNewValue);
}
LPUNKNOWN CVVEngine::GetISRCentral()
{
LPUNKNOWN result;
InvokeHelper(0xc, DISPATCH_METHOD, VT_UNKNOWN, (void*)&result, NULL);
return result;
}
LPUNKNOWN CVVEngine::GetISRListen()
{
LPUNKNOWN result;
InvokeHelper(0xd, DISPATCH_METHOD, VT_UNKNOWN, (void*)&result, NULL);
return result;
}
long CVVEngine::GetAudioSourceType()
{
long result;
InvokeHelper(0xe, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void CVVEngine::SetAudioSourceType(long nNewValue)
{
static BYTE parms[] =
VTS_I4;
InvokeHelper(0xe, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
nNewValue);
}
CString CVVEngine::GetEngineID()
{
CString result;
InvokeHelper(0xf, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
return result;
}
CString CVVEngine::GetMfgName()
{
CString result;
InvokeHelper(0x10, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
return result;
}
CString CVVEngine::GetProdName()
{
CString result;
InvokeHelper(0x11, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
return result;
}
CString CVVEngine::GetModeID()
{
CString result;
InvokeHelper(0x12, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
return result;
}
CString CVVEngine::GetModeName()
{
CString result;
InvokeHelper(0x13, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
return result;
}
CString CVVEngine::GetDialect()
{
CString result;
InvokeHelper(0x14, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
return result;
}
long CVVEngine::GetLanguageID()
{
long result;
InvokeHelper(0x15, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
long CVVEngine::GetMaxWordsVocab()
{
long result;
InvokeHelper(0x16, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
long CVVEngine::GetMaxWordsState()
{
long result;
InvokeHelper(0x17, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
BOOL CVVEngine::GetNeedsCFG()
{
BOOL result;
InvokeHelper(0x18, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
BOOL CVVEngine::GetNeedsDictation()
{
BOOL result;
InvokeHelper(0x19, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
BOOL CVVEngine::GetNeedsLD()
{
BOOL result;
InvokeHelper(0x1a, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
BOOL CVVEngine::GetUseSharedEngine()
{
BOOL result;
InvokeHelper(0x1b, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
long CVVEngine::GetSpeakingStyle()
{
long result;
InvokeHelper(0x1f, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void CVVEngine::SetSpeakingStyle(long nNewValue)
{
static BYTE parms[] =
VTS_I4;
InvokeHelper(0x1f, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
nNewValue);
}
CString CVVEngine::GetSubject()
{
CString result;
InvokeHelper(0x20, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
return result;
}
#include "stdafx.h"
#include "vvmdoc.h"
#include "vvmdocDoc.h"
#include "vvmdocView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CVvmdocView
IMPLEMENT_DYNCREATE(CVvmdocView, CView)
BEGIN_MESSAGE_MAP(CVvmdocView, CView)
//{{AFX_MSG_MAP(CVvmdocView)
ON_COMMAND(IDM_BEGINDICTATION, OnBegindictation)
ON_COMMAND(IDM_STOPDICTATION, OnStopdictation)
ON_WM_SETFOCUS()
ON_WM_SIZE()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CVvmdocView construction/destruction
CVvmdocView::CVvmdocView()
{
// TODO: add construction code here
}
CVvmdocView::~CVvmdocView()
{
}
BOOL CVvmdocView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CVvmdocView drawing
void CVvmdocView::OnDraw(CDC* pDC)
{
CVvmdocDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CVvmdocView printing
BOOL CVvmdocView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CVvmdocView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CVvmdocView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CVvmdocView diagnostics
#ifdef _DEBUG
void CVvmdocView::AssertValid() const
{
CView::AssertValid();
}
void CVvmdocView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CVvmdocDoc* CVvmdocView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CVvmdocDoc)));
return (CVvmdocDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CVvmdocView message handlers
void CVvmdocView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
if ( ::IsWindow(m_vvtextbox) )
m_vvtextbox.MoveWindow(0, 0, cx, cy);
}
void CVvmdocView::OnInitialUpdate()
{
BOOL rc = FALSE;
WINDOWPLACEMENT wp;
CView::OnInitialUpdate();
GetWindowPlacement( &wp );
wp.rcNormalPosition.right -= 4;
wp.rcNormalPosition.bottom -= 4;
rc = m_vvtextbox.CreateControl("ViaVoice.VVTextBox",
NULL,
WS_VISIBLE,
wp.rcNormalPosition,
this,
IDC_VVTEXTBOX1);
if ( rc == FALSE )
AfxMessageBox("Create TextBox failed");
else
{
m_vvtextbox.Init();
m_vvtextbox.SetAutoUI( TRUE );
m_vvtextbox.SetAutoDictation( FALSE );
m_vvtextbox.SetMultiline( TRUE );
}
}
BEGIN_EVENTSINK_MAP(CVvmdocView, CView)
//{{AFX_EVENTSINK_MAP(CVvmdocView)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, 1 /* Change */, OnChangeVvtextbox1, VTS_NONE)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, -600 /* Click */, OnClickVvtextbox1, VTS_PI2 VTS_PBOOL)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, -601 /* DblClick */, OnDblClickVvtextbox1, VTS_PI2 VTS_PBOOL)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, -602 /* KeyDown */, OnKeyDownVvtextbox1, VTS_PI2 VTS_PI2)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, -603 /* KeyPress */, OnKeyPressVvtextbox1, VTS_PI2)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, -604 /* KeyUp */, OnKeyUpVvtextbox1, VTS_PI2 VTS_PI2)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, -605 /* MouseDown */, OnMouseDownVvtextbox1, VTS_PI2 VTS_PI2 VTS_PR4 VTS_PR4)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, -607 /* MouseUp */, OnMouseUpVvtextbox1, VTS_PI2 VTS_PI2 VTS_PR4 VTS_PR4)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, -606 /* MouseMove */, OnMouseMoveVvtextbox1, VTS_PI2 VTS_PI2 VTS_PR4 VTS_PR4)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, 10 /* DictationStateChange */, OnDictationStateChangeVvtextbox1, VTS_BOOL)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, 11 /* MicStateChange */, OnMicStateChangeVvtextbox1, VTS_BOOL)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, 15 /* VuMeter */, OnVuMeterVvtextbox1, VTS_PI2)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, 16 /* MaxText */, OnMaxTextVvtextbox1, VTS_NONE)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, 17 /* Command */, OnCommandVvtextbox1, VTS_I4 VTS_BSTR)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, 18 /* TextRecod */, OnTextRecodVvtextbox1, VTS_BSTR)
ON_EVENT(CVvmdocView, IDC_VVTEXTBOX1, -608 /* Error */, OnErrorVvtextbox1, VTS_I2 VTS_PBSTR VTS_PI4 VTS_PBSTR VTS_PBSTR VTS_PI4 VTS_PBOOL)
//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()
void CVvmdocView::OnChangeVvtextbox1()
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnClickVvtextbox1(short FAR* Button, BOOL FAR* bCancel)
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnDblClickVvtextbox1(short FAR* Button, BOOL FAR* bCancel)
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnKeyDownVvtextbox1(short FAR* KeyCode, short FAR* Shift)
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnKeyPressVvtextbox1(short FAR* KeyAscii)
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnKeyUpVvtextbox1(short FAR* KeyCode, short FAR* Shift)
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnMouseDownVvtextbox1(short FAR* Button, short FAR* Shift, float FAR* X, float FAR* Y)
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnMouseUpVvtextbox1(short FAR* Button, short FAR* Shift, float FAR* X, float FAR* Y)
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnMouseMoveVvtextbox1(short FAR* Button, short FAR* Shift, float FAR* X, float FAR* Y)
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnDictationStateChangeVvtextbox1(BOOL DictationOn)
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnMicStateChangeVvtextbox1(BOOL bMicOn)
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnVuMeterVvtextbox1(short FAR* sLevel)
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnMaxTextVvtextbox1()
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnCommandVvtextbox1(long CmdID, LPCTSTR strCommand)
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnTextRecodVvtextbox1(LPCTSTR strText)
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnErrorVvtextbox1(short sErrorID, BSTR FAR* pstrDescription, long FAR* hresult, BSTR FAR* strSource, BSTR FAR* strHelp, long FAR* lHelpID, BOOL FAR* bShow)
{
// TODO: Add your control notification handler code here
}
void CVvmdocView::OnBegindictation()
{
m_vvtextbox.SetDictationOn( TRUE );
}
void CVvmdocView::OnStopdictation()
{
m_vvtextbox.SetDictationOn( FALSE );
}
void CVvmdocView::OnSetFocus(CWnd* pOldWnd)
{
CView::OnSetFocus(pOldWnd);
m_vvtextbox.SetFocus();
} |
|