LeechCraft  0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
actionresultreporter.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #pragma once
10 
11 #include <QDeadlineTimer>
12 #include <QPointer>
13 #include <QString>
14 #include <interfaces/structures.h>
15 #include "guiconfig.h"
16 
17 class QWidget;
18 
19 class IEntityManager;
20 
21 namespace LC::Util
22 {
24  {
25  IEntityManager& IEM_;
26  const QString Context_;
27 
28  const Priority Priority_;
29 
30  QPointer<QWidget> Parent_;
31  const bool HadParent_ = Parent_;
32 
33  QDeadlineTimer TimerBackground_;
34 
35  std::optional<QWidget*> InitialFocus_;
36  public:
39  struct TimeoutBackgroundPolicy { std::chrono::milliseconds Timeout_; };
40 
41  using BackgroundPolicy = std::variant<
44  std::chrono::milliseconds
45  >;
46 
47  struct Config
48  {
49  QString Context_;
51  BackgroundPolicy BackgroundPolicy_ = DefaultBackgroundPolicy {};
52  };
53 
54  explicit ActionResultReporter (IEntityManager& iem, Config config, QWidget *parent = nullptr);
55 
56  void operator() (const QString&);
57  private:
58  bool FocusChanged () const;
59  };
60 }
Proxy to core entity manager.
std::variant< DefaultBackgroundPolicy, FocusBackgroundPolicy, std::chrono::milliseconds > BackgroundPolicy
#define UTIL_GUI_API
Definition: guiconfig.h:16
Priority
Definition: structures.h:190