MagicSmoke  $VERSION$
pah.h
Go to the documentation of this file.
1 //
2 // C++ Interface: print @ home
3 //
4 // Description:
5 //
6 //
7 // Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2016
8 //
9 // Copyright: See README/COPYING.GPL files that come with this distribution
10 //
11 //
12 
13 #ifndef PAH_MAIN_H
14 #define PAH_MAIN_H
15 
16 #include <QSystemTrayIcon>
17 
18 #include "MOOrderInfo"
19 #include "MOCustomerInfo"
20 
21 #define PRINTATHOME_SETTINGSGROUP "PrintAtHome"
22 
23 class QTimer;
24 
26 class PrintIcon:public QSystemTrayIcon
27 {
28  Q_OBJECT
29 public:
30  PrintIcon();
31 
33  static PrintIcon* instance();
34 
35  enum class PrintMode{
37  Normal,
39  Printing,
41  Blocked,
43  Problem
44  };
45 
47  bool printIsActive(){return misactive;}
48 
49 public slots:
51  void setPrintMode(PrintMode);
53  void setNextTime(QString s);
54 
55 private slots:
57  void clientConfig();
59  void serverConfig();
60 
62  void activatePrint(bool);
64  void toolTipUpdate();
65 
66 signals:
68  void printActivated(bool);
70  void settingsChanged();
72  void startPrinting();
73 
74 private:
75  bool misactive=false;
76  QString mmode,mnexttime;
77 };
78 
80 class PrintScheduler:public QObject
81 {
82  Q_OBJECT
83 public:
85 public slots:
87  void startPrinting();
89  void activatePrint(bool);
91  void reinit();
92 private:
93  QTimer*mtimer;
94 };
95 
96 #endif
void setNextTime(QString s)
tells the tool tio when we will print next time
Definition: pah.cpp:101
static PrintIcon * instance()
returns the Icon instance
Definition: pah.cpp:58
Normal operation, waiting for events.
void settingsChanged()
emitted whenever settings have changed
PrintMode
Definition: pah.h:35
void startPrinting()
emitted when the user wants to start printing immediately
operation not possible, problem with settings
void startPrinting()
initiates and controls the print job.
Definition: pah.cpp:184
void printActivated(bool)
emitted when the "Activate Printing" menu item is changed
Central scheduler class for the Print at Home client.
Definition: pah.h:80
This represents the icon in the system tray and the main UI of the Print at Home client.
Definition: pah.h:26
bool printIsActive()
returns true if the "Activate Printing" menu item is ticked
Definition: pah.h:47
void setPrintMode(PrintMode)
sets the icon variant
Definition: pah.cpp:64
void reinit()
re-initializes the scheduler with current settings
Definition: pah.cpp:154
PrintIcon()
Definition: pah.cpp:36
operation blocked, no connection or printing deactivated
void activatePrint(bool)
call back for the menu item - affects the timer
Definition: pah.cpp:148
PrintScheduler()
Definition: pah.cpp:128