~ubuntu-branches/ubuntu/saucy/print-manager/saucy-proposed

« back to all changes in this revision

Viewing changes to printqueue/PrintQueueModel.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-08-21 12:30:49 UTC
  • mto: (1.3.2)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: package-import@ubuntu.com-20120821123049-c8uky0a9gmfkck87
Tags: upstream-0.1.0+git20120821
ImportĀ upstreamĀ versionĀ 0.1.0+git20120821

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
2
 *   Copyright (C) 2010 by Daniel Nicoletti                                *
3
 
 *   dantti85-pk@yahoo.com.br                                              *
 
3
 *   dantti12@gmail.com                                                    *
4
4
 *                                                                         *
5
5
 *   This program is free software; you can redistribute it and/or modify  *
6
6
 *   it under the terms of the GNU General Public License as published by  *
61
61
        LastColumn
62
62
    } Columns;
63
63
 
64
 
    PrintQueueModel(const QString &destName, WId parentId, QObject *parent = 0);
 
64
    explicit PrintQueueModel(const QString &destName, WId parentId, QObject *parent = 0);
 
65
    void init();
65
66
    QString processingJob() const;
66
67
 
67
68
    Qt::ItemFlags flags(const QModelIndex &index) const;
77
78
    void setWhichJobs(int whichjobs);
78
79
    KCupsRequest* modifyJob(int row, JobAction action, const QString &newDestName = QString(), const QModelIndex &parent = QModelIndex());
79
80
 
80
 
public slots:
 
81
private slots:
 
82
    void getJobs();
81
83
    void getJobFinished();
82
 
    void updateModel();
 
84
 
 
85
    void createSubscription();
 
86
    void createSubscriptionFinished();
 
87
    void jobCompleted(const QString &text,
 
88
                      const QString &printerUri,
 
89
                      const QString &printerName,
 
90
                      uint printerState,
 
91
                      const QString &printerStateReasons,
 
92
                      bool printerIsAcceptingJobs,
 
93
                      uint jobId,
 
94
                      uint jobState,
 
95
                      const QString &jobStateReasons,
 
96
                      const QString &jobName,
 
97
                      uint jobImpressionsCompleted);
 
98
    void insertUpdateJob(const QString &text,
 
99
                         const QString &printerUri,
 
100
                         const QString &printerName,
 
101
                         uint printerState,
 
102
                         const QString &printerStateReasons,
 
103
                         bool printerIsAcceptingJobs,
 
104
                         uint jobId,
 
105
                         uint jobState,
 
106
                         const QString &jobStateReasons,
 
107
                         const QString &jobName,
 
108
                         uint jobImpressionsCompleted);
83
109
 
84
110
private:
 
111
    int jobRow(int jobId);
 
112
    void insertJob(int pos, const KCupsJob &job);
 
113
    void updateJob(int pos, const KCupsJob &job);
 
114
    QString jobStatus(ipp_jstate_e job_state);
 
115
 
85
116
    KCupsPrinter *m_printer;
86
117
    KCupsRequest *m_jobRequest;
87
118
    QString m_destName;
88
119
    QString m_processingJob;
89
120
    int m_whichjobs;
90
121
    WId m_parentId;
91
 
    QStringList m_requestedAttr;
92
 
 
93
 
    int jobRow(int jobId);
94
 
    void insertJob(int pos, const KCupsJob &job);
95
 
    void updateJob(int pos, const KCupsJob &job);
96
 
    QString jobStatus(ipp_jstate_e job_state);
 
122
    QStringList m_jobAttributes;
 
123
    int m_subscriptionId;
97
124
};
98
125
 
99
126
#endif