home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / listpm2.zip / source / list.hpp < prev    next >
C/C++ Source or Header  |  1996-07-08  |  5KB  |  130 lines

  1. /*
  2.     listPM list files under Presentation Manager. Uses Open Class Libarary.
  3.     Copyright (C) 1996  Paul Elliott
  4.  
  5.     This program is free software; you can redistribute it and/or modify
  6.     it under the terms of the GNU General Public License as published by
  7.     the Free Software Foundation; either version 2 of the License, or
  8.     (at your option) any later version.
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19.     Paul Elliott
  20.     3987 South Gessner #224
  21.     Houston Tx 77063
  22.     Paul.Elliott@Hrnowl.LoneStar.Org
  23. */
  24. #ifndef LIST
  25. #define LIST
  26.  
  27. #include "listrun.hpp"         // parameters of the interface with our caller,
  28.                                // listmain.
  29. #include "search.hpp"          // search dialog.
  30.  
  31.  
  32.                                // all open class libarary needed include files.
  33. #include <ithread.hpp>         // uses threads.
  34. #include <iframe.hpp>          // frame window
  35. #include <icmdhdr.hpp>         // command handler
  36. #include <iclipbrd.hpp>        // clipboard.
  37. #include <imle.hpp>            // multiline edit.
  38. #include <imsgbox.hpp>         // message box.
  39. #include <iexcbase.hpp>        // exceptions.
  40. #include <iinfoa.hpp>          // info area.
  41. #include <iaccel.hpp>          // keyboard accelerator.
  42. #include <ifiledlg.hpp>        // file dialog.
  43. #include <ifilehdr.hpp>        // file dialog handler.
  44. #include <imenuhdr.hpp>        // menu handler.
  45. #include <isubmenu.hpp>        // submenus.
  46. #include <ititle.hpp>          // title bar.
  47. #include <ifont.hpp>           // font
  48. #include <ifontdlg.hpp>        // font dialog.
  49. #include <isizehdr.hpp>        // Resize handler.
  50. #include <isizeevt.hpp>        // resize events.
  51. #include <ihelp.hpp>           // help Window.
  52. #include <ihelphdr.hpp>        // help window handler.
  53.  
  54. #include <stdlib.h>            // define calls to C libarary
  55. #include <io.h>
  56.  
  57. /*
  58.  * This program is not an object oriented program,
  59.  * but a procedural one. Inheritance is used only as required to
  60.  * define callbacks required by the interface to open class libaray.
  61.  *
  62.  * This program displays a window in which the listing of a file can be displayed.
  63.  * the user can switch displayed files, display a new file in a new window
  64.  * on another thread, control word wrap, and cut selected text to the system
  65.  * clippboard.
  66.  */
  67.  
  68. // Define the main frame window for the program.
  69. // It has attacthed almost all control and call back structures attached.
  70. class ListFrame : public IFrameWindow ,
  71.                   // following protected handlers define call backs
  72.                   // required by Open class library.
  73.  
  74.                   protected ICommandHandler,
  75.                   protected IMenuHandler,
  76.                   protected IResizeHandler,
  77.                   protected IHelpHandler
  78. {
  79.    private:
  80.  
  81.       IString file_displayed;            // remember file we are dispalying
  82.  
  83.       IInfoArea   info;                  // info area status block
  84.  
  85.       IMultiLineEdit mle;                // multiline editor cleint window.
  86.  
  87.       IAccelerator acc;                   // key board accelerator,
  88.                                           // works with menu
  89.                                           // resources defined by URE.
  90.  
  91.       ITitle title;                       // Title for our window.
  92.  
  93.       IHelpWindow  help;                  // is there help for us?
  94.  
  95.  
  96.       SearchInfo         search_dialog;   // dialog to get search information.
  97.  
  98.    public:
  99.  
  100.  
  101.       // return currently  displayed file.
  102.       IString file(void) const { return file_displayed; };
  103.  
  104.       ListFrame(const IString file);      // construct ourselves from filename.
  105.  
  106.    protected:
  107.  
  108.       // command handler, handles all ICommandEvents for our window.
  109.       // called when user selects an item or accelerator command.
  110.  
  111.       virtual Boolean command( ICommandEvent& event );
  112.  
  113.  
  114.       // This menu handler gets control when Word wrap submenu is activated.
  115.       // inusres right option is checked.
  116.  
  117.       virtual Boolean menuShowing ( IMenuEvent& event,ISubmenu& submenu);
  118.  
  119.  
  120.       // resize event handler, catches user resizeing frame window,
  121.       // storing new size.
  122.  
  123.       virtual Boolean windowResize(IResizeEvent& evt);
  124.  
  125.       // returns panel id.
  126.       virtual Boolean keysHelpId(IEvent& evt);
  127.  
  128. };
  129. #endif   //LIST
  130.