Back to index

scribus-ng  1.3.4.dfsg+svn20071115
scrap.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 BIBLIO_H
00008 #define BIBLIO_H
00009 
00010 #include <qiconview.h>
00011 #include <qframe.h>
00012 #include <qtabwidget.h>
00013 // #include <qpopupmenu.h>
00014 #include <qmenubar.h>
00015 
00016 #include <qtooltip.h>
00017 #include <qpixmap.h>
00018 #include <qdragobject.h>
00019 
00020 #include "scribusapi.h"
00021 #include "scrpalettebase.h"
00022 #include "scribusstructs.h"
00023 
00024 class QHBoxLayout;
00025 class QToolButton;
00026 class QVBoxLayout;
00027 class QToolBox;
00028 
00029 class SCRIBUS_API BibView : public QIconView
00030 {
00031        Q_OBJECT
00032 
00033 public:
00034        BibView( QWidget* parent);
00035        ~BibView() {};
00036        void keyPressEvent(QKeyEvent *k);
00037        void AddObj(QString name, QString daten, QPixmap Bild);
00038        void checkAndChange(QString &text, QString nam, QString dir);
00039        void SaveContents(QString name, QString oldName);
00040        void ReadOldContents(QString, QString newName);
00041        void ReadContents(QString name);
00042        struct Elem
00043        {
00044               QString Data;
00045               QPixmap Preview;
00046        };
00047        QMap<QString,Elem> objectMap;
00048        QString ScFilename;
00049        bool canWrite;
00050 
00051 signals:
00052        void ToggleAllPalettes();
00053        void Schliessen();
00054        void CloseMpal();
00055        void CloseTpal();
00056 
00057 protected:
00058        virtual QDragObject *dragObject();
00059 };
00060 
00061 class SCRIBUS_API Biblio : public ScrPaletteBase
00062 {
00063        Q_OBJECT
00064 
00065 public:
00066        Biblio( QWidget* parent);
00067        ~Biblio() {};
00068        void ObjFromMenu(QString text);
00069        void ObjFromCopyAction(QString text);
00070        void adjustReferences(QString nam);
00071        void CleanUpTemp();
00072        void setScrapbookFileName(QString);
00073        const QString getScrapbookFileName();
00074        const int objectCount();
00075        void readContents(QString);
00076        void readTempContents(QString);
00077        void readOldContents(QString, QString);
00078        void installEventFilter(const QObject *);
00079        void setOpenScrapbooks(QStringList &fileNames);
00080        QStringList getOpenScrapbooks();
00081        BibView* tempBView;
00082        
00083 public slots:
00084        void languageChange();
00085 
00086 private slots:
00087        void HandleMouse(int button, QIconViewItem *ite);
00088        bool copyObj(int id);
00089        void moveObj(int id);
00090        void DeleteObj(QString name, QIconViewItem *ite);
00091        void ItemRenamed(QIconViewItem *ite);
00092        void DropOn(QDropEvent *e);
00093        void NewLib();
00094        void Load();
00095        void SaveAs();
00096        void closeLib();
00097 //     void libChanged(QWidget *lib);
00098        void libChanged(int index);
00099        void Import();
00100 
00101 signals:
00102        void updateRecentMenue();
00103 
00104 protected:
00105 //     QMap<QString, QGuardedPtr<ScrAction> > scrapbookActions;
00106 //     QPopupMenu* pmenu;
00107 //     QPopupMenu* fmenu;
00108 //     QMenuBar* menuBar;
00109 //     QTabWidget* Frame3;
00110        QToolBox* Frame3;
00111        QVBoxLayout* BiblioLayout;
00112        BibView* activeBView;
00113        int tempCount;
00114        QString OldName;
00115 //     int mFile;
00116 //     int mView;
00117 //     int fNew;
00118 //     int fLoad;
00119 //     int fSave;
00120 //     int fSaveAs;
00121 //     int fClose;
00122 //     int fImport;
00123        QHBoxLayout* buttonLayout;
00124        QToolButton* newButton;
00125        QToolButton* loadButton;
00126        QToolButton* saveAsButton;
00127        QToolButton* importButton;
00128        QToolButton* closeButton;
00129 };
00130 
00131 #endif // BIBLIO_H