Emergency 20 Dokumentation  4.2.0
AppStoreWindow.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
13 #include <qsf/gui/GuiDocument.h>
14 
15 
16 //[-------------------------------------------------------]
17 //[ Namespace ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21 
22 
23  //[-------------------------------------------------------]
24  //[ Classes ]
25  //[-------------------------------------------------------]
31  {
32 
33 
34  //[-------------------------------------------------------]
35  //[ Public methods ]
36  //[-------------------------------------------------------]
37  public:
38  explicit AppStoreWindow(qsf::GuiContext& guiContext);
39 
40 
41  //[-------------------------------------------------------]
42  //[ Public virtual qsf::GuiDocument methods ]
43  //[-------------------------------------------------------]
44  public:
45  virtual void processEvent(const std::string& eventKey, Rocket::Core::Event& event) override;
46  virtual bool onPreShow() override;
47 
48 
49  //[-------------------------------------------------------]
50  //[ Private methods ]
51  //[-------------------------------------------------------]
52  private:
53  void askForPurchase(const qsf::NamedIdentifier& productId, const std::string& title, const std::string& text);
54 
55  void switchToWindowMode();
56  void showConnectionMessage();
57 
58  void setupStoreManagerListeners();
59  void removeStoreManagerListeners();
60 
61  void onPurchaseSuccess(uint32 productId);
62  void onPurchaseRestore(uint32 productId);
63  void onPurchaseCancel(uint32 productId);
64  void onPurchaseError(uint32 productId);
65 
66  void onRestoreSuccess();
67  void onRestoreFailed();
68 
69  void onOkayForPurchase(const qsf::NamedIdentifier& productId);
70  void onOkayForHide();
71  void onOkayForRestart();
72 
73 
74  //[-------------------------------------------------------]
75  //[ Private data ]
76  //[-------------------------------------------------------]
77  private:
78  bool mRestartNeeded;
79 
80 
81  };
82 
83 
84 //[-------------------------------------------------------]
85 //[ Namespace ]
86 //[-------------------------------------------------------]
87 } // em5
Definition: ActionPriority.h:13
AppStoreWindow(qsf::GuiContext &guiContext)
unsigned int uint32
Definition: PlatformTypes.h:181
Graphical User Interface (GUI) document base class.
Definition: GuiDocument.h:51
virtual bool onPreShow() override
Called before show.
virtual void processEvent(const std::string &eventKey, Rocket::Core::Event &event) override
Ingame Graphical User Interface (GUI) context class.
Definition: GuiContext.h:62
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34
EMERGENCY 5 Mac App Store window.
Definition: AppStoreWindow.h:30