3 #include "Common/wincommon.h"
4 #include "../DasherCore/DashIntfScreenMsgs.h"
5 #include "../DasherCore/UserLog.h"
14 extern CONST UINT WM_DASHER_FOCUS
;
21 class CWinFileUtils
:public CFileUtils
{
23 virtual int GetFileSize(const std::string
&strFileName
) override
;
24 virtual void ScanFiles(AbstractParser
*parser
, const std::string
&strPattern
) override
;
25 bool WriteUserDataFile(const std::string
&filename
, const std::string
&strNewText
, bool append
) override
;
27 void ScanDirectory(const std::string
&strMask
, std::vector
<std::string
> &vFileList
);
28 // Returns location where program data is stored.
29 // When user is false, result is system data location.
30 // When user is true, result is user data data location.
31 virtual std::string
GetDataPath(bool user
);
35 class CDasher
: public CDashIntfScreenMsgs
38 CDasher(HWND Parent
, CDasherWindow
*pWindow
, CEdit
*pEdit
, Dasher::CSettingsStore
* settings
, CFileUtils
* fileUtils
);
41 // The following functions will not be part of the final interface
42 // In order to get rid of this, it'll be necessary to make this class
43 // act more like a UI widget.
45 //CCanvas *GetCanvas() {
49 // TODO: Can some of these be obtained by inheriting from something?
50 void Move(int iX
, int iY
, int iWidth
, int iHeight
);
53 void HandleEvent(int iParameter
) override
;
54 void editOutput(const std::string
&strText
, CDasherNode
*pSource
) override
;
55 void editDelete(const std::string
&strText
, CDasherNode
*pSource
) override
;
56 unsigned int ctrlOffsetAfterMove(unsigned int offsetBefore
, bool bForwards
, CControlManager::EditDistance iDist
) override
;
57 unsigned int ctrlMove(bool bForwards
, CControlManager::EditDistance iDist
) override
;
58 unsigned int ctrlDelete(bool bForwards
, CControlManager::EditDistance iDist
) override
;
62 virtual std::string
GetAllContext() override
;
63 std::string
GetContext(unsigned int iStart
, unsigned int iLength
) override
;
64 int GetAllContextLenght() override
;
65 std::string
GetTextAroundCursor(CControlManager::EditDistance iDist
) override
;
68 bool SupportsSpeech() override
;
69 void Speak(const std::string
&text
, bool bInterrupt
) override
;
71 bool SupportsClipboard() override
{ return true; };
72 void CopyToClipboard(const std::string
&text
) override
;
75 virtual void CreateModules() override
;
77 void ScanDirectory(const Tstring
&strMask
, std::vector
<std::string
> &vFileList
);
78 bool GetWindowSize(int* pTop
, int* pLeft
, int* pBottom
, int* pRight
);
79 void Log(); // Does the logging
83 CDasherWindow
*m_pWindow
;
86 ISpVoice
* getVoice(const string
& lang
);
87 CComPtr
<ISpVoice
> m_pDefaultVoice
;
88 bool m_bAttemptedSpeech
;
89 map
<string
, CComPtr
<ISpVoice
> > m_voicesByLangCode
;