GOG GALAXY SDK Documentation
IUtils.h
Go to the documentation of this file.
1 #ifndef GALAXY_I_UTILS_H
2 #define GALAXY_I_UTILS_H
3 
9 #include "IListenerRegistrar.h"
10 
11 namespace galaxy
12 {
13  namespace api
14  {
23  typedef uint64_t NotificationID;
24 
29  {
35  };
36 
40  class IOverlayVisibilityChangeListener : public GalaxyTypeAwareListener<OVERLAY_VISIBILITY_CHANGE>
41  {
42  public:
43 
49  virtual void OnOverlayVisibilityChanged(bool overlayVisible) = 0;
50  };
51 
56 
60  class IOverlayInitializationStateChangeListener : public GalaxyTypeAwareListener<OVERLAY_INITIALIZATION_STATE_CHANGE>
61  {
62  public:
63 
69  virtual void OnOverlayStateChanged(OverlayState overlayState) = 0;
70  };
71 
76 
80  class INotificationListener : public GalaxyTypeAwareListener<NOTIFICATION_LISTENER>
81  {
82  public:
83 
93  virtual void OnNotificationReceived(NotificationID notificationID, uint32_t typeLength, uint32_t contentSize) = 0;
94  };
95 
100 
105  {
110  };
111 
115  class IGogServicesConnectionStateListener : public GalaxyTypeAwareListener<GOG_SERVICES_CONNECTION_STATE_LISTENER>
116  {
117  public:
118 
124  virtual void OnConnectionStateChange(GogServicesConnectionState connectionState) = 0;
125  };
126 
131 
132 
137 
141  class IUtils
142  {
143  public:
144 
145  virtual ~IUtils()
146  {
147  }
148 
156  virtual void GetImageSize(uint32_t imageID, int32_t& width, int32_t& height) = 0;
157 
167  virtual void GetImageRGBA(uint32_t imageID, void* buffer, uint32_t bufferLength) = 0;
168 
176  virtual void RegisterForNotification(const char* type) = 0;
177 
189  virtual uint32_t GetNotification(NotificationID notificationID, bool& consumable, char* type, uint32_t typeLength, void* content, uint32_t contentSize) = 0;
190 
199  virtual void ShowOverlayWithWebPage(const char* url) = 0;
200 
212  virtual bool IsOverlayVisible() = 0;
213 
229 
243  virtual void DisableOverlayPopups(const char* popupGroup) = 0;
244 
256  };
257 
259  }
260 }
261 
262 #endif
Contains data structures and interfaces related to callback listeners.
The class that is inherited by all specific callback listeners and provides a static method that retu...
Definition: IListenerRegistrar.h:117
Listener for the event of GOG services connection change.
Definition: IUtils.h:116
virtual void OnConnectionStateChange(GogServicesConnectionState connectionState)=0
Notification of the GOG services connection changed.
Listener for the event of receiving a notification.
Definition: IUtils.h:81
virtual void OnNotificationReceived(NotificationID notificationID, uint32_t typeLength, uint32_t contentSize)=0
Notification for the event of receiving a notification.
Listener for the event of changing overlay state.
Definition: IUtils.h:61
virtual void OnOverlayStateChanged(OverlayState overlayState)=0
Notification for the event of changing overlay state change.
Listener for the event of changing overlay visibility.
Definition: IUtils.h:41
virtual void OnOverlayVisibilityChanged(bool overlayVisible)=0
Notification for the event of changing overlay visibility.
The interface for managing images.
Definition: IUtils.h:142
virtual bool IsOverlayVisible()=0
Return current visibility of the overlay.
virtual void RegisterForNotification(const char *type)=0
Register for notifications of a specified type.
virtual void ShowOverlayWithWebPage(const char *url)=0
Shows web page in the overlay.
virtual uint32_t GetNotification(NotificationID notificationID, bool &consumable, char *type, uint32_t typeLength, void *content, uint32_t contentSize)=0
Reads a specified notification.
virtual void GetImageSize(uint32_t imageID, int32_t &width, int32_t &height)=0
Reads width and height of the image of a specified ID.
virtual GogServicesConnectionState GetGogServicesConnectionState()=0
Return current state of the connection to GOG services.
virtual OverlayState GetOverlayState()=0
Return current state of the overlay.
virtual void DisableOverlayPopups(const char *popupGroup)=0
Disable overlay pop-up notifications.
virtual void GetImageRGBA(uint32_t imageID, void *buffer, uint32_t bufferLength)=0
Reads the image of a specified ID.
The class that is inherited by the self-registering versions of all specific callback listeners.
Definition: IListenerRegistrar.h:211
SelfRegisteringListener< IGogServicesConnectionStateListener, GameServerListenerRegistrar > GameServerGlobalGogServicesConnectionStateListener
Globally self-registering version of IGogServicesConnectionStateListener for the Game Server.
Definition: IUtils.h:136
GogServicesConnectionState
State of connection to the GOG services.
Definition: IUtils.h:105
SelfRegisteringListener< INotificationListener > GlobalNotificationListener
Globally self-registering version of INotificationListener.
Definition: IUtils.h:99
uint64_t NotificationID
The ID of the notification.
Definition: IUtils.h:23
OverlayState
State of the overlay.
Definition: IUtils.h:29
SelfRegisteringListener< IOverlayVisibilityChangeListener > GlobalOverlayVisibilityChangeListener
Globally self-registering version of IOverlayStateChangeListener.
Definition: IUtils.h:55
SelfRegisteringListener< IGogServicesConnectionStateListener > GlobalGogServicesConnectionStateListener
Globally self-registering version of IGogServicesConnectionStateListener.
Definition: IUtils.h:130
SelfRegisteringListener< IOverlayInitializationStateChangeListener > GlobalOverlayInitializationStateChangeListener
Globally self-registering version of IOverlayInitializationStateChangeListener.
Definition: IUtils.h:75
@ GOG_SERVICES_CONNECTION_STATE_DISCONNECTED
Connection to the GOG services has been lost.
Definition: IUtils.h:108
@ GOG_SERVICES_CONNECTION_STATE_CONNECTED
Connection to the GOG services has been established.
Definition: IUtils.h:107
@ GOG_SERVICES_CONNECTION_STATE_UNDEFINED
Connection state is undefined.
Definition: IUtils.h:106
@ GOG_SERVICES_CONNECTION_STATE_AUTH_LOST
Connection to the GOG services has been lost due to lose of peer authentication.
Definition: IUtils.h:109
@ OVERLAY_STATE_FAILED_TO_INITIALIZE
Galaxy Client failed to initialize the overlay or inject it into the game.
Definition: IUtils.h:33
@ OVERLAY_STATE_DISABLED
Overlay is disabled by the user in the Galaxy Client.
Definition: IUtils.h:32
@ OVERLAY_STATE_INITIALIZED
Overlay has been successfully injected into the game.
Definition: IUtils.h:34
@ OVERLAY_STATE_UNDEFINED
Overlay state is undefined.
Definition: IUtils.h:30
@ OVERLAY_STATE_NOT_SUPPORTED
Overlay is not supported.
Definition: IUtils.h:31