libyui  3.4.2
YMacroRecorder.h
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: YMacroRecorder.h
20 
21  Author: Stefan Hundhammer <sh@suse.de>
22 
23 /-*/
24 
25 #ifndef YMacroRecorder_h
26 #define YMacroRecorder_h
27 
28 #include <string>
29 
30 class YWidget;
31 
32 
33 /**
34  * Abstract base class for macro recorders.
35  *
36  * Applications should not use this directly, but the static methods in YMacro.
37  **/
39 {
40  friend class YMacro;
41 
42 protected:
43 
44  /**
45  * Constructor
46  **/
48 
49 public:
50  /**
51  * Destructor
52  **/
53  virtual ~YMacroRecorder() {}
54 
55  /**
56  * Start recording a macro to the specified file.
57  **/
58  virtual void record( const std::string & macroFileName ) = 0;
59 
60  /**
61  * End recording and close the current macro file (if there is any).
62  **/
63  virtual void endRecording() = 0;
64 
65  /**
66  * Return 'true' if a macro is currently being recorded.
67  **/
68  virtual bool recording() const = 0;
69 
70  /**
71  * Record one widget property.
72  **/
73  virtual void recordWidgetProperty( YWidget * widget,
74  const char * propertyName ) = 0;
75 
76  /**
77  * Record a "UI::MakeScreenShot()" statement.
78  *
79  * If 'enabled' is 'false', this statement will be commented out.
80  * If no file name is given, a default file name (with auto-increment) will
81  * be used.
82  **/
83  virtual void recordMakeScreenShot( bool enabled = false,
84  const std::string & filename = std::string() ) = 0;
85 };
86 
87 #endif // YMacroRecorder_h
Abstract base class for macro recorders.
virtual void record(const std::string &macroFileName)=0
Start recording a macro to the specified file.
YMacroRecorder()
Constructor.
virtual void endRecording()=0
End recording and close the current macro file (if there is any).
virtual ~YMacroRecorder()
Destructor.
virtual void recordMakeScreenShot(bool enabled=false, const std::string &filename=std::string())=0
Record a "UI::MakeScreenShot()" statement.
virtual void recordWidgetProperty(YWidget *widget, const char *propertyName)=0
Record one widget property.
Simple access to macro recording and playing.
Definition: YMacro.h:44
virtual bool recording() const =0
Return &#39;true&#39; if a macro is currently being recorded.
Abstract base class of all UI widgets.
Definition: YWidget.h:54