Back to index

texmacs  1.0.7.15
QTMPrintDialog.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002  * MODULE     : QTMPrintDialog.hpp
00003  * DESCRIPTION: 
00004  * COPYRIGHT  : (C) 2010 Miguel de Benito Delgado
00005  *******************************************************************************
00006  * This software falls under the GNU general public license version 3 or later.
00007  * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00008  * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00009  ******************************************************************************/
00010 
00011 // Actual code follows the pasted one. Life's sad without uic...
00012 
00013 /********************************************************************************
00014  ** Form generated from reading UI file 'QTMPrintDialog.ui'
00015  **
00016  ** Created: Sat Dec 18 20:23:41 2010
00017  **      by: Qt User Interface Compiler version 4.7.1
00018  **
00019  ** WARNING! All changes made in this file will be lost when recompiling UI file!
00020  ********************************************************************************/
00021 
00022 #ifndef UI_QTMPRINTDIALOG_H
00023 #define UI_QTMPRINTDIALOG_H
00024 
00025 #include <QtCore/QLocale>
00026 #include <QtCore/QVariant>
00027 #include <QtGui/QAction>
00028 #include <QtGui/QApplication>
00029 #include <QtGui/QButtonGroup>
00030 #include <QtGui/QCheckBox>
00031 #include <QtGui/QComboBox>
00032 #include <QtGui/QDialog>
00033 #include <QtGui/QDialogButtonBox>
00034 #include <QtGui/QFrame>
00035 #include <QtGui/QGridLayout>
00036 #include <QtGui/QHBoxLayout>
00037 #include <QtGui/QHeaderView>
00038 #include <QtGui/QLabel>
00039 #include <QtGui/QLineEdit>
00040 #include <QtGui/QRadioButton>
00041 #include <QtGui/QSpacerItem>
00042 #include <QtGui/QVBoxLayout>
00043 
00044 QT_BEGIN_NAMESPACE
00045 
00046 class Ui_QTMPrintDialog
00047 {
00048 public:
00049   QVBoxLayout *verticalLayout;
00050   QGridLayout *gridLayout_3;
00051   QComboBox *printerCombo;
00052   QLabel *label_3;
00053   QLineEdit *copiesInput;
00054   QCheckBox *collatedCheck;
00055   QHBoxLayout *horizontalLayout_2;
00056   QGridLayout *gridLayout_2;
00057   QLabel *label_7;
00058   QRadioButton *allPagesRadio;
00059   QRadioButton *rangePagesRadio;
00060   QLineEdit *fromPageInput;
00061   QLabel *label_4;
00062   QLineEdit *toPageInput;
00063   QCheckBox *evenPagesCheck;
00064   QCheckBox *oddPagesCheck;
00065   QFrame *line;
00066   QHBoxLayout *horizontalLayout;
00067   QSpacerItem *horizontalSpacer_2;
00068   QGridLayout *gridLayout;
00069   QLabel *paperSizeLabel;
00070   QComboBox *paperSizeCombo;
00071   QLabel *label_2;
00072   QComboBox *orientationCombo;
00073   QLabel *resolutionLabel;
00074   QComboBox *resolutionCombo;
00075   QSpacerItem *horizontalSpacer;
00076   QHBoxLayout *horizontalLayout_3;
00077   QSpacerItem *horizontalSpacer_3;
00078   QCheckBox *duplexCheck;
00079   QSpacerItem *horizontalSpacer_5;
00080   QCheckBox *fitToPageCheck;
00081   QSpacerItem *horizontalSpacer_4;
00082   QGridLayout *gridLayout_4;
00083   QLabel *label_5;
00084   QComboBox *pagesPerSideCombo;
00085   QLabel *label_6;
00086   QComboBox *orderPagesCombo;
00087   QFrame *line_2;
00088   QCheckBox *blackWhiteCheck;
00089   QDialogButtonBox *buttonBox;
00090   
00091   void setupUi(QDialog *QTMPrintDialog)
00092   {
00093     if (QTMPrintDialog->objectName().isEmpty())
00094       QTMPrintDialog->setObjectName(QString::fromUtf8("QTMPrintDialog"));
00095     QTMPrintDialog->setWindowModality(Qt::WindowModal);
00096     QTMPrintDialog->resize(527, 475);
00097     QTMPrintDialog->setMinimumSize(QSize(527, 475));
00098     QTMPrintDialog->setWindowOpacity(1);
00099     QTMPrintDialog->setLocale(QLocale(QLocale::English, QLocale::UnitedStates));
00100     QTMPrintDialog->setSizeGripEnabled(true);
00101     QTMPrintDialog->setModal(true);
00102     verticalLayout = new QVBoxLayout(QTMPrintDialog);
00103     verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
00104     gridLayout_3 = new QGridLayout();
00105     gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3"));
00106     printerCombo = new QComboBox(QTMPrintDialog);
00107     printerCombo->setObjectName(QString::fromUtf8("printerCombo"));
00108     printerCombo->setMinimumSize(QSize(331, 26));
00109     
00110     gridLayout_3->addWidget(printerCombo, 0, 0, 1, 3);
00111     
00112     label_3 = new QLabel(QTMPrintDialog);
00113     label_3->setObjectName(QString::fromUtf8("label_3"));
00114     
00115     gridLayout_3->addWidget(label_3, 1, 0, 1, 1);
00116     
00117     copiesInput = new QLineEdit(QTMPrintDialog);
00118     copiesInput->setObjectName(QString::fromUtf8("copiesInput"));
00119     copiesInput->setMaximumSize(QSize(81, 16777215));
00120     
00121     gridLayout_3->addWidget(copiesInput, 1, 1, 1, 1);
00122     
00123     collatedCheck = new QCheckBox(QTMPrintDialog);
00124     collatedCheck->setObjectName(QString::fromUtf8("collatedCheck"));
00125     collatedCheck->setEnabled(false);
00126     collatedCheck->setChecked(true);
00127     
00128     gridLayout_3->addWidget(collatedCheck, 1, 2, 1, 1);
00129     
00130     
00131     verticalLayout->addLayout(gridLayout_3);
00132     
00133     horizontalLayout_2 = new QHBoxLayout();
00134     horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
00135     gridLayout_2 = new QGridLayout();
00136     gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
00137     label_7 = new QLabel(QTMPrintDialog);
00138     label_7->setObjectName(QString::fromUtf8("label_7"));
00139     
00140     gridLayout_2->addWidget(label_7, 0, 0, 1, 1);
00141     
00142     allPagesRadio = new QRadioButton(QTMPrintDialog);
00143     allPagesRadio->setObjectName(QString::fromUtf8("allPagesRadio"));
00144     allPagesRadio->setChecked(true);
00145     
00146     gridLayout_2->addWidget(allPagesRadio, 0, 1, 1, 1);
00147     
00148     rangePagesRadio = new QRadioButton(QTMPrintDialog);
00149     rangePagesRadio->setObjectName(QString::fromUtf8("rangePagesRadio"));
00150     
00151     gridLayout_2->addWidget(rangePagesRadio, 1, 1, 1, 1);
00152     
00153     fromPageInput = new QLineEdit(QTMPrintDialog);
00154     fromPageInput->setObjectName(QString::fromUtf8("fromPageInput"));
00155     QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
00156     sizePolicy.setHorizontalStretch(0);
00157     sizePolicy.setVerticalStretch(0);
00158     sizePolicy.setHeightForWidth(fromPageInput->sizePolicy().hasHeightForWidth());
00159     fromPageInput->setSizePolicy(sizePolicy);
00160     fromPageInput->setMaximumSize(QSize(81, 22));
00161     
00162     gridLayout_2->addWidget(fromPageInput, 1, 2, 1, 1);
00163     
00164     label_4 = new QLabel(QTMPrintDialog);
00165     label_4->setObjectName(QString::fromUtf8("label_4"));
00166     
00167     gridLayout_2->addWidget(label_4, 1, 3, 1, 1);
00168     
00169     toPageInput = new QLineEdit(QTMPrintDialog);
00170     toPageInput->setObjectName(QString::fromUtf8("toPageInput"));
00171     toPageInput->setMaximumSize(QSize(81, 22));
00172     
00173     gridLayout_2->addWidget(toPageInput, 1, 4, 1, 1);
00174     
00175     evenPagesCheck = new QCheckBox(QTMPrintDialog);
00176     evenPagesCheck->setObjectName(QString::fromUtf8("evenPagesCheck"));
00177     evenPagesCheck->setChecked(true);
00178     
00179     gridLayout_2->addWidget(evenPagesCheck, 0, 2, 1, 1);
00180     
00181     oddPagesCheck = new QCheckBox(QTMPrintDialog);
00182     oddPagesCheck->setObjectName(QString::fromUtf8("oddPagesCheck"));
00183     oddPagesCheck->setChecked(true);
00184     
00185     gridLayout_2->addWidget(oddPagesCheck, 0, 4, 1, 1);
00186     
00187     
00188     horizontalLayout_2->addLayout(gridLayout_2);
00189     
00190     
00191     verticalLayout->addLayout(horizontalLayout_2);
00192     
00193     line = new QFrame(QTMPrintDialog);
00194     line->setObjectName(QString::fromUtf8("line"));
00195     line->setFrameShape(QFrame::HLine);
00196     line->setFrameShadow(QFrame::Sunken);
00197     
00198     verticalLayout->addWidget(line);
00199     
00200     horizontalLayout = new QHBoxLayout();
00201     horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
00202     horizontalSpacer_2 = new QSpacerItem(30, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
00203     
00204     horizontalLayout->addItem(horizontalSpacer_2);
00205     
00206     gridLayout = new QGridLayout();
00207     gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
00208     paperSizeLabel = new QLabel(QTMPrintDialog);
00209     paperSizeLabel->setObjectName(QString::fromUtf8("paperSizeLabel"));
00210     
00211     gridLayout->addWidget(paperSizeLabel, 0, 0, 1, 1);
00212     
00213     paperSizeCombo = new QComboBox(QTMPrintDialog);
00214     paperSizeCombo->setObjectName(QString::fromUtf8("paperSizeCombo"));
00215     paperSizeCombo->setMinimumSize(QSize(200, 26));
00216     
00217     gridLayout->addWidget(paperSizeCombo, 0, 1, 1, 1);
00218     
00219     label_2 = new QLabel(QTMPrintDialog);
00220     label_2->setObjectName(QString::fromUtf8("label_2"));
00221     
00222     gridLayout->addWidget(label_2, 1, 0, 1, 1);
00223     
00224     orientationCombo = new QComboBox(QTMPrintDialog);
00225     orientationCombo->setObjectName(QString::fromUtf8("orientationCombo"));
00226     orientationCombo->setMinimumSize(QSize(200, 26));
00227     
00228     gridLayout->addWidget(orientationCombo, 1, 1, 1, 1);
00229     
00230     resolutionLabel = new QLabel(QTMPrintDialog);
00231     resolutionLabel->setObjectName(QString::fromUtf8("resolutionLabel"));
00232     
00233     gridLayout->addWidget(resolutionLabel, 2, 0, 1, 1);
00234     
00235     resolutionCombo = new QComboBox(QTMPrintDialog);
00236     resolutionCombo->setObjectName(QString::fromUtf8("resolutionCombo"));
00237     resolutionCombo->setMinimumSize(QSize(200, 26));
00238     
00239     gridLayout->addWidget(resolutionCombo, 2, 1, 1, 1);
00240     
00241     
00242     horizontalLayout->addLayout(gridLayout);
00243     
00244     horizontalSpacer = new QSpacerItem(30, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
00245     
00246     horizontalLayout->addItem(horizontalSpacer);
00247     
00248     
00249     verticalLayout->addLayout(horizontalLayout);
00250     
00251     horizontalLayout_3 = new QHBoxLayout();
00252     horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3"));
00253     horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
00254     
00255     horizontalLayout_3->addItem(horizontalSpacer_3);
00256     
00257     duplexCheck = new QCheckBox(QTMPrintDialog);
00258     duplexCheck->setObjectName(QString::fromUtf8("duplexCheck"));
00259     duplexCheck->setEnabled(false);
00260     duplexCheck->setMinimumSize(QSize(0, 31));
00261     duplexCheck->setLocale(QLocale(QLocale::English, QLocale::UnitedStates));
00262     
00263     horizontalLayout_3->addWidget(duplexCheck);
00264     
00265     horizontalSpacer_5 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
00266     
00267     horizontalLayout_3->addItem(horizontalSpacer_5);
00268     
00269     fitToPageCheck = new QCheckBox(QTMPrintDialog);
00270     fitToPageCheck->setObjectName(QString::fromUtf8("fitToPageCheck"));
00271     fitToPageCheck->setChecked(true);
00272     
00273     horizontalLayout_3->addWidget(fitToPageCheck);
00274     
00275     horizontalSpacer_4 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
00276     
00277     horizontalLayout_3->addItem(horizontalSpacer_4);
00278     
00279     
00280     verticalLayout->addLayout(horizontalLayout_3);
00281     
00282     gridLayout_4 = new QGridLayout();
00283     gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4"));
00284     label_5 = new QLabel(QTMPrintDialog);
00285     label_5->setObjectName(QString::fromUtf8("label_5"));
00286     
00287     gridLayout_4->addWidget(label_5, 0, 0, 1, 1);
00288     
00289     pagesPerSideCombo = new QComboBox(QTMPrintDialog);
00290     pagesPerSideCombo->setObjectName(QString::fromUtf8("pagesPerSideCombo"));
00291     
00292     gridLayout_4->addWidget(pagesPerSideCombo, 0, 1, 1, 1);
00293     
00294     label_6 = new QLabel(QTMPrintDialog);
00295     label_6->setObjectName(QString::fromUtf8("label_6"));
00296     
00297     gridLayout_4->addWidget(label_6, 1, 0, 1, 1);
00298     
00299     orderPagesCombo = new QComboBox(QTMPrintDialog);
00300     orderPagesCombo->setObjectName(QString::fromUtf8("orderPagesCombo"));
00301     orderPagesCombo->setMinimumSize(QSize(211, 26));
00302     
00303     gridLayout_4->addWidget(orderPagesCombo, 1, 1, 1, 1);
00304     
00305     
00306     verticalLayout->addLayout(gridLayout_4);
00307     
00308     line_2 = new QFrame(QTMPrintDialog);
00309     line_2->setObjectName(QString::fromUtf8("line_2"));
00310     line_2->setFrameShape(QFrame::HLine);
00311     line_2->setFrameShadow(QFrame::Sunken);
00312     
00313     verticalLayout->addWidget(line_2);
00314     
00315     blackWhiteCheck = new QCheckBox(QTMPrintDialog);
00316     blackWhiteCheck->setObjectName(QString::fromUtf8("blackWhiteCheck"));
00317     blackWhiteCheck->setEnabled(false);
00318     blackWhiteCheck->setChecked(true);
00319     
00320     verticalLayout->addWidget(blackWhiteCheck);
00321     
00322     buttonBox = new QDialogButtonBox(QTMPrintDialog);
00323     buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
00324     buttonBox->setOrientation(Qt::Horizontal);
00325     buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
00326     
00327     verticalLayout->addWidget(buttonBox);
00328     
00329 #ifndef QT_NO_SHORTCUT
00330     label_3->setBuddy(copiesInput);
00331     label_7->setBuddy(allPagesRadio);
00332     label_4->setBuddy(toPageInput);
00333     paperSizeLabel->setBuddy(paperSizeCombo);
00334     label_2->setBuddy(orientationCombo);
00335     resolutionLabel->setBuddy(resolutionCombo);
00336     label_5->setBuddy(pagesPerSideCombo);
00337     label_6->setBuddy(orderPagesCombo);
00338 #endif // QT_NO_SHORTCUT
00339     QWidget::setTabOrder(printerCombo, copiesInput);
00340     QWidget::setTabOrder(copiesInput, allPagesRadio);
00341     QWidget::setTabOrder(allPagesRadio, rangePagesRadio);
00342     QWidget::setTabOrder(rangePagesRadio, fromPageInput);
00343     QWidget::setTabOrder(fromPageInput, toPageInput);
00344     QWidget::setTabOrder(toPageInput, evenPagesCheck);
00345     QWidget::setTabOrder(evenPagesCheck, oddPagesCheck);
00346     QWidget::setTabOrder(oddPagesCheck, collatedCheck);
00347     QWidget::setTabOrder(collatedCheck, paperSizeCombo);
00348     QWidget::setTabOrder(paperSizeCombo, orientationCombo);
00349     QWidget::setTabOrder(orientationCombo, resolutionCombo);
00350     QWidget::setTabOrder(resolutionCombo, duplexCheck);
00351     QWidget::setTabOrder(duplexCheck, fitToPageCheck);
00352     QWidget::setTabOrder(fitToPageCheck, pagesPerSideCombo);
00353     QWidget::setTabOrder(pagesPerSideCombo, orderPagesCombo);
00354     QWidget::setTabOrder(orderPagesCombo, blackWhiteCheck);
00355     QWidget::setTabOrder(blackWhiteCheck, buttonBox);
00356     
00357     retranslateUi(QTMPrintDialog);
00358     QObject::connect(buttonBox, SIGNAL(accepted()), QTMPrintDialog, SLOT(accept()));
00359     QObject::connect(buttonBox, SIGNAL(rejected()), QTMPrintDialog, SLOT(reject()));
00360     
00361     QMetaObject::connectSlotsByName(QTMPrintDialog);
00362   } // setupUi
00363   
00364   void retranslateUi(QDialog *QTMPrintDialog)
00365   {
00366     QTMPrintDialog->setWindowTitle(QApplication::translate("QTMPrintDialog", "Print", 0, QApplication::UnicodeUTF8));
00367     label_3->setText(QApplication::translate("QTMPrintDialog", "Copies:", 0, QApplication::UnicodeUTF8));
00368     copiesInput->setText(QApplication::translate("QTMPrintDialog", "1", 0, QApplication::UnicodeUTF8));
00369     collatedCheck->setText(QApplication::translate("QTMPrintDialog", "Collated", 0, QApplication::UnicodeUTF8));
00370     label_7->setText(QApplication::translate("QTMPrintDialog", "Pages:", 0, QApplication::UnicodeUTF8));
00371     allPagesRadio->setText(QApplication::translate("QTMPrintDialog", "All", 0, QApplication::UnicodeUTF8));
00372     rangePagesRadio->setText(QApplication::translate("QTMPrintDialog", "From:", 0, QApplication::UnicodeUTF8));
00373     fromPageInput->setText(QApplication::translate("QTMPrintDialog", "1", 0, QApplication::UnicodeUTF8));
00374     label_4->setText(QApplication::translate("QTMPrintDialog", "To:", 0, QApplication::UnicodeUTF8));
00375     toPageInput->setText(QApplication::translate("QTMPrintDialog", "1", 0, QApplication::UnicodeUTF8));
00376     evenPagesCheck->setText(QApplication::translate("QTMPrintDialog", "Even", 0, QApplication::UnicodeUTF8));
00377     oddPagesCheck->setText(QApplication::translate("QTMPrintDialog", "Odd", 0, QApplication::UnicodeUTF8));
00378     paperSizeLabel->setText(QApplication::translate("QTMPrintDialog", "Paper size:", 0, QApplication::UnicodeUTF8));
00379     label_2->setText(QApplication::translate("QTMPrintDialog", "Orientation:", 0, QApplication::UnicodeUTF8));
00380     resolutionLabel->setText(QApplication::translate("QTMPrintDialog", "Resolution:", 0, QApplication::UnicodeUTF8));
00381     duplexCheck->setText(QApplication::translate("QTMPrintDialog", "Print on both sides", 0, QApplication::UnicodeUTF8));
00382     fitToPageCheck->setText(QApplication::translate("QTMPrintDialog", "Fit to page", 0, QApplication::UnicodeUTF8));
00383     label_5->setText(QApplication::translate("QTMPrintDialog", "Pages per side:", 0, QApplication::UnicodeUTF8));
00384     pagesPerSideCombo->clear();
00385     pagesPerSideCombo->insertItems(0, QStringList()
00386                                    << QApplication::translate("QTMPrintDialog", "1", 0, QApplication::UnicodeUTF8)
00387                                    << QApplication::translate("QTMPrintDialog", "2", 0, QApplication::UnicodeUTF8)
00388                                    << QApplication::translate("QTMPrintDialog", "4", 0, QApplication::UnicodeUTF8)
00389                                    << QApplication::translate("QTMPrintDialog", "6", 0, QApplication::UnicodeUTF8)
00390                                    << QApplication::translate("QTMPrintDialog", "9", 0, QApplication::UnicodeUTF8)
00391                                    << QApplication::translate("QTMPrintDialog", "16", 0, QApplication::UnicodeUTF8)
00392                                    );
00393     label_6->setText(QApplication::translate("QTMPrintDialog", "Order:", 0, QApplication::UnicodeUTF8));
00394     blackWhiteCheck->setText(QApplication::translate("QTMPrintDialog", "Print in black and white", 0, QApplication::UnicodeUTF8));
00395   } // retranslateUi
00396   
00397 };
00398 
00399 namespace Ui {
00400   class QTMPrintDialog: public Ui_QTMPrintDialog {};
00401 } // namespace Ui
00402 
00403 QT_END_NAMESPACE
00404 
00405 #endif // UI_QTMPRINTDIALOG_H
00406 
00407 
00408 #ifndef QTMPRINTDIALOG_HPP
00409 #define QTMPRINTDIALOG_HPP
00410 
00411 #include <QDialog>
00412 //#include "ui_QTMPrintdialog.h"   // life's sad without uic...
00413 #include "QTMPrinterSettings.hpp"
00414 
00415 class QPrinter;
00416 
00424 class QTMPrintDialog : public QDialog, protected Ui::QTMPrintDialog
00425 {
00426   Q_OBJECT
00427   
00428 public:
00429   QTMPrintDialog(QTMPrinterSettings* s, QDialog* parent=0);
00430   void setupUi(QDialog *dia);
00431 
00432 public slots:
00433   void accept();
00434   void reject();
00435   
00436 protected slots:
00437   void updatePrinterCapabilities();
00438   // Auto connections:
00439   void on_allPagesRadio_clicked(bool);
00440   void on_rangePagesRadio_clicked(bool);
00441   void on_copiesInput_textChanged(const QString& );
00442   void on_fromPageInput_textChanged(const QString& );
00443   void on_toPageInput_textChanged(const QString& );
00444   void on_oddPagesCheck_stateChanged(int state);
00445   void on_evenPagesCheck_stateChanged(int state);
00446   
00447 protected:
00448   QTMPrinterSettings* _settings;
00449 };
00450 
00451 #endif // QTMPRINTDIALOG_HPP