Scribus
Open source desktop publishing at your fingertips
propertiespalette_table.h
1 /*
2 Copyright (C) 2011 Elvis Stansvik <elvstone@gmail.com>
3 
4 For general Scribus (>=1.3.2) copyright and licensing information please refer
5 to the COPYING file provided with the program. Following this notice may exist
6 a copyright and/or license notice that predates the release of Scribus 1.3.2
7 for which a new license (GPL+exception) is in place.
8 */
9 #ifndef PROPERTIESPALETTE_TABLE_H
10 #define PROPERTIESPALETTE_TABLE_H
11 
12 #include <QColor>
13 #include <QString>
14 #include <QWidget>
15 
16 #include "scribusapi.h"
17 #include "scguardedptr.h"
18 #include "tableborder.h"
19 
20 #include "ui_propertiespalette_tablebase.h"
21 
22 class PageItem;
23 class ScribusMainWindow;
24 class ScribusDoc;
25 
29 class SCRIBUS_API PropertiesPalette_Table : public QWidget, Ui::PropertiesPalette_TableBase
30 {
31  Q_OBJECT
32 
33 public:
34  explicit PropertiesPalette_Table(QWidget *parent = 0);
36 
38  void updateColorList();
39 
40 public slots:
42  void setMainWindow(ScribusMainWindow* mainWindow);
44  void setDocument(ScribusDoc* doc);
46  void unsetDocument();
48  void setItem(PageItem* item);
50  void unsetItem();
51 
53  void handleSelectionChanged();
55  void handleCellSelectionChanged();
57  void handleUpdateRequest(int updateFlags);
59  void languageChange();
61  void unitChange();
63  void updateFillControls();
64  void updateStyleControls();
65 
66 private slots:
67  void setTableStyle(const QString& name);
68  void setCellStyle(const QString& name);
70  void on_sideSelector_selectionChanged();
72  void on_borderLineList_currentRowChanged(int row);
74  void on_addBorderLineButton_clicked();
76  void on_removeBorderLineButton_clicked();
78  void on_borderLineShade_valueChanged(int shade);
80  void on_borderLineWidth_valueChanged(double width);
82  void on_borderLineColor_activated(const QString& colorName);
84  void on_borderLineStyle_activated(int style);
85 
87  void on_fillColor_activated(const QString& colorName);
89  void on_fillShade_valueChanged(int shade);
90  void on_buttonClearTableStyle_clicked();
91  void on_buttonClearCellStyle_clicked();
92 
93 private:
95  enum State
96  {
97  Unset,
98  Set,
99  TriState
100  };
101 
102 private:
103  void showTableStyle(const QString& name);
104  void showCellStyle(const QString& name);
106  void updateBorderLineList();
108  void updateBorderLineListItem();
110  void updateBorders();
112  QColor getColor(const QString& colorName, int shade) const;
113 
114 private:
116  ScribusMainWindow* m_mainWindow;
120  PageItem* m_item;
122  PageItem* m_previousItem;
123 
125  TableBorder m_currentBorder;
126 };
127 
128 #endif // PROPERTIESPALETTE_TABLE_H
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: scribus.h:123
Definition: tableborder.h:86
the Document Class
Definition: scribusdoc.h:90
Definition: pageitem.h:92
Definition: propertiespalette_table.h:29