home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / WCONSOLE.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  4KB  |  169 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. #ifndef _WCONSOLE_HPP_INCLUDED
  12. #define _WCONSOLE_HPP_INCLUDED
  13.  
  14. #ifndef _WNO_PRAGMA_PUSH
  15. #pragma pack(push,8);
  16. #pragma enum int;
  17. #endif
  18.  
  19. #include <conio.h>
  20. #include <stdio.h>
  21.  
  22. #include "wdef.hpp"
  23.  
  24. #ifndef _WOBJECT_HPP_INCLUDED
  25. #include "wobject.hpp"
  26. #endif
  27. #ifndef _WCOLOR_HPP_INCLUDED
  28. #include "wcolor.hpp"
  29. #endif
  30. #ifndef _WSTRING_HPP_INCLUDED
  31. #include "wstring.hpp"
  32. #endif
  33.  
  34.  
  35. class WCMCLASS WConsole : public WObject {
  36.     WDeclareSubclass( WConsole, WObject );
  37.  
  38.     public:
  39.  
  40.         /**********************************************************
  41.          * Constructors and Destructors
  42.          *********************************************************/
  43.         
  44.         WConsole();
  45.  
  46.         ~WConsole();
  47.  
  48.         /**********************************************************
  49.          * Properties
  50.          *********************************************************/
  51.  
  52.         // BackColor
  53.  
  54.         virtual WBool SetBackColor( const WColor & color );
  55.         virtual WColor GetBackColor();
  56.  
  57.         // CodePage
  58.  
  59.         WBool SetCodePage( WUInt codePage );
  60.         WUInt GetCodePage();
  61.  
  62.         // Columns
  63.  
  64.         WBool SetColumnCount( WUShort columns );
  65.         WUShort GetColumnCount();
  66.  
  67.         // CursorPosition
  68.  
  69.         WBool SetCursorPosition( const WPoint & position );
  70.         WPoint GetCursorPosition();
  71.  
  72.         // CursorSize
  73.  
  74.         WBool SetCursorSize( WUShort size );
  75.         WUShort GetCursorSize();
  76.  
  77.         // CursorVisible
  78.  
  79.         WBool SetCursorVisible( WBool visible );
  80.         WBool GetCursorVisible();
  81.  
  82.         // EchoInput
  83.  
  84.         WBool SetEchoInput( WBool onOff );
  85.         WBool GetEchoInput();
  86.  
  87.         // ForeColor
  88.  
  89.         virtual WBool SetForeColor( const WColor & color );
  90.         virtual WColor GetForeColor();
  91.  
  92.         // LineInput
  93.  
  94.         WBool SetLineInput( WBool onOff );
  95.         WBool GetLineInput();
  96.  
  97.         // MaximumColumns
  98.  
  99.         WUShort GetMaximumColumns();
  100.  
  101.         // MaximumRows
  102.  
  103.         WUShort GetMaximumRows();
  104.  
  105.         // Rows
  106.  
  107.         WBool SetRowCount( WUShort rows );
  108.         WUShort GetRowCount();
  109.  
  110.         // Text
  111.  
  112.         virtual WBool SetText( const WString & str );
  113.         virtual WString GetText();
  114.  
  115.         /**********************************************************
  116.          * Methods
  117.          *********************************************************/
  118.  
  119.         // Create
  120.  
  121.         WBool Create();
  122.  
  123.         // Clear
  124.  
  125.         WBool Clear();
  126.  
  127.         // Destroy
  128.  
  129.         virtual WBool Destroy();
  130.  
  131.         // Flush
  132.  
  133.         WBool Flush();
  134.  
  135.         // Read
  136.  
  137.         WBool Read( WString & buffer );
  138.  
  139.         // RedirectSTDIO
  140.  
  141.         WBool RedirectSTDIO( WBool onOff );
  142.  
  143.         // Write
  144.  
  145.         WBool Write( const WString & buffer );
  146.         
  147.         /**********************************************************
  148.          * Data
  149.          *********************************************************/
  150.          
  151.     private:
  152.         WColor          _backColor;
  153.         WULong          _foreColorAttr;
  154.         WColor          _foreColor;
  155.         WULong          _backColorAttr;
  156.         WBool           _IORedirected;
  157.         FILE            _oldSTDIn;
  158.         FILE            _oldSTDOut;
  159.         FILE            _oldSTDErr;
  160. };
  161.  
  162.  
  163. #ifndef _WNO_PRAGMA_PUSH
  164. #pragma enum pop;
  165. #pragma pack(pop);
  166. #endif
  167.  
  168. #endif // _WCONSOLE_HPP_INCLUDED
  169.