Scribus
Open source desktop publishing at your fingertips
propertiespalette_text.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 PROPERTIESPALETTE_TEXT_H
8 #define PROPERTIESPALETTE_TEXT_H
9 
10 #include "ui_propertiespalette_textbase.h"
11 
12 #include "scribusapi.h"
13 #include "scrpalettebase.h"
14 #include "scrspinbox.h"
15 
16 #include "linecombo.h"
17 #include "spalette.h"
18 #include "alignselect.h"
19 #include "shadebutton.h"
20 #include "sclistboxpixmap.h"
21 #include "scguardedptr.h"
22 #include "sctextstruct.h"
23 #include "sctreewidget.h"
24 
25 class PageItem;
34 class ScComboBox;
35 class ScribusDoc;
36 class ScribusMainWindow;
37 class Selection;
38 
39 class SCRIBUS_API PropertiesPalette_Text : public QWidget, public Ui::PropertiesPalette_TextBase
40 {
41  Q_OBJECT
42 
43 public:
44  PropertiesPalette_Text(QWidget* parent);
46 
47  virtual void changeEvent(QEvent *e);
48 
49  void updateColorList();
50 
52  bool userActionOn(); // not yet implemented!!! This is needed badly.
53  // When user releases the mouse button or arrow key, changes must be checked
54  // and if in ScribusView a groupTransaction has been started it must be also
55  // commmited
56 
57 protected:
58 
59  bool m_haveDoc;
60  bool m_haveItem;
61  double m_unitRatio;
62  int m_unitIndex;
63 
64  PageItem *m_item;
65  ScribusMainWindow* m_ScMW;
67 
68 private:
69  PageItem* currentItemFromSelection();
70 
71 public slots:
72  void setMainWindow(ScribusMainWindow *mw);
73 
74  void setDoc(ScribusDoc *d);
75  void setCurrentItem(PageItem *i);
76  void unsetDoc();
77  void unsetItem();
78 
79  void handleSelectionChanged();
80  void handleUpdateRequest(int);
81 
82  void languageChange();
83  void unitChange();
84 
85  void showAlignment(int e);
86  void showCharStyle(const QString& name);
87  void showFontFace(const QString&);
88  void showFontSize(double s);
89  void showFirstLinePolicy(FirstLineOffsetPolicy);
90  void showLineSpacing(double r);
91  void showParStyle(const QString& name);
92 
93  void setupLineSpacingSpinbox(int mode, double value);
94 
96  void updateCharStyle(const CharStyle& charStyle);
97  void updateStyle(const ParagraphStyle& newCurrent);
98 
99  void updateCharStyles();
100  void updateParagraphStyles();
101  void updateTextStyles();
102 
103  void handleLineSpacingMode(int id);
104  void handleTextFont(QString);
105 
106 private slots:
107  void handleAlignment(int a);
108  void handleFirstLinePolicy(int);
109  void handleFontSize();
110  void handleLineSpacing();
111 
112  void doClearCStyle();
113  void doClearPStyle();
114 
115 protected:
116 
117  ScComboBox* pathTextType;
118 
119  PropertyWidget_TextColor* colorWidgets;
120  QTreeWidgetItem* colorWidgetsItem;
121 
122  PropertyWidget_Distance* distanceWidgets;
123  QTreeWidgetItem* distanceItem;
124 
125  PropertyWidget_Advanced* advancedWidgets;
126  QTreeWidgetItem* advancedWidgetsItem;
127 
128  PropertyWidget_OptMargins* optMargins;
129  QTreeWidgetItem* optMarginsItem;
130 
131  PropertyWidget_Flop* flopBox;
132  QTreeWidgetItem* flopItem;
133 
134  PropertyWidget_Orphans* orphanBox;
135  QTreeWidgetItem* orphanItem;
136 
137  PropertyWidget_ParEffect* parEffectWidgets;
138  QTreeWidgetItem* parEffectItem;
139 
140  PropertyWidget_PathText* pathTextWidgets;
141  QTreeWidgetItem* pathTextItem;
142 };
143 
144 #endif
Definition: propertiespalette_text.h:39
Definition: charstyle.h:78
Definition: propertywidget_textcolor.h:17
Definition: propertywidget_pathtext.h:17
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: scribus.h:123
Definition: propertywidget_distance.h:17
Definition: propertywidget_advanced.h:19
Definition: propertywidget_optmargins.h:18
Definition: paragraphstyle.h:27
The ScComboBox widget always uses a listbox instead of a popup, independent of any QStyle...
Definition: sccombobox.h:26
the Document Class
Definition: scribusdoc.h:90
Definition: propertywidget_pareffect.h:13
Definition: propertywidget_flop.h:16
Definition: propertywidget_orphans.h:16
Definition: pageitem.h:92
Definition: selection.h:34