3 * Worldvisions Weaver Software:
4 * Copyright (C) 1997-2003 Net Integration Technologies, Inc.
6 * This is the PrintQueue class for handling various queue functions
8 * It is now just a simple data model and is no longer a stream because
9 * CUPS is taking care of the rest.
14 /* $Id: queue.h,v 1.20 2002/04/18 17:53:30 pphaneuf Exp $ */
16 #include <cups/cups.h>
18 #include <wvistreamlist.h>
19 #include <wvhashtable.h>
22 #include <wvcallback.h>
23 #include <wvfdstream.h>
26 class WvBaseCUPSManager
;
27 class PrintQueueIterator
;
33 PrintQueue(WvStringParm _name
, const UniConf _cfg
, WvLog
& _log
, bool _is_alias
= false);
35 virtual ~PrintQueue();
36 /* Here are the truly public members, as opposed to the "had to
37 * make them public so that something worked" public members. */
38 /* FIXME: Some of these should be virtual. Picking which one is
39 * left as an exercise to the reader. */
45 static PrintQueue
* new_queue(WvStringParm name
, const UniConf cfg
,
47 static PrintQueue
* new_alias(WvStringParm name
, const UniConf cfg
,
50 void set_cups_manager(WvBaseCUPSManager
*_cups
)
53 virtual bool cancel(int id
, WvStringParm agent
= "root");
54 unsigned int get_active_id() const;
55 size_t job_count() const;
56 bool job_exists(WvStringParm queuename
, int job_num
);
58 void set_default(void);
60 static WvString
ipp_state_to_string(ipp_pstate_t state
);
61 WvString
get_state(void);
64 * Modifies printjob list in such a way that it increases the effective
65 * priority of job_id to be 'top'. It will be the next spooled job in that
68 bool increase_priority(unsigned int job_id
);
71 * Return the current job list.
73 PrintJobList
& get_jobs();
75 bool get_is_alias(void)
79 /* this list is the cached version of the object returned by get_jobs() */
81 time_t refresh_interval
;
82 time_t last_refreshed
;
84 WvBaseCUPSManager
*cups
;
96 PrintQueueName(WvStringParm _name
, PrintQueue
* _queue
, bool _alias
= false,
97 bool _netprint
= false)
98 : name(_name
), alias(_alias
), netprint(_netprint
), queue(_queue
) {}
101 DeclareWvDict(PrintQueueName
, WvString
, name
);