home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / lyx-0.13.2.tar.gz / lyx-0.13.2.tar / lyx-0.13.2 / src / LyXView.h < prev    next >
C/C++ Source or Header  |  1998-04-23  |  3KB  |  147 lines

  1. // -*- C++ -*-
  2. /* This file is part of
  3. * ======================================================
  4. *           LyX, The Document Processor
  5. *        
  6. *           Copyright (C) 1995 Matthias Ettrich
  7. *           Copyright (C) 1995-1998 The LyX Team.
  8. *
  9. *======================================================*/
  10.  
  11. #ifndef _LyXView_H_
  12. #define _LyXView_H_
  13.  
  14. #ifdef __GNUG__
  15. #pragma interface
  16. #endif
  17.  
  18. #include FORMS_H_LOCATION
  19. #include "lyx.h"
  20. #include "buffer.h"
  21. #include "menus.h"
  22. #include "BufferView.h"
  23. class LyXFunc;
  24. class Toolbar;
  25. class MiniBuffer;
  26. class Intl;
  27.  
  28. ///
  29. struct  FD_form_main {
  30.     ///
  31.     FL_FORM *form_main;
  32.     ///
  33.     FL_OBJECT *timer_autosave;
  34.     ///
  35.     FL_OBJECT *timer_update;
  36.     ///
  37.     void *vdata;
  38.     ///
  39.     long ldata;
  40. };
  41.  
  42.  
  43.  
  44. /**
  45.   This class is the form containing the view of the buffer. The actual buffer
  46.   view is supposed (at least IMHO) to be another class, that shows its output
  47.   in one or more LyXView's.
  48.  */
  49. class LyXView {
  50. public:
  51.     /// constructor
  52.     LyXView(int w, int h);
  53.  
  54.     /// destructor
  55.     ~LyXView();
  56.  
  57.     /// Where to place the form.
  58.     void setPosition(int, int);
  59.  
  60.     /// Show the main form.
  61.     void show(int, int, char const* t= "LyX");
  62.  
  63.     /// init (should probably be removed later) (Lgb)
  64.     void init();
  65.  
  66.     /// Redraw the main form.
  67.     void redraw();
  68.  
  69.     /// returns the buffer currently shown in the main form.
  70.     Buffer *currentBuffer(){ return bufferview->currentBuffer();}
  71.  
  72.     ///
  73.     BufferView *currentView() { return bufferview; }
  74.  
  75.     /// returns a pointer to the form.
  76.     FL_FORM *getForm() { return _form; }
  77.  
  78.     /// return a pointer to the toolbar
  79.     Toolbar *getToolbar() { return toolbar; }
  80.  
  81.     /// return a pointer to the lyxfunc
  82.     LyXFunc *getLyXFunc() { return lyxfunc; }
  83.  
  84.     /// return a pointer to the minibuffer
  85.     MiniBuffer *getMiniBuffer() { return minibuffer; }
  86.  
  87.     ///
  88.     Menus *getMenus() { return menus; }
  89.  
  90.     ///
  91.     Intl *getIntl() { return intl; }
  92.  
  93.     ///
  94.     void updateLayoutChoice();
  95.  
  96.     /// Updates the title of the window
  97.     void updateWindowTitle();
  98.  
  99.     /// Reset autosave timer
  100.     void resetAutosaveTimer();
  101. private:
  102.     /// 
  103.     LyXFunc *lyxfunc;
  104.     /// 
  105.     Toolbar *toolbar;
  106.     /// 
  107.     MiniBuffer *minibuffer;
  108.     ///
  109.     Menus *menus;
  110.     ///
  111.     Intl *intl;
  112.  
  113.     /** This is supposed to be a pointer or a list of pointers to the
  114.        BufferViews currently being shown in the LyXView. So far
  115.        this is not used, but that should change pretty soon. (Lgb) */
  116.     BufferView *bufferview;
  117.     ///
  118.     void invalidateLayoutChoice();
  119.     ///
  120.     void UpdateDocumentClassChoice();
  121.      ///
  122.      static int KeyPressMask_raw_callback(FL_FORM *, void *xev);
  123.     /// makes the main form.
  124.     FD_form_main *create_form_form_main(int width, int height);
  125.  
  126.     /** This callback is run when a close event is sent from the
  127.       window manager. */
  128.     static int atCloseMainFormCB(FL_FORM *, void *);
  129.     /// A callback
  130.     static void AutosaveTimerCB(FL_OBJECT *, long);
  131.     /// A callback
  132.     static void UpdateTimerCB(FL_OBJECT *, long);
  133.     /// A pointer to the form.    
  134.     FD_form_main *_form_main;
  135.     /// A pointer to the form.    
  136.     FL_FORM *_form;
  137.  
  138.     /** The last textclass layout list in the layout choice selector
  139.       This should probably be moved to the toolbar, but for now it's
  140.     here. (Asger) */
  141.     int last_textclass;
  142. };
  143.  
  144.  
  145. #endif
  146.