]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/printdlg.h
implement getLabelList
[lyx.git] / src / frontends / kde / printdlg.h
1 /**
2  * \file printdlg.h
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon
7  */
8
9 #ifndef PRINTDLG_H
10 #define PRINTDLG_H
11
12
13 #include "FormPrint.h"
14  
15 #include "dlg/printdlgdata.h"
16  
17 #include "support/lstrings.h"
18 #include "lyxrc.h" 
19 #include "PrinterParams.h"
20  
21 // FIXME: closeEvent 
22  
23 class PrintDialog : public PrintDialogData
24 {
25         Q_OBJECT
26 public:
27
28         PrintDialog(FormPrint * f, QWidget * parent = NULL, char const * name = NULL);
29         virtual ~PrintDialog();
30         
31         char const * getFrom() {
32                 return line_from->text();
33         }
34
35         char const * getTo() {
36                 return line_to->text();
37         }
38
39         PrinterParams::Target getTarget() {
40                 if (radio_toprinter->isChecked())
41                         return PrinterParams::PRINTER;
42                 else
43                         return PrinterParams::FILE;
44         }
45
46         char const * getPrinter() {
47                 return line_printername->text();
48         }
49
50         char const * getFile() {
51                 return line_filename->text();
52         }
53         
54         PrinterParams::WhichPages getWhichPages() {
55                 if (radio_oddpages->isChecked())
56                         return PrinterParams::ODD;
57                 else if (radio_evenpages->isChecked())
58                         return PrinterParams::EVEN;
59                 else
60                         return PrinterParams::ALL;
61         }
62
63         bool getReverse() {
64                 return check_reverse->isChecked();
65         }
66
67         bool getSort() {
68                 return check_sort->isChecked();
69         }
70
71         char const * getCount() {
72                 return line_count->text();
73         }
74
75         void setTarget(PrinterParams::Target t) {
76                 radio_toprinter->setChecked(t == PrinterParams::PRINTER);
77                 radio_tofile->setChecked(t != PrinterParams::PRINTER);
78         }
79          
80         void setPrinter(char const * name) {
81                 line_printername->setText(name);
82         } 
83  
84         void setFile(char const * name) {
85                 line_filename->setText(name);
86         }        
87  
88         void setWhichPages(PrinterParams::WhichPages wp) {
89                 switch (wp) {
90                         case PrinterParams::ALL:
91                                 radio_allpages->setChecked(true);
92                                 break;
93                         case PrinterParams::EVEN:
94                                 radio_evenpages->setChecked(true);
95                                 break;
96                         case PrinterParams::ODD:
97                                 radio_oddpages->setChecked(true);
98                                 break;
99                 }
100         }
101  
102         void setReverse(bool on) {
103                 check_reverse->setChecked(on);
104         }
105  
106         void setSort(bool on) {
107                 check_sort->setChecked(on);
108         }
109          
110         void setCount(int num) {
111                 line_count->setText(tostr(num).c_str());
112                 check_sort->setEnabled(num > 1);
113         }
114
115         void setFrom(char const * text) {
116                 line_from->setText(text);
117         }
118
119         void setTo(char const * text) {
120                 line_to->setText(text);
121         }
122
123 protected slots:
124  
125         void clickedCancel() {
126                 form_->CancelButton(); 
127         }
128  
129         void clickedPrint() {
130                 form_->OKButton();
131         }
132
133         /// open up the browser to select ps file 
134         void clickedBrowse();
135         
136         /// validate and change collate status
137         void changedCount(char const * text);
138  
139 private:
140         FormPrint * form_;
141 };
142 #endif // PRINTDLG_H