home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / chartableview.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-10-07  |  1.9 KB  |  72 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. #ifndef CHARTABLEVIEW_H
  8. #define CHARTABLEVIEW_H
  9.  
  10. #include <QTableView>
  11.  
  12. class CharTableModel;
  13. class CharZoom;
  14.  
  15.  
  16. /*! \brief A visual widget for displaying the unicode glyphs map.
  17. setAcceptDrops() note:
  18. It sets the right-button behaviour too. It enables delete popup
  19. menu when e is true instead of larger preview dialog. The idea:
  20. When user can drop items into it, he could want to delete it too.
  21. \warning: CharTableModel and CharTableView are designed for 1:1 relations!
  22. \author Petr Vanek <petr@scribus.info>
  23. */
  24. class CharTableView : public QTableView
  25. {
  26.     Q_OBJECT
  27.  
  28. public:
  29.     CharTableView(QWidget * parent = 0);
  30.  
  31. signals:
  32.     void selectChar(uint);
  33.     //! \brief When user press the DELETE/BACKSPACE key
  34.     void delChar();
  35.  
  36. public slots:
  37.     /*! \brief Handling selection changes from model's internals.
  38.     There can arrive selection changes unrelated to GUI integration. */
  39.     void modelSelectionChanged(QItemSelectionModel * model);
  40.  
  41.     //! \brief Calculate height of the last row to fit image size
  42.     void resizeLastRow();
  43.  
  44. protected:
  45.     //! \brief Magnify dialog reference
  46.     CharZoom* zoom;
  47.  
  48.     QAction * deleteAct;
  49.     QMenu * actionMenu;
  50.  
  51.     CharTableModel * model();
  52.     void hideEvent(QHideEvent *);
  53.     void keyPressEvent(QKeyEvent *k);
  54.     void mouseReleaseEvent(QMouseEvent *m);
  55.     void mousePressEvent(QMouseEvent* e);
  56.     void mouseMoveEvent(QMouseEvent* e);
  57.  
  58.     //! \brief Map current QModelIndex into CharClassDef index/position
  59.     int currenCharactersIndex();
  60.  
  61.     void hideZoomedChar();
  62.  
  63.     //! \brief Used for computing the items' pixmap size in the model.
  64.     void resizeEvent(QResizeEvent *e);
  65.  
  66. private slots:
  67.     void removeCharacter();
  68.     void viewDoubleClicked(const QModelIndex & index);
  69. };
  70.  
  71. #endif
  72.