Back to index

scribus-ng  1.3.4.dfsg+svn20071115
chartable.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #ifndef CHARTABLE_H
00008 #define CHARTABLE_H
00009 
00010 #include <qdialog.h>
00011 #include "scribusapi.h"
00012 
00013 class QTable;
00014 class PageItem;
00015 class CharZoom;
00016 
00017 
00019 typedef QValueList<uint> CharClassDef;
00020 
00021 
00023 class SCRIBUS_API CharTable : public QTable
00024 {
00025     Q_OBJECT
00026 
00027 public:
00028        CharTable(QWidget* parent, int cols, ScribusDoc *doc, QString font);
00029        ~CharTable() {};
00030 
00031        void setFontInUse(QString font);
00032        void setCharacters(CharClassDef ch);
00033        CharClassDef characters() { return m_characters; };
00035        void recalcCellSizes();
00040        void enableDrops(bool e);
00041        void setDoc(ScribusDoc *doc);
00042 
00043 public slots:
00045        void showAlternate();
00051        void appendUnicode(QString s, uint base = 16);
00052 
00053 signals:
00054        void selectChar(uint);
00056        void delChar();
00057 
00058 private:
00060        void resizeData( int ) {};
00062        QRect cellGeometry ( int row, int col ) const;
00064        void paintCell( QPainter * p, int row, int col, const QRect & cr, bool selected, const QColorGroup & cg );
00066        void paintFocus( QPainter * /*p*/, const QRect & /*cr*/ ) {};
00067 
00068        bool mPressed;
00069 //     bool alternate;
00071        CharZoom* zoom;
00072 //     PageItem *m_Item;
00073        ScribusDoc *m_doc;
00075        bool dragging;
00077        uint cCol;
00079        uint cRow;
00080 
00081 private slots:
00082        void slotDropped(QDropEvent *evt);
00086        void deleteOwnCharacter(int index);
00087 
00088 protected:
00089        QString m_fontInUse;
00090        CharClassDef m_characters;
00091        QPoint m_mousePosition;
00092 
00093        void keyPressEvent(QKeyEvent *k);
00094        void contentsMouseReleaseEvent(QMouseEvent *m);
00095        void contentsMousePressEvent(QMouseEvent* e);
00096        // d'n'd
00097        QDragObject * dragObject();
00098 };
00099 
00100 #endif