~ubuntu-branches/ubuntu/karmic/photoprint/karmic

« back to all changes in this revision

Viewing changes to printerqueueswrapper.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Milan Zamazal
  • Date: 2007-05-01 16:32:13 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070501163213-ni1933khtg9fdvn5
Tags: 0.3.5-2
Move to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <iostream>
2
 
#include <stdio.h>
3
 
#include <stdlib.h>
4
 
#include <string.h>
5
 
 
6
 
#include "printerqueueswrapper.h"
7
 
 
8
 
using namespace std;
9
 
 
10
 
PrinterQueues::PrinterQueues()
11
 
{
 
1
#include <iostream>
 
2
#include <stdio.h>
 
3
#include <stdlib.h>
 
4
#include <string.h>
 
5
 
 
6
#include "printerqueueswrapper.h"
 
7
#include "support/generaldialogs.h"
 
8
 
 
9
using namespace std;
 
10
 
 
11
static char *getfilename(void *userdata)
 
12
{
 
13
        return(File_Save_Dialog("Save printer spool file",NULL));
 
14
}
 
15
 
 
16
 
 
17
PrinterQueues::PrinterQueues()
 
18
{
12
19
        queues=pqinfo_create();
13
 
}
14
 
 
15
 
PrinterQueues::~PrinterQueues()
 
20
        queues->SetGetFilenameCallback(queues,getfilename,NULL);
 
21
}
 
22
 
 
23
 
 
24
PrinterQueues::~PrinterQueues()
16
25
{
17
 
        cerr << "Disposing of printer queues\n" << endl;
 
26
        cerr << "Disposing of printer queues\n" << endl;
18
27
        if(queues)
19
28
                queues->Dispose(queues);
20
29
        cerr << "Done" << endl;
21
 
}
22
 
 
23
 
 
24
 
char *PrinterQueues::GetPrinterName(int idx)
25
 
{
 
30
}
 
31
 
 
32
 
 
33
char *PrinterQueues::GetPrinterName(int idx)
 
34
{
26
35
        return(queues->GetPrinterName(queues,idx));
27
 
}
28
 
 
29
 
 
30
 
int PrinterQueues::GetPrinterCount()
31
 
{
32
 
        return(queues->GetPrinterCount(queues));
33
 
}
34
 
 
35
 
 
36
 
char *PrinterQueues::GetPrinterDriver(const char *printername)
37
 
{
38
 
        queues->SetPrinterQueue(queues,printername);
39
 
        return(queues->GetDriver(queues));
40
 
}
 
36
}
 
37
 
 
38
 
 
39
int PrinterQueues::GetPrinterCount()
 
40
{
 
41
        return(queues->GetPrinterCount(queues));
 
42
}
 
43
 
 
44
 
 
45
char *PrinterQueues::GetPrinterDriver(const char *printername)
 
46
{
 
47
        queues->SetPrinterQueue(queues,printername);
 
48
        return(queues->GetDriver(queues));
 
49
}
 
50
 
 
51
 
 
52
char *PrinterQueues::GetPrinterDriver()
 
53
{
 
54
        return(queues->GetDriver(queues));
 
55
}
 
56
 
 
57
 
 
58
struct pqinfo *PrinterQueues::GetPQInfo()
 
59
{
 
60
        return(queues);
 
61
}
 
62
 
 
63
 
 
64
const char *PrinterQueues::GetPrinterQueue()
 
65
{
 
66
        return(queues->GetPrinterQueue(queues));
 
67
}
 
68
 
 
69
 
 
70
void PrinterQueues::SetPrinterQueue(const char *queue)
 
71
{
 
72
        queues->SetPrinterQueue(queues,queue);
 
73
}
 
74
 
 
75
 
 
76
char *PrinterQueues::GetDriver()
 
77
{
 
78
        return(queues->GetDriver(queues));
 
79
}
 
80
 
 
81
 
 
82
char *PrinterQueues::GetPPD()
 
83
{
 
84
        return(queues->GetPPD(queues));
 
85
}
 
86
 
 
87
 
 
88
const char *PrinterQueues::GetCustomCommand()
 
89
{
 
90
#ifndef WIN32
 
91
        return(queues->GetCustomCommand(queues));
 
92
#else
 
93
        return(NULL);
 
94
#endif
 
95
}
 
96
 
 
97
 
 
98
void PrinterQueues::SetCustomCommand(const char *cmd)
 
99
{
 
100
#ifndef WIN32
 
101
        queues->SetCustomCommand(queues,cmd);
 
102
#endif
 
103
}
 
104
 
 
105
 
 
106
bool PrinterQueues::InitialiseJob()
 
107
{
 
108
        return(queues->InitialiseJob(queues)!=0);
 
109
}
 
110
 
 
111
 
 
112
void PrinterQueues::InitialisePage()
 
113
{
 
114
        queues->InitialisePage(queues);
 
115
}
 
116
 
 
117
 
 
118
void PrinterQueues::EndPage()
 
119
{
 
120
        queues->EndPage(queues);
 
121
}
 
122
 
 
123
 
 
124
void PrinterQueues::EndJob()
 
125
{
 
126
        queues->EndJob(queues);
 
127
}
 
128
 
 
129
 
 
130
void PrinterQueues::CancelJob()
 
131
{
 
132
        queues->CancelJob(queues);
 
133
}
 
134
 
 
135
 
 
136
int PrinterQueues::WriteData(const char *data,int bytecount)
 
137
{
 
138
        return(queues->WriteData(queues,data,bytecount));
 
139
}
 
140
 
 
141