Back to index

scribus-ng  1.3.4.dfsg+svn20071115
guidemanager.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #ifndef GUIDEMANAGER_H
00008 #define GUIDEMANAGER_H
00009 
00010 #include <qlistview.h>
00011 #include "scribusapi.h"
00012 #include "mspinbox.h"
00013 #include "guidemanagerbase.h"
00014 #include "guidemanagercore.h"
00015 #include "scrpalettebase.h"
00016 #include "scribusstructs.h"
00017 #include "page.h"
00018 
00019 class QWidget;
00020 class QGroupBox;
00021 class QPushButton;
00022 class QLabel;
00023 class QString;
00024 class QCheckBox;
00025 class QHButtonGroup;
00026 
00027 class ScribusDoc;
00028 
00033 typedef QMap<QString,double> GuideGUIMap;
00034 
00035 
00045 class SCRIBUS_API GuideListItem : public QListViewItem
00046 {
00047 public:
00049        GuideListItem(QListView *parent, QString c1) : QListViewItem(parent, c1){};
00050 
00058        int compare(QListViewItem *i, int col, bool asc) const;
00059 };
00060 
00061 
00071 class SCRIBUS_API GuideManager : public GuideManagerBase//, public ScrPaletteBase
00072 {
00073     Q_OBJECT
00074 
00075 public:
00076        GuideManager(QWidget* parent);
00077        ~GuideManager(){};
00078 
00080        void setDoc(ScribusDoc* doc);
00081 
00084        void setupPage();
00085        void setupGui();
00086 
00088        void clearRestoreHorizontalList();
00090        void clearRestoreVerticalList();
00091 
00095        Guides selectedHorizontals();
00099        Guides selectedVerticals();
00100 
00104        uint pageNr() const { return currentPage->pageNr(); }
00105 
00106 private:
00107        ScribusDoc* m_Doc;
00109        Page * currentPage;
00111        bool m_drawGuides;
00112 
00114        GuideGUIMap m_horMap;
00115        GuideGUIMap m_verMap;
00116 
00118        void unitChange();
00119 
00121        double docUnitRatio;
00122        int docUnitIndex;
00123        int docUnitDecimals;
00125        int docUnitPrecision;
00127        QString suffix;
00128 
00133        void setGuidesFromList(QListView *w, GuideGUIMap *map, Guides guides);
00134 
00140        bool addValueToList(QListView *list);
00145        bool editValueToList(QListView *list);
00146 
00151        bool deleteValueFormList(QListView *list);
00152 
00156        void copyGuidesToAllPages(GuideManagerCore::GuideType t);
00157 
00159        void drawGuides();
00160 
00164        void storePageValues(Page * page);
00165 
00169        void windowActivationChange(bool oldActive);
00170 
00173        Guides getAutoHorizontals();
00174 
00177        Guides getAutoVerticals();
00178 
00183        void resetSelectionForPage();
00184 
00185 protected slots:
00186        void addHorButton_clicked();
00187        void delHorButton_clicked();
00188        void addVerButton_clicked();
00189        void delVerButton_clicked();
00190        void applyToAllStdButton_clicked();
00191        void lockCheck_stateChanged( int );
00192        void horizontalAutoGapCheck_stateChanged( int );
00193        void verticalAutoGapCheck_stateChanged( int );
00194        void applyToAllAutoButton_clicked();
00195        void horizontalAutoCountSpin_valueChanged( int );
00196        void verticalAutoCountSpin_valueChanged( int );
00197        void horizontalAutoGapSpin_valueChanged(int);
00198        void verticalAutoGapSpin_valueChanged(int);
00199        void horizontalReferGroup_clicked( int );
00200        void verticalReferGroup_clicked( int );
00201        void tabWidget_currentChanged( QWidget * );
00202        void horizontalList_doubleClicked( QListViewItem * );
00203        void horizontalList_returnPressed( QListViewItem * );
00204        void verticalList_returnPressed( QListViewItem * );
00205        void verticalList_doubleClicked( QListViewItem * );
00206        void horizontalList_selectionChanged();
00207        void verticalList_selectionChanged();
00208        void deletePageButton_clicked();
00209        void deleteAllGuides_clicked();
00210 };
00211 
00212 #endif // GUIDEMANAGER_H