Updated German translation
[dasher.git] / Src / DasherCore / UserLogBase.h
blob4cbfe65ccaf4022c31cb8c6ce7d446e9fcf8e049
1 #ifndef __UserLogBase_h__
2 #define __UserLogBase_h__
4 #include "DasherTypes.h"
5 #include "UserLogTrial.h" // Don't want to include this, but needed for event type enum
6 #include "Observable.h"
7 #include "Event.h"
8 #include "SettingsStore.h"
10 #include <string>
11 #include <vector>
13 namespace Dasher {
14 class CDasherInterfaceBase;
17 /// \defgroup Logging Logging routines
18 /// @{
19 class CUserLogBase : protected TransientObserver<const Dasher::CEditEvent *> {
20 public:
21 CUserLogBase(Observable<const Dasher::CEditEvent*> *pHandler);
23 virtual void AddParam(const std::string& strName, const std::string& strValue, int iOptionMask = 0) = 0;
24 virtual void AddParam(const std::string& strName, double dValue, int iOptionMask = 0) = 0;
25 virtual void AddParam(const std::string& strName, int iValue, int iOptionMask = 0) = 0;
26 //Called when the user starts moving. Note this happens for _each_ click/zoom
27 // in Click Mode, Direct Mode, Menu Mode etc. (so should ignore extra calls
28 // after the first.)
29 virtual void StartWriting() = 0;
30 virtual void StopWriting(float dNats) = 0;
31 virtual void StopWriting() = 0;
32 virtual void NewTrial() = 0;
33 virtual void AddWindowSize(int iTop, int iLeft, int iBottom, int iRight) = 0;
34 virtual void AddCanvasSize(int iTop, int iLeft, int iBottom, int iRight) = 0;
35 virtual void AddMouseLocation(int iX, int iY, float dNats) = 0;
36 virtual void AddMouseLocationNormalized(int iX, int iY, bool bStoreIntegerRep, float dNats) = 0;
37 virtual void OutputFile() = 0;
38 virtual void InitIsDone() = 0;
39 virtual void SetOuputFilename(const std::string& strFilename = "") = 0;
40 virtual int GetLogLevelMask() = 0;
41 virtual void KeyDown(int iId, int iType, int iEffect) = 0;
42 ///Watches output events to record symbols added/deleted
43 virtual void HandleEvent(const Dasher::CEditEvent *pEvent);
44 ///Passes record of symbols added/deleted to AddSymbols/DeleteSymbols
45 void FrameEnded();
46 protected:
47 virtual void AddSymbols(Dasher::VECTOR_SYMBOL_PROB* pVectorNewSymbolProbs, eUserLogEventType iEvent = userLogEventMouse) = 0;
48 virtual void DeleteSymbols(int iNumToDelete, eUserLogEventType iEvent = userLogEventMouse) = 0;
49 private:
50 std::vector<Dasher::SymbolProb> m_vAdded;
51 int m_iNumDeleted;
53 /// @}
55 #endif