/*
 *
 *
 *    serialios.h
 *
 *    Header file for 'serialios' class, describing a UNIX-style serial port
 *    device IOS object.
 *
 *    =========================================================================
 *    
 *    Copyright (C) 1999-2003 by Matt Roberts, KK5JY.
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation; either
 *    version 2.1 of the License, or (at your option) any later version.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *    =========================================================================
 *
 *     
 */


#ifndef __SERIALIOS_H
	#define __SERIALIOS_H

	#include <my++/termios.h>

	namespace my {

		/*
		 *
		 *   class serialios
		 *
		 */

		class serialios : public my::termios {
			protected:
				void init (void);

			public: // public types
				enum parity_values {
					no_parity,
					odd_parity,
					even_parity,
					mark_parity,
					space_parity
				};

			public: // public [cd]tors
				serialios (void) { init(); };
				serialios (const ::termios &t) : my::termios(t) { init(); };
				serialios (const my::termios &t) : my::termios(t) { init(); };
				serialios (const my::serialios &t) : my::termios((my::serialios&)(t)) { init(); };
				~serialios (void) { /* noop */ };

			public: // public interface
				bool setParity (parity_values p);
				bool setParity (char c);
				bool setStopBits (int i);
				bool setCharSize (int i);
				bool setSpeed (int i);
				bool setHWflow (bool i);
				bool setSWflow (bool i);
				bool setLocal (bool i);

				bool getParity (parity_values &p);
				bool getParity (char &c);
				bool getStopBits (int &i);
				bool getCharSize (int &i);
				bool getSpeed (int &i);
				bool getHWflow (bool &i);
				bool getSWflow (bool &i);
				bool getLocal (bool &i);

				parity_values getParity (void);
				int getStopBits (void);
				int getCharSize (void);
				int getSpeed (void);
				bool getHWflow (void);
				bool getSWflow (void);
				bool getLocal (void);

		};
	}

#endif
