root/trunk/src/IPrintView.h

Revision 233, 10.4 kB (checked in by jordi, 2 years ago)

The JobPrint? now implements the new Resolution and ColorMode?.

Line 
1 // ePDFView - A lightweight PDF Viewer.
2 // Copyright (C) 2006 Emma's Software.
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18 #if !defined (__IPRINT_VIEW_H__)
19 #define __IPRINT_VIEW_H__
20
21 namespace ePDFView
22 {
23     // Forward declarations.
24     class PrintPter;
25
26     ///
27     /// @class IPrintView
28     /// @brief Interface for the print view.
29     ///
30     class IPrintView
31     {
32         public:
33             ///
34             /// @brief Destroys all allocated memory for IPrint.
35             ///
36             virtual ~IPrintView (void)
37             {
38             }
39
40             ///
41             /// @brief Gets the view's presenter.
42             ///
43             /// @return The presenter that is controlling the view.
44             ///
45             PrintPter *getPresenter (void)
46             {
47                 return m_Pter;
48             }
49
50             ///
51             /// @brief Sets the view's presenter.
52             ///
53             /// After setting the presenter, the view can show the
54             /// print dialog.
55             ///
56             /// @param pter The presenter that will control the view.
57             ///
58             virtual void setPresenter (PrintPter *pter)
59             {
60                 m_Pter = pter;
61             }
62
63             ///
64             /// @brief Adds a new color model to the list.
65             ///
66             /// @param name The possibly translated name of the color model.
67             /// @param value The value the ePDFView internally uses to know
68             ///              which colorModel is.
69             ///
70             virtual void addColorModel (const gchar *name,
71                                         const gchar *value) = 0;
72  
73
74             ///
75             /// @brief Adds a new page size to the list.
76             ///
77             /// @param name The possibly translated name of the page size.
78             /// @param value The value the ePDFView internally uses to know
79             ///              which page size is.
80             ///
81             virtual void addPageSize (const gchar *name,
82                                       const gchar *value) = 0;
83
84             ///
85             /// @brief Adds a new printer to the list of printer.
86             ///
87             /// The presenter will get the list of printers from the
88             /// system and call this function for each one it finds.
89             ///
90             /// @param name The name of the printer.
91             /// @param job The number of jobs the printer currently has active.
92             /// @param state The current printer's state.
93             /// @param location The printer's location.
94             ///
95             virtual void addPrinter (const gchar *name, gint jobs,
96                                      const gchar *state,
97                                      const gchar *location) = 0;
98
99             ///
100             /// @brief Adds a new resolution to the list.
101             ///
102             /// @param name The possibly translated name of the resolution.
103             /// @param value The value the ePDFView internally uses to know
104             ///              which resolution is.
105             ///
106             virtual void addResolution (const gchar *name,
107                                         const gchar *value) = 0;
108
109             ///
110             /// @brief Deletes all color models from the list of color modes.
111             ///
112             virtual void clearColorModelList (void) = 0;
113
114             ///
115             /// @brief Deletes all sizes from the list of page sizes.
116             ///
117             virtual void clearPageSizeList (void) = 0;
118
119             ///
120             /// @brief Deletes all resolutions from the list of resolutions.
121             ///
122             virtual void clearResolutionList (void) = 0;
123
124             ///
125             /// @brief Gets the currently selected color model.
126             ///
127             /// @return The value of the color model that is selected.
128             ///
129             virtual gchar *getColorModel (void) = 0;
130
131             ///
132             /// @brief Gets the number of copies to do.
133             ///
134             /// @return The number of copies of the document to print. The
135             ///         range is between 1 and 999.
136             ///
137             virtual guint getNumberOfCopies (void) = 0;
138
139             ///
140             /// @brief Gets the page layout.
141             ///
142             /// @return The selected page layout's value.
143             ///
144             virtual PrintPageLayout getPageLayout (void) = 0;
145
146             ///
147             /// @brief Gets the page orientation.
148             ///
149             /// @return The selected page orientation's value.
150             ///
151             virtual PrintPageOrientation getPageOrientation (void) = 0;
152
153             ///
154             /// @brief Gets the entred page range.
155             ///
156             /// @return The entered text in the page range entry.
157             ///
158             virtual const gchar *getPageRange (void) = 0;
159
160             ///
161             /// @brief Gets the currently selected page size.
162             ///
163             /// @return The name of the page size that is selected. This name
164             ///         is the @a value parameter of the addPageSize()
165             ///         function.
166             ///
167             virtual gchar *getPageSize (void) = 0;
168
169             ///
170             /// @brief Gets the currently selected resolution.
171             ///
172             /// @return The value of the resolution that is selected.
173             ///         This value is the @a value parameter of the
174             ///         addResolution() function.
175             ///
176             virtual gchar *getResolution (void) = 0;
177
178             ///
179             /// @brief Gets the name of the currently selected printer.
180             ///
181             /// @return The name of the printer that is currently selected.
182             ///         The name returned is the same as the name passed
183             ///         to the view using the addPrinter() function.
184             ///
185             virtual gchar *getSelectedPrinterName (void) = 0;
186
187             ///
188             /// @brief Checks if the "Collate" option is checked.
189             ///
190             /// @return TRUE if the "Collate" option is checked.
191             ///         FALSE otherwise.
192             ///
193             virtual gboolean isCheckedCollate (void) = 0;
194
195             ///
196             /// @brief Checks if the "All Pages" range option is selected.
197             ///
198             /// @return TRUE if the range's "All Pages" option is selected.
199             ///         FALSE otherwise.
200             ///
201             virtual gboolean isSelectedAllPagesRangeOption (void) = 0;
202
203             ///
204             /// @brief Checks if the "Even Page" set option is selected.
205             ///
206             /// @return TRUE if the set's "Even Page" option is selected.
207             ///         FALSE otherwise.
208             ///
209             virtual gboolean isSelectedEvenPageSet (void) = 0;
210
211             ///
212             /// @brief Checks if the "Odd Page" set option is selected.
213             ///
214             /// @return TRUE if the set's "Odd Page" option is selected.
215             ///         FALSE otherwise.
216             ///
217             virtual gboolean isSelectedOddPageSet (void) = 0;
218
219             ///
220             /// @brief Select a color model.
221             ///
222             /// @param colorModelIndex The index of the color model to select.
223             ///
224             virtual void selectColorModel (guint colorModelIndex) = 0;
225
226             ///
227             /// @brief Selects a page size.
228             ///
229             /// @param pageSizeIndex The index of the page size to select.
230             ///
231             virtual void selectPageSize (guint pageSizeIndex) = 0;
232
233             ///
234             /// @brief Selects a printer from the list.
235             ///
236             /// @param printerIndex The index of the printer to select.
237             ///
238             virtual void selectPrinter (guint printerIndex) = 0;
239
240             ///
241             /// @brief Selects a page size.
242             ///
243             /// @param resolutionIndex The index of the resolution to select.
244             ///
245             virtual void selectResolution (guint resolutionIndex) = 0;
246
247             ///
248             /// @brief Changes the sensitivity of the "Collate" option.
249             ///
250             /// The view must change the sensitivity (it's called enabled or
251             /// disabled on some toolkits) of the "Collate" option.
252             ///
253             /// @param sensitive Set to TRUE to make sensitive (enable) the
254             ///                  option or FALSE to insensitive (disable) it.
255             ///
256             virtual void sensitiveCollate (gboolean sensitive) = 0;
257
258             ///
259             /// @brief Changes the sensitivity of the "Page Range" entry.
260             ///
261             /// The view must change the sensitivity (it's called enabled or
262             /// disabled on some toolkits) of the "Page Range" entry.
263             ///
264             /// @param sensitive Set to TRUE if need to make sensitive (enable)
265             ///                  the entry or FALSE to insensitive (disable) it.
266             ///
267             virtual void sensitivePageRange (gboolean sensitive) = 0;
268
269             ///
270             /// @brief Changes the sensitivity of the "Print" button.
271             ///
272             /// The view must change the sensitivity (it's called enabled or
273             /// disabled on some toolkits) of the "Print" button.
274             ///
275             /// @param sensitive Set to TRUE if need to sensitive (enable) the
276             ///                  button or FALSE to insensitive (disable) it.
277             ///
278             virtual void sensitivePrintButton (gboolean sensitive) = 0;
279
280
281         protected:
282             /// The presenter that controls the view.
283             PrintPter *m_Pter;
284
285             ///
286             /// @brief Constructs a new IPrintView object.
287             ///
288             IPrintView (void)
289             {
290                 m_Pter = NULL;
291             }
292     };
293 }
294
295 #endif // !__IPRINT_VIEW_H__
Note: See TracBrowser for help on using the browser.