Scribus
Open source desktop publishing at your fingertips
outlinepalette.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 OUTLINEPALETTE_H
8 #define OUTLINEPALETTE_H
9 
10 #include <QPixmap>
11 #include <QTreeWidget>
12 #include <QTreeWidgetItem>
13 #include <QLineEdit>
14 #include <QList>
15 #include <QLabel>
16 
17 class QEvent;
18 
19 #include "scribusapi.h"
20 #include "scdockpalette.h"
21 
22 class ScribusMainWindow;
23 class ScribusDoc;
24 class PageItem;
25 class ScPage;
26 
27 class SCRIBUS_API OutlineTreeItem : public QTreeWidgetItem
28 {
29 public:
31  OutlineTreeItem(QTreeWidget* parent, OutlineTreeItem* after);
32  ~OutlineTreeItem() {};
33  PageItem *PageItemObject;
34  ScPage *PageObject;
35  ScribusDoc *DocObject;
36  int LayerID;
37  int type; //1=PageItem on Master Page,2=,3=PageItem,4=,5=,...
38 };
39 
40 class SCRIBUS_API OutlineWidget : public QTreeWidget
41 {
42  Q_OBJECT
43 
44 public:
45  OutlineWidget(QWidget* parent);
46  ~OutlineWidget() {};
47 
48  void selectItems(QList<QTreeWidgetItem*> items);
49 
50 protected:
51  void dropEvent(QDropEvent *e);
52  void keyPressEvent(QKeyEvent *e);
53  bool viewportEvent(QEvent *event);
54 };
55 
56 class SCRIBUS_API OutlinePalette : public ScDockPalette
57 {
58  Q_OBJECT
59 
60 public:
61  OutlinePalette( QWidget* parent );
62 
63  virtual void changeEvent(QEvent *e);
64 
65 // void resizeEvent(QResizeEvent *r);
66  void setMainWindow(ScribusMainWindow *mw);
67  void setDoc(ScribusDoc *);
68  void unsetDoc();
69  void reopenTree();
70  QTreeWidgetItem* getListItem(int SNr, PageItem *Nr);
71  void setItemIcon(QTreeWidgetItem *item, PageItem *pgItem);
72  void parseSubGroup(OutlineTreeItem* object, QList<PageItem*> *subGroupList, int itemType, ScPage *a);
73  void buildReopenVals();
74 
75 public slots:
76  void BuildTree(bool storeVals = true);
77  void filterTree(const QString& keyword);
78  void languageChange();
79  void slotShowSelect(uint SNr, PageItem *Nr);
80  void setPaletteShown(bool);
81  void slotRightClick(QPoint point);
82  void setActiveLayer(int layerID);
83  void setLayerVisible(int layerID);
84  void setLayerLocked(int layerID);
85  void setLayerPrintable(int layerID);
86 
87 signals:
88  void ToggleAllPalettes();
89  void selectElementByItem(PageItem *, bool);
90  void editElementByItem(PageItem *);
91  void selectPage(int);
92  void selectMasterPage(QString);
93 
94 protected slots:
95  void slotRenameItem();
96  void slotDoRename(QTreeWidgetItem* ite, int col);
97  void slotMultiSelect();
98  void slotSelect(QTreeWidgetItem* ite, int col);
99  void slotDoubleClick(QTreeWidgetItem* ite, int col);
100 protected:
101  void filterTree();
102  void clearPalette();
103  void createContextMenu(PageItem *currItem, double mx, double my);
104  QWidget* containerWidget;
105  OutlineWidget* reportDisplay;
106  QTreeWidgetItem* freeObjects;
107  QTreeWidgetItem* rootObject;
108  QTreeWidgetItem* currentObject;
109  QLabel* filterLabel;
110  QLineEdit* filterEdit;
111  ScribusMainWindow* m_MainWindow;
112  QPixmap imageIcon;
113  QPixmap latexIcon;
114  QPixmap textIcon;
115  QPixmap lineIcon;
116  QPixmap polygonIcon;
117  QPixmap polylineIcon;
118  QPixmap groupIcon;
119  QPixmap tableIcon;
120  QPixmap buttonIcon;
121  QPixmap radiobuttonIcon;
122  QPixmap textFieldIcon;
123  QPixmap checkBoxIcon;
124  QPixmap comboBoxIcon;
125  QPixmap listBoxIcon;
126  QPixmap annotTextIcon;
127  QPixmap annotLinkIcon;
128  QPixmap annot3DIcon;
129  bool selectionTriggered;
130  ScribusDoc *currDoc;
131 };
132 
133 #endif // TREE_H
Definition: outlinepalette.h:27
Definition: outlinepalette.h:40
Definition: scpage.h:46
Definition: scdockpalette.h:38
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: scribus.h:123
Definition: outlinepalette.h:56
the Document Class
Definition: scribusdoc.h:90
Definition: pageitem.h:92