Corresponding class for Windows platform is here.
Corresponding class for Linux platform is here.
Implementation of application for Android platform.
You can find more information in comments below. Overrided methods can be found in corresponding base interface.
class CApplication :public virtual IApplication
{
public:
struct FONT_FACE // Describe loaded font face
{
void *Face;
String Name;
int RefCount;
bool Default;
};
struct MESSAGE_KEY_ANDROID :public MESSAGE_KEY // Key message extension
{
int32_t KeyCode; // Android system key code
};
public:
int getWindowCount() override;
IWindow *getWindow(const int index) override;
IForm *getWindowForm(const int index) override;
IForm *getMainForm() override;
IKeyboard *getKeyboard() override;
IMouse *getMouse() override;
ITranslate *getTranslate() override;
IStyles *getStyles() override;
IScreen *getScreen() override;
ISystem *getSystem() override;
IPicture *getPicture() override;
IDialogs *getDialogs() override;
IFileSystem *getFileSystem() override;
const String &getApplicationFileName() const override;
const String &getApplicationDirectory() const override;
// Since 5.0.0
INetwork *getNetwork() override;
// Since 7.0.0
const String &getModuleFileName() const override; // Return same as getApplicationFileName()
const String &getModuleDirectory() const override; // Return same as getApplicationDirectory()
// Since 8.0.0
IEditor *getEditor() override; // Return nullptr
// Since 9.0.0
bool isUseDialogBoxes() override;
bool isGlobal() override; // Return true
bool setMainForm(IForm *value) override;
int Run() override;
void ProcessMessages() override;
void RepaintAll() override;
IApplicationService *QueryService() override;
// Since 5.0.0
IThread *CreateThread(const bool paused, IThreadListener *listener) override;
CApplication();
virtual ~CApplication();
void(*OnSaveState)(CApplication *sender); // Event called when android informs about need of saving application state before closing
void(*OnLowMemory)(CApplication *sender); // Event called when android inform application about low free memory
AConfiguration *getConfiguration(); // Return application configuration
AAssetManager *getAssetManager(); // Return asset manager
FONT_FACE *LoadFontFace(const String &filename); // Load font or return existing one
FONT_FACE *LoadDefaultFontFace(const String &filename); // Load default font or return existing one
void FreeFontFace(FONT_FACE *face); // Free font if it is not used anymore. Each call of LoadFontFace/LoadDefaultFontFace should correspond the same count of calls of FreeFontFace
};
The usage is quite simple.
CMyForm *form;
void android_main()
{
Application->CreateForm(&form);
Application->setMainForm(form);
}
Namespace: | nitisa::standard::android |
Include: | Standard/Platform/Android/Application.h |