Back to index

scribus-ng  1.3.4.dfsg+svn20071115
seiten.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 SEITENPAL_H
00008 #define SEITENPAL_H
00009 
00010 #include <qdialog.h>
00011 #include <qtable.h>
00012 #include <qlabel.h>
00013 #include <qlistbox.h>
00014 #include <qcheckbox.h>
00015 #include <qpushbutton.h>
00016 #include <qlayout.h>
00017 #include <qtooltip.h>
00018 #include <qimage.h>
00019 #include <qpixmap.h>
00020 #include <qdragobject.h>
00021 #include <qevent.h>
00022 #include <qsplitter.h>
00023 
00024 #include "scribusapi.h"
00025 #include "scrpalettebase.h"
00026 class ScribusView;
00027 class ScribusMainWindow;
00028 class DynamicTip;
00029 class PageLayouts;
00030 
00031 class SCRIBUS_API SeDrag : public QStoredDrag
00032 {
00033 public:
00034        SeDrag( QString s, QWidget * parent = 0, const char * name = 0 );
00035        ~SeDrag() {};
00036 
00037        static bool canDecode( QDragMoveEvent* e );
00038        static bool decode( QDropEvent* e, QString& s );
00039 };
00040 
00041 class SCRIBUS_API SeItem : public QTableItem
00042 {
00043 
00044 friend class PagePalette;
00045 friend class SeView;
00046 
00047 
00048 public:
00049        SeItem(QTable* parent, QString text, uint pgnr, const QPixmap& Pix);
00050        ~SeItem() {};
00051 
00052        const QString& getPageName();
00053        uint pageNumber;
00054        
00055 protected:
00056        QString pageName;
00057 };
00058 
00059 class SCRIBUS_API SeList : public QListBox
00060 {
00061 friend class PagePalette;
00062 
00063        Q_OBJECT
00064 
00065 public:
00066        SeList(QWidget* parent);
00067        ~SeList() {};
00068 
00069 private slots:
00070        void ToggleTh();
00071 
00072 signals:
00073        void ThumbChanged();
00074 
00075 protected:
00076        void mouseReleaseEvent(QMouseEvent *m);
00077        void mousePressEvent(QMouseEvent* e);
00078        void mouseMoveEvent(QMouseEvent* e);
00079        
00080        QPoint Mpos;
00081        QListBoxItem *CurItem;
00082        bool Mpressed;
00083        bool Thumb;
00084 
00085 };
00086 
00087 class SCRIBUS_API SeView : public QTable
00088 {
00089        Q_OBJECT
00090        
00091 friend class PagePalette;
00092 
00093 public:
00094        SeView(QWidget* parent);
00095        ~SeView() {};
00096        void ClearPix();
00097        int GetPage(int r, int c, bool *last);
00098 
00099 public slots:
00100        void ToggleNam();
00101 
00102 signals:
00103        void UseTemp(QString, int);
00104        void NewPage(int, QString);
00105        void MovePage(int, int);
00106        void Click(int, int, int);
00107 
00108 protected:
00109        virtual void contentsDropEvent(QDropEvent * e);
00110        virtual void contentsDragEnterEvent(QDragEnterEvent *e);
00111        virtual void contentsDragLeaveEvent(QDragLeaveEvent *e);
00112        virtual void contentsDragMoveEvent(QDragMoveEvent *e);
00113        virtual void contentsMouseReleaseEvent(QMouseEvent *m);
00114        virtual void contentsMousePressEvent(QMouseEvent* e);
00115        virtual void contentsMouseMoveEvent(QMouseEvent* e);
00116        
00117        QPoint Mpos;
00118        bool Mpressed;
00119        bool Doppel;
00120        bool Links;
00121        bool Namen;
00122        int MaxC;
00123        int colmult;
00124        int rowmult;
00125        int coladd;
00126        int rowadd;
00127        int cols;
00128        int firstP;
00129 };
00130 
00131 class SCRIBUS_API TrashBin : public QLabel
00132 {
00133        Q_OBJECT
00134 
00135 public:
00136        TrashBin( QWidget * parent );
00137        ~TrashBin() {};
00138        void dragEnterEvent( QDragEnterEvent *e );
00139        void dragLeaveEvent( QDragLeaveEvent * );
00140        void dropEvent( QDropEvent * e );
00141 
00142 protected:
00143        QPixmap Normal;
00144        QPixmap Offen;
00145        
00146 signals:
00147        void DelPage(int);
00148        void DelMaster(QString);
00149 };
00150 
00151 class SCRIBUS_API PagePalette : public ScrPaletteBase
00152 {
00153        Q_OBJECT
00154 
00155 public:
00156        PagePalette(QWidget* parent);
00157        ~PagePalette() {};
00158        
00159        //CB FIXME Put these in for now and hide the rest. What are these indicating?
00160        const bool getNamen();
00161        const bool getThumb();
00162 
00163 public slots:
00164        void setView(ScribusView *view);
00165        void DelMPage(QString tmp);
00166        void MPage(int r, int c);
00167        void GotoPage(int r, int c, int b);
00168        void enablePalette(const bool);
00169        void handlePageLayout(int layout);
00170        void handleFirstPage(int fp);
00171        void RebuildTemp();
00172        void RebuildPage();
00173        void Rebuild();
00174        void markPage(uint nr);
00175        void selMasterPage();
00176        QPixmap CreateIcon(int nr, QPixmap pixin);
00177        void languageChange();
00178 
00179 signals:
00180        void EditTemp(QString);
00181        void GotoSeite(int);
00182 
00183 protected:
00184        QVBoxLayout* PagePaletteLayout;
00185        QHBoxLayout* Layout1;
00186        QVBoxLayout* Layout2;
00187        QVBoxLayout* Layout3;
00188        
00189        PageLayouts* pageLayout;
00190        QSplitter* Splitter1;
00191        QLabel* TextLabel1;
00192        QLabel* TextLabel2;
00193        TrashBin* Trash;
00194        QPtrList<SeItem> pageList;
00195        SeList* masterPageList;
00196        SeView* pageView;
00197        ScribusView *currView;
00198        ScribusMainWindow *m_scMW;
00199        QPixmap pix;
00200        DynamicTip* dynTip;
00201 };
00202 
00203 #endif // SEITENPAL_H