CanvasWindow.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
16 #ifndef CanvasWindow_H
17 #define CanvasWindow_H
18 
19 #include "qtui/CanvasWindowBase.h"
20 
21 #include <qglobal.h> // for version
22 
23 #if QT_VERSION < 0x040000
24 #include <qcanvas.h>
25 #else
26 // #include "CanvasWindowUI.h"
27 //Added by the Qt porting tool:
28 #include <q3canvas.h>
29 #endif
30 
31 #include <string>
32 #include <vector>
33 #include <utility>
34 
35 class QCloseEvent;
36 class QCustomEvent;
37 class QHideEvent;
38 class QResizeEvent;
39 class QShowEvent;
40 
41 class std::exception;
42 
43 namespace hippodraw {
44 
45 class NTuple;
46 class CanvasView;
47 class QtFileDialog;
48 class PlotterBase;
49 class PlotTable;
50 class QtView;
51 class ViewBase;
52 class XmlController;
53 
106 // #if QT_VERSION < 0x040000
108 {
109 // #else
110 // class MDL_QTHIPPOPLOT_API CanvasWindow : public Q3MainWindow,
111 // private Ui::CanvasWindowUI
112 // {
113 // Q_OBJECT
114 // #endif
115 
116 private:
117 
121 
124 
128 
132 
135 
137  std::string m_filename;
138 
141 
145 
150 
154 
159 
162 
165  std::string getSaveDocFilename ();
166 
168  void setTitleFileName ( const std::string & name );
169 
175  bool setFilenameFromDialog ();
176 
181  bool areDataSourcesSaved ();
182 
183 // #if QT_VERSION < 0x040000
184 protected:
185 // #else
186 // protected slots:
187 // #endif
188 
198  virtual void windowActivationChange ( bool oldActive );
199 
201  virtual void closeEvent ( QCloseEvent * e );
202 
204  virtual void hideEvent ( QHideEvent * e );
205 
207  virtual void showEvent ( QShowEvent * e );
208 
210  virtual void resizeEvent ( QResizeEvent * );
211 
212  /* Implementation of functions declared in base class. */
213 
218  virtual void filePrint ();
219 
226  virtual void fileSaveAll();
227 
232  virtual void fileSaveAllAs();
233 
238  virtual void editClear ();
239 
240  virtual void editCopy ();
244  virtual void editCut ();
245 
249  virtual void editDelete ();
250 
251  virtual void editPaste ();
252 
255  virtual void editReTile ();
256 
259  virtual void editReTilePage ();
260 
263  virtual void editSelectAll ();
264 
267  virtual void editUndo ();
268 
269  virtual void fileExportTextTuple ();
270 
273  virtual void fileCreateNTuple ();
274 
277  virtual void helpHelp ();
278 
281  virtual void helpAbout ();
282 
285  virtual void aboutQt ();
286 
290  virtual void viewLock ();
291 
295  virtual void viewUnlock ();
296 
299  virtual void viewShowInspector ();
300 
303  virtual void viewShowPlotTable ();
304 
307  virtual void viewShowPickTable ();
308 
312  void previousView ();
313 
317  void nextView ();
318 
321  virtual void setZoomMode ( bool on );
322 
325  virtual void settingCanvas ();
326 
329  virtual void settingPrinter ();
330 
333  virtual void settingFonts ();
334 
337  virtual void setFitter ( QAction * );
338 
341  virtual void openRecentFile ( QAction * );
342 
344  virtual void viewZoomIn();
345 
347  virtual void viewZoomOut();
348 
351  virtual void viewZoomReset();
352 
354  virtual void viewAddPage();
355 
358  virtual void setCutMode ( QAction * );
359 
362  virtual void groupView ();
363 
366  virtual void ungroupView ();
367 
369  virtual void defaultToolbar ();
370 
371 public:
372 
375 #if QT_VERSION < 0x040000
376  CanvasWindow ( QWidget * parent = 0,
377  const char * name = 0,
378  Qt::WFlags fl = Qt::WType_TopLevel );
379 #else
380  CanvasWindow ( QWidget * parent = 0 );
381  #endif
382 
386  CanvasWindow ( const CanvasWindow & );
387 
388  virtual ~CanvasWindow();
389 
392  static void resetFontSize ();
393 
395  void initFromFile ( const std::string & filename );
396 
400  virtual void customEvent ( QCustomEvent * event );
401 
404  void inhibitClose ( bool yes = true );
405 
409  void setAllowClose ( bool yes = true );
410 
414  bool allowClose ();
415 
420  virtual bool closeNoPrompt ();
421 
426  void setChanged ( bool flag = true );
427 
430  void setCaption ();
431 
435  void updateActions ();
436 
438  virtual void fileNew();
439 
445  void fileSave ();
446 
448  virtual void fileSaveAs ();
449 
452  virtual void fileSaveSelectedImages ();
453 
457  virtual void fileSaveSelectedImages( const std::string & filename );
458 
460  void saveAs ( const std::string & filename );
461 
463  void saveAllAs ( const std::string & filename );
464 
467  CanvasView * getCanvasView ();
468 
470  void addTextDisplay ( PlotterBase * plotter,
471  const std::string & type);
472 
475  void addTextDisplay ( PlotterBase * plotter,
476  const std::string & type,
477  const std::string & text);
478 
484  std::pair<double, double> addTextDisplayAt ( PlotterBase * plotter,
485  const std::string & type,
486  const std::string & text,
487  double xrel, double yrel);
488 
490  void addFuncDisplay ( PlotterBase * plotter, const std::string & name );
491 
496  void addPlotDisplay ( PlotterBase * plotter, bool select );
497 
499  void addDisplay ( PlotterBase * plotter );
500 
503  void removeDisplay ( PlotterBase * plotter );
504 
506  PlotterBase * selectedPlotter ();
507 
510  void clear();
511 
513  const std::vector < const ViewBase * > & views ();
514 
517  void fillPlotterList ( std::vector < PlotterBase * > & plotter_list );
518 
521  QtView * getViewFor ( const PlotterBase * plotter ) const;
522 
525  void setIntervalEnabled ( bool yes = true );
526 
537  void savePlotAsImage ( const PlotterBase * plotter,
538  const std::string & filename );
539 
547  void saveAsImage ( const PlotterBase * plotter,
548  const std::string & filename );
549 
551  void setAllSelected ( bool flag = true );
552 
554  void setSelected ( QtView * view );
555 
557  const std::vector<double> & mouseEventData();
558 
561  void print ( const std::string & filename );
562 
566  void setPlotMatrix ( unsigned int columns, unsigned int rows );
567 
570  const QString & getAppKey () const;
571 
574  void setAddedSelected ( bool yes );
575 
578  NTuple * getPickTable () const;
579 
582  NTuple * getPickTable ( const PlotterBase * plotter ) const;
583 
587  void autosaveSettings ();
588 
589 protected slots:
590 
593  virtual void fileBrowse();
594 
597  virtual void fileExit ();
598 
603  virtual void fileOpen ();
604 
605 };
606 
607 } // namespace hippodraw
608 
609 #endif // CanvasWindow_H

Generated for HippoDraw Class Library by doxygen