MagicSmoke  $VERSION$
boxwrapper.h
Go to the documentation of this file.
1 //
2 // C++ Interface: Message Box Wrapper
3 //
4 // Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2013
5 //
6 // Copyright: See README/COPYING.GPL files that come with this distribution
7 //
8 //
9 
10 #ifndef MSINTERFACE_BOXWRAPPER_H
11 #define MSINTERFACE_BOXWRAPPER_H
12 
13 #include <QString>
14 #include <QObject>
15 #include <functional>
16 
17 #ifndef MSIFACE_EXPORT
18 #define MSIFACE_EXPORT Q_DECL_IMPORT
19 #endif
20 
21 
23 {
24  public:
25  typedef std::function<void(QString,QString)>Wrapper;
26 
27  static void warning(QString title,QString text);
28  static void setWarning(Wrapper);
29  private:
30  static Wrapper mwarn;
31  MBoxWrapper()=default;
32 };
33 
34 class MSIFACE_EXPORT MProgressWrapper:public QObject
35 {
36  Q_OBJECT
37  public:
38  typedef std::function<MProgressWrapper*(QString,QString)>Factory;
39  static void setFactory(Factory);
40 
41  static MProgressWrapper* create(QString label,QString buttonlabel=QString());
42  public slots:
43  virtual void setLabelText(QString)=0;
44  virtual void setCancelButtonText(QString)=0;
45  virtual void cancel()=0;
46  virtual void setRange(int,int)=0;
47  virtual void setValue(int)=0;
48  virtual void hide()=0;
49 };
50 
51 #endif
Definition: boxwrapper.h:34
Definition: boxwrapper.h:22
#define MSIFACE_EXPORT
Definition: boxwrapper.h:18
std::function< MProgressWrapper *(QString, QString)> Factory
Definition: boxwrapper.h:38
std::function< void(QString, QString)> Wrapper
Definition: boxwrapper.h:25