Open 3D Engine AzToolsFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
LegacyFramework::CoreMessages Class Reference

#include <EditorFrameworkAPI.h>

Inherits AZ::EBusTraits.

Public Member Functions

bool Compare (const CoreMessages *rhs) const
 
virtual void OnRestoreState ()
 
virtual void OnReady ()
 sent when everything is registered up and ready to go, this is what bootstraps stuff to get going.
 
virtual void Run ()
 sent after onrestorestate - the entire app should be up and running now.
 
virtual void RunAsAnotherInstance ()
 
virtual void OnProjectSet (const char *)
 
virtual bool OnGetPermissionToShutDown ()
 
virtual void OnSaveState ()
 
virtual void OnDestroyState ()
 
virtual bool CheckOkayToShutDown ()
 
virtual void ApplicationDeactivated ()
 
virtual void ApplicationActivated ()
 
virtual void ApplicationShow (AZ::Uuid)
 
virtual void ApplicationHide (AZ::Uuid)
 
virtual void ApplicationCensus ()
 

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy = AZ:: EBusHandlerPolicy::MultipleAndOrdered
 
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single
 

Detailed Description

Core messages core messages go to whoever wants them. If you're interested in these messages, listen here. they are always broadcast (To all listeners, not by address)

Member Function Documentation

◆ ApplicationActivated()

virtual void LegacyFramework::CoreMessages::ApplicationActivated ( )
inlinevirtual

happens when the framework goes out of focus in the global OS sense. i.e if a different application gets focus, this is sent to all contexts.

◆ ApplicationCensus()

virtual void LegacyFramework::CoreMessages::ApplicationCensus ( )
inlinevirtual

A request from the application framework to ask the system what root level windows may be open. If you don't respond to this by issuing ApplicationCensusReply on the framwork message bus, the application will be allowed to quit entirely, even if your window is open. You should respond to recieving this message by calling ApplicationCensusReply if your context has a window open that counts as one of the 'root' windows of an app that should stop the app from closing if the window is open. When the last window that responded true is closed, the entire editor quits. windows like floating browsers which are NOT part of the permanent context should not respond.

◆ ApplicationDeactivated()

virtual void LegacyFramework::CoreMessages::ApplicationDeactivated ( )
inlinevirtual

happens when the framework goes in focus in the global OS sense. i.e if the ANY window belonging to the app comes to front, this is sent to all contexts.

◆ ApplicationHide()

virtual void LegacyFramework::CoreMessages::ApplicationHide ( AZ::Uuid  )
inlinevirtual

This is broadcast to ALL applications registered with AddComponentInfo Each listener must check to see if the Uuid given is the UUid they registered with, in AddComponentInfo. This allows listeners to react to more than one Uuid menu item. Perhaps one context is responsible for more than one main window.

◆ ApplicationShow()

virtual void LegacyFramework::CoreMessages::ApplicationShow ( AZ::Uuid  )
inlinevirtual

This is broadcast to ALL applications registered with AddComponentInfo Each listener must check to see if the Uuid given is the UUid they registered with, in AddComponentInfo. This allows listeners to react to more than one Uuid menu item. Perhaps one context is responsible for more than one main window.

◆ CheckOkayToShutDown()

virtual bool LegacyFramework::CoreMessages::CheckOkayToShutDown ( )
inlinevirtual

During shutdown, this is Sent repeatedly until everyone responds TRUE. Once everyone returns true from /ref OnGetPermissionToShutDown, we then start to send /ref CheckOkayToShutDown periodically until everyone returns TRUE, after which /ref OnSaveState will occur, then /ref OnDestroyState , and then finally the component will be stopped and destroyed. After the user says its okay to shut down, this is called in a loop to give everyone time to flush their buffers / wait and cancel pending operations. So for example, if you return true to /ref OnGetPermissionToShutdown you should start saving your files and cleaning up in that function. Then check to see if your pending async calls are done in /ref CheckOkayToShutdown

◆ OnDestroyState()

virtual void LegacyFramework::CoreMessages::OnDestroyState ( )
inlinevirtual

this message gets sent for you to destroy state objects that depend on outside components an example is components that have GUIs (such as the Lua Editor) need to destroy their Qt Objects, because we will tear down the QApplication after sending this. this happens after /ref OnSaveState

◆ OnGetPermissionToShutDown()

virtual bool LegacyFramework::CoreMessages::OnGetPermissionToShutDown ( )
inlinevirtual

this is sent when the user hits the [x] button to close the entire application and the final important window is closed. Components should override this if its possible for the user to abort the shutdown and deny it. This is also your opportunity to kick off any saves and caches that need to be cached. If EVERYONE answers true, then everyone is polled constantly with /ref CheckOkeyToShutdown, and then when all listeners return true for that, the actual shutdown occurs.

◆ OnProjectSet()

virtual void LegacyFramework::CoreMessages::OnProjectSet ( const char *  )
inlinevirtual

this happens when the project manager has set its project. the next thing that will happen is you get an OnRestoreState and OnReady() from the UI manager - if you're a UI application otherwise, you'll have to do whatever you want at this point in your non-gui application.

◆ OnSaveState()

virtual void LegacyFramework::CoreMessages::OnSaveState ( )
inlinevirtual

sent to everything when the app is about to shut down - do what you need to do to ensure that state is stored somewhere. this happens before anyone destroys state ( /ref OnDestroyState will be called after all OnSaveState)

◆ Run()

virtual void LegacyFramework::CoreMessages::Run ( )
inlinevirtual

sent after onrestorestate - the entire app should be up and running now.

in a GUI application, this is already implemented in UIFramework in order to initialize QT and then execute the main application event loop in that case, implment OnRestoreState() in your gui-related components to start them functioning. on the other hand, in a Non-GUI application (such as a console app, if you initialized it without QT), you will not have a QApplication and you need to implment RUN() yourself to do whatever it is you want to do (process assets, etc). you can use virtual _TCHAR** FrameworkApplicationMessages::GetArguments(int& argc) = 0; to get the command line arguments. if you use your own console app, its up to you to send OnRestoreState, OnGetPermissionToShutdown, OnSaveState, etc.

◆ RunAsAnotherInstance()

virtual void LegacyFramework::CoreMessages::RunAsAnotherInstance ( )
inlinevirtual

Executed as part of inter-process communication during startup of a second instance. this happens INSTEAD of run, if you are a secondary instance of an application instead of the primary. by default, the UI Framework, when it gets this, sends the "open" message to the primary instance for every misc value on its command line causing the primary to attempt to open it instead of ourselves. you can also implement this yourself in order to send messages to the primary (if you wish). note: The project is not set ever as another instance...


The documentation for this class was generated from the following file: