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 CONTENTPALETTE_PAGEBASE_H
8 #define CONTENTPALETTE_PAGEBASE_H
9 
10 #include "ui_contentpalette_pagebase.h"
11 
12 #include "scribusapi.h"
13 #include "pageitem.h"
14 #include "scguardedptr.h"
15 #include "scribusdoc.h"
16 
17 class ScribusDoc;
18 class ScribusMainWindow;
19 class Selection;
20 
21 class SCRIBUS_API ContentPalette_Page : public QWidget, Ui::ContentPalette_PageBase
22 {
23 	Q_OBJECT
24 
25 public:
26 	ContentPalette_Page(QWidget* parent);
~ContentPalette_Page()27 	~ContentPalette_Page() {};
28 
29 protected:
30 	bool      m_haveDoc = false;
31 	bool      m_haveItem = false;
32 	double    m_unitRatio = 1.0;
33 	int       m_unitIndex = 0;
34 
35 	// PageItem *m_item;
36 	ScribusMainWindow*       m_ScMW = nullptr;
37 	ScGuardedPtr<ScribusDoc> m_doc;
38 
39 	void changeEvent(QEvent *e) override;
40 
41 public slots:
42 	void setMainWindow(ScribusMainWindow *mw);
43 
44 	void setDoc(ScribusDoc *d);
45 	void setCurrentItem(PageItem *item);
46 	void unsetDoc();
47 	void unsetItem();
48 
49 	void handleSelectionChanged();
50 	void handleUpdateRequest(int);
51 
52 	void languageChange();
53 	void unitChange();
54 };
55 
56 #endif
57