Scribus
Open source desktop publishing at your fingertips
scrapbookpalette.h
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 BIBLIO_H
8 #define BIBLIO_H
9 
10 #include <QDropEvent>
11 #include <QDragMoveEvent>
12 #include <QDragEnterEvent>
13 #include <QListWidget>
14 
15 class QEvent;
16 
17 #include "scribusapi.h"
18 #include "scdockpalette.h"
19 #include "scribusstructs.h"
20 
21 class QHBoxLayout;
22 class QToolButton;
23 class QVBoxLayout;
24 class QToolBox;
25 class QPixmap;
26 class QListWidgetItem;
27 class QDomElement;
28 
29 class SCRIBUS_API BibView : public QListWidget
30 {
31  Q_OBJECT
32 
33 public:
34  BibView( QWidget* parent);
35  ~BibView() {};
36  void AddObj(QString name, QString daten, QPixmap Bild, bool isDir = false, bool isRaster = false, bool isVector = false);
37  void checkForImg(QDomElement elem, bool &hasImage);
38  void checkAndChange(QString &text, QString nam, QString dir);
39  void checkAndChangeGroups(QDomElement elem, QString dir, QFileInfo fid);
40  void ReadOldContents(QString, QString newName);
41  void ReadContents(QString name);
42  struct Elem
43  {
44  bool isDir;
45  bool isRaster;
46  bool isVector;
47  QString Data;
48  QPixmap Preview;
49  QListWidgetItem* widgetItem;
50  };
51  QMap<QString,Elem> objectMap;
52  QString ScFilename;
53  QString visibleName;
54  bool canWrite;
55 
56 signals:
57  void ToggleAllPalettes();
58  void objDropped(QString text);
59  void fileDropped(QString path, int testResult);
60  void paletteClosed();
61 
62 protected:
63  void dragEnterEvent(QDragEnterEvent *e);
64  void dragMoveEvent(QDragMoveEvent *e);
65  void dropEvent(QDropEvent *e);
66  void startDrag(Qt::DropActions supportedActions);
67 };
68 
69 class SCRIBUS_API Biblio : public ScDockPalette
70 {
71  Q_OBJECT
72 
73 public:
74  Biblio( QWidget* parent);
75  ~Biblio() {};
76 
77  virtual void changeEvent(QEvent *e);
78 
79  void ObjFromCopyAction(QString text, QString name);
80  void adjustReferences(QString nam);
81  void adjustReferencesGroups(QDomElement elem, QFileInfo fid);
82  void CleanUpTemp();
83  void setScrapbookFileName(QString);
84  const QString getScrapbookFileName();
85  const int objectCount();
86  bool tempHasContents();
87  void readContents(QString);
88  void readTempContents(QString);
89  void readOldContents(QString, QString);
90  void installEventFilter(QObject *);
91  void setOpenScrapbooks(QStringList &fileNames);
92  QStringList getOpenScrapbooks();
93  QStringList getOpenScrapbooksNames();
94  QString getObjectName(QString &text);
95  BibView* tempBView;
96  BibView* activeBView;
97  QListWidgetItem *actItem;
98 
99 public slots:
100  void languageChange();
101  void ObjFromFile(QString path, int testResult);
102  void ObjFromMenu(QString text);
103  void ObjFromMainMenu(QString text, int scrapID);
104  void closeOnDel(QString libName);
105  void reloadLib(QString fileName);
106 
107 private slots:
108  void handleDoubleClick(QListWidgetItem *ite);
109  void handlePasteToPage();
110  void HandleMouse(QPoint p);
111  bool copyObj(int id);
112  void moveObj(int id);
113  void deleteObj();
114  void deleteAllObj();
115  void renameObj();
116  void NewLib();
117  void updateView();
118  void goOneDirUp();
119  void closeLib();
120  void libChanged(int index);
121  void Import();
122 
123 signals:
124  void updateRecentMenue();
125  void pasteToActualPage(QString);
126  void scrapbookListChanged();
127 
128 protected:
129  QToolBox* Frame3;
130  QVBoxLayout* BiblioLayout;
131  int tempCount;
132  QString OldName;
133  QHBoxLayout* buttonLayout;
134  QWidget* containerWidget;
135  QToolButton* newButton;
136  QToolButton* upButton;
137  QToolButton* importButton;
138  QToolButton* closeButton;
139  QToolButton* configButton;
140  QMenu* configMenue;
141  QAction* conf_HideDirs;
142  QAction* conf_HideImages;
143  QAction* conf_HideVectors;
144  QAction* conf_OpenMode;
145  PrefsContext* prefs;
146 };
147 
148 #endif // BIBLIO_H
Definition: scrapbookpalette.h:69
Definition: scrapbookpalette.h:42
Definition: scdockpalette.h:38
Definition: scrapbookpalette.h:29
Definition: prefscontext.h:40