OpendTect-6_4  6.4
cmdrecorder.h
Go to the documentation of this file.
1 #ifndef cmdrecorder_h
2 #define cmdrecorder_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Jaap Glas
9  Date: March 2009
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uicmddrivermod.h"
16 #include "callback.h"
17 #include "separstr.h"
18 #include "od_ostream.h"
19 
20 #include "cmddriverbasics.h"
21 
22 class uiMenu;
23 class StreamData;
24 class uiMainWin;
25 class uiAction;
26 
27 
28 namespace CmdDrive
29 {
30 
31 #define mRecOutStrm \
32  if ( !rec_.mustSkip() ) rec_.outputStrm()
33 
34 
35 mExpClass(uiCmdDriver) CmdRecEvent
36 {
37 public:
39  : begin_(true), refnr_(0) , srcwin_(0)
40  , openqdlg_(false), stolen_(false)
41  , object_(0), similarobjs_(true), mnuitm_(0)
42  , dynamicpopup_(false), casedep_(false)
43  , nraccepts_(0)
44  {}
45 
47  bool begin_;
48  int refnr_;
50 
52  bool openqdlg_;
54  bool stolen_;
55 
59  uiAction* mnuitm_;
62  bool casedep_;
64 
66 };
67 
68 
69 class CmdComposer;
70 
71 mExpClass(uiCmdDriver) CmdRecorder : public CallBacker
72 {
73 public:
74  friend class CmdComposer;
75 
76  CmdRecorder(const uiMainWin& applwin);
77  ~CmdRecorder();
78 
79  void setOutputFile(const char* fnm) { outputfnm_ = fnm; }
80  void setBufferSize(int sz) { bufsize_ = sz; }
81  void writeTailOnly(bool yn) { writetailonly_ = yn; }
82  void ignoreCmdDriverWindows(bool);
83 
84  od_ostream& outputStrm() const;
85  bool mustSkip() const;
86 
87  bool start();
88  void stop(bool fatal=false);
89 
90  bool isRecording() const { return recording_; }
91 
92  void updateCmdComposers();
93 
94 protected:
95 
96  void handleEvent(CallBacker*);
97  void dynamicMenuInterceptor(CallBacker*);
98 
99  void insertWinAssertion(const CmdRecEvent&);
100  bool findKeyString(const uiMainWin&,CmdRecEvent&);
101 
102  void flush();
103 
104  const uiMainWin* applWin() const { return applwin_; }
106 
114 
117 
120 
121  const CallBacker* lastobjsearched_;
123 
125 
129  int bufsize_;
131  mutable int outputcounter_;
132 };
133 
134 
135 }; // namespace CmdDrive
136 
137 
138 #endif
TypeSet< int > popuprefnrs_
Definition: cmdrecorder.h:116
#define mExpClass(module)
Definition: commondefs.h:160
User interface main window.
Definition: uimainwin.h:36
int nraccepts_
Definition: cmdrecorder.h:65
const uiMainWin * srcwin_
Definition: cmdrecorder.h:51
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:26
CmdRecorder & rec_
Definition: cmdrecorder.h:107
BufferString bufstr_
Definition: cmdrecorder.h:128
bool openqdlg_
Definition: cmdrecorder.h:52
Command Drive
Definition: canvascommands.h:22
uiMenu * dynamicpopupmenu_
Definition: cmdrecorder.h:111
bool begin_
Definition: cmdrecorder.h:47
BufferString keystr_
Definition: cmdrecorder.h:58
int nrparskipped_
Definition: cmdrecorder.h:130
int outputcounter_
Definition: cmdrecorder.h:131
uiAction * mnuitm_
Definition: cmdrecorder.h:59
BufferString idstr_
Definition: cmdrecorder.h:46
void writeTailOnly(bool yn)
Definition: cmdrecorder.h:81
bool similarobjs_
Definition: cmdrecorder.h:57
Definition: cmdrecorder.h:71
void setOutputFile(const char *fnm)
Definition: cmdrecorder.h:79
od_ostrstream & bufstream_
Definition: cmdrecorder.h:127
bool openqdialog_
Definition: cmdrecorder.h:118
bool stolen_
Definition: cmdrecorder.h:54
OD class for stream write into string.
Definition: od_strstream.h:36
bool writetailonly_
Definition: cmdrecorder.h:126
Definition: cmdrecorder.h:35
ObjectSet< const uiMainWin > lastobjfreewins_
Definition: cmdrecorder.h:122
void setBufferSize(int sz)
Definition: cmdrecorder.h:80
Holds data to use and close an iostream.
Definition: strmdata.h:28
BufferString winassertion_
Definition: cmdrecorder.h:112
bool winassertcasedep_
Definition: cmdrecorder.h:113
Definition: cmdcomposer.h:52
Definition: uimenu.h:65
bool casedep_
Definition: cmdrecorder.h:62
const uiMainWin * applWin() const
Definition: cmdrecorder.h:104
bool recording_
Definition: cmdrecorder.h:108
WindowStack winstack_
Definition: cmdrecorder.h:115
int refnr_
Definition: cmdrecorder.h:48
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
BufferString outputfnm_
Definition: cmdrecorder.h:109
CmdRecEvent()
Definition: cmdrecorder.h:38
BufferString msg_
Definition: cmdrecorder.h:49
bool dynamicpopup_
Definition: cmdrecorder.h:60
int bufsize_
Definition: cmdrecorder.h:129
const uiMainWin * applwin_
Definition: cmdrecorder.h:105
Definition: cmddriverbasics.h:178
const CallBacker * lastobjsearched_
Definition: cmdrecorder.h:121
BufferString qdlgtitle_
Definition: cmdrecorder.h:53
bool ignorecmddriverwindows_
Definition: cmdrecorder.h:119
BufferString menupath_
Definition: cmdrecorder.h:61
od_ostream & outputstrm_
Definition: cmdrecorder.h:110
BufferString execprefix_
Definition: cmdrecorder.h:63
CallBacker * object_
Definition: cmdrecorder.h:56
ObjectSet< CmdComposer > composers_
Definition: cmdrecorder.h:124
bool isRecording() const
Definition: cmdrecorder.h:90

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019