libyui  3.0.10
/usr/src/RPM/BUILD/libyui-3.0.10/src/YMacro.cc
00001 /*
00002   Copyright (C) 2000-2012 Novell, Inc
00003   This library is free software; you can redistribute it and/or modify
00004   it under the terms of the GNU Lesser General Public License as
00005   published by the Free Software Foundation; either version 2.1 of the
00006   License, or (at your option) version 3.0 of the License. This library
00007   is distributed in the hope that it will be useful, but WITHOUT ANY
00008   WARRANTY; without even the implied warranty of MERCHANTABILITY or 
00009   FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
00010   License for more details. You should have received a copy of the GNU
00011   Lesser General Public License along with this library; if not, write
00012   to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
00013   Floor, Boston, MA 02110-1301 USA
00014 */
00015 
00016 
00017 /*-/
00018 
00019   File:         YMacro.cc
00020 
00021   Author:       Stefan Hundhammer <sh@suse.de>
00022 
00023 /-*/
00024 
00025 
00026 #include "YMacro.h"
00027 #include "YMacroRecorder.h"
00028 #include "YMacroPlayer.h"
00029 
00030 
00031 YMacroRecorder * YMacro::_recorder = 0;
00032 YMacroPlayer   * YMacro::_player   = 0;
00033 
00034 void YMacro::setRecorder( YMacroRecorder * recorder )
00035 {
00036     if ( _recorder )
00037         delete _recorder;
00038 
00039     _recorder = recorder;
00040 }
00041 
00042 
00043 void YMacro::setPlayer( YMacroPlayer * player )
00044 {
00045     if ( _player )
00046         delete _player;
00047 
00048     _player = player;
00049 }
00050 
00051 
00052 void YMacro::record( const std::string & macroFile )
00053 {
00054     if ( _recorder )
00055         _recorder->record( macroFile );
00056 }
00057 
00058 
00059 void YMacro::endRecording()
00060 {
00061     if ( _recorder )
00062         _recorder->endRecording();
00063 }
00064 
00065 
00066 bool YMacro::recording()
00067 {
00068     if ( _recorder )
00069         return _recorder->recording();
00070     else
00071         return false;
00072 }
00073 
00074 
00075 void YMacro::play( const std::string & macroFile )
00076 {
00077     if ( _player )
00078         _player->play( macroFile );
00079 }
00080 
00081 
00082 void YMacro::playNextBlock()
00083 {
00084     if ( _player && _player->playing() )
00085         _player->playNextBlock();
00086 }
00087 
00088 
00089 bool YMacro::playing()
00090 {
00091     if ( _player )
00092         return _player->playing();
00093     else
00094         return false;
00095 }
00096 
00097 
00098 void YMacro::deleteRecorder()
00099 {
00100     if ( _recorder )
00101         delete _recorder;
00102 }
00103 
00104 
00105 void YMacro::deletePlayer()
00106 {
00107     if ( _player )
00108         delete _player;
00109 }
 All Classes Functions Variables Enumerations Friends