Remove EEventScreenSizeChanged.
[SDL.s60v3.git] / symbian / include / sdlepocapi.h
blob91d2e6def1b5bb2cbd6c44f2c91bb1400cc90a28
1 #ifndef EPOC_SDL_H
2 #define EPOC_SDL_H
4 #include<e32std.h>
6 class CDesC8Array;
7 class TWsEvent;
8 class RWindow;
9 class CAknAppUi;
10 class RWsSession;
11 class CWsScreenDevice;
12 class CBitmapContext;
13 class CFbsBitmap;
15 //internal stuff
16 extern "C"
18 typedef int (*mainfunc1) ();
19 typedef int (*mainfunc2) (int argc, char* argv[]);
20 typedef int (*mainfunc3) (int argc, char* argv[], char* env[]);
21 typedef void (*mainfunc4) ();
22 typedef void (*mainfunc5) (int argc, char* argv[]);
23 typedef void (*mainfunc6) (int argc, char* argv[], char* env[]);
26 //internal stuff
27 extern "C"
29 int SDL_main (int argc, char* argv[]);
32 //internal stuff
33 NONSHARABLE_CLASS(TMainFunc)
35 public:
36 IMPORT_C TMainFunc();
37 IMPORT_C TMainFunc(mainfunc1);
38 IMPORT_C TMainFunc(mainfunc2);
39 IMPORT_C TMainFunc(mainfunc3);
40 IMPORT_C TMainFunc(mainfunc4);
41 IMPORT_C TMainFunc(mainfunc5);
42 IMPORT_C TMainFunc(mainfunc6);
43 const void* operator[](TInt aIndex) const;
45 private:
46 void* iMainFunc[6];
49 NONSHARABLE_CLASS(MSDLObserver)
51 public:
52 enum //these events indicates the state changes in SDL
54 EEventWindowReserved, //window is created, nothing else should use the window
55 EEventWindowNotAvailable, //window not available, can be ignored
56 EEventSuspend, //SDL thread will be stopped next
57 EEventResume, //SDL thread resumed
58 EEventKeyMapInit, //Keymap is inited and can now be rewritten
59 EEventMainExit,
61 enum //these are fixed return values that event handler sends back to SDL
63 EParameterNone,
64 ESuspendNoSuspend //after EEventSuspend, prevents the suspend.
66 virtual TInt SdlEvent(TInt aEvent, TInt aParam) = 0; //event is called in application thread
67 virtual TInt SdlThreadEvent(TInt aEvent, TInt aParam) = 0; //event is called in SDL thread
71 class CSDL : public CBase
73 public:
74 enum TFlags //these flags set SDL modes
76 ENoFlags = 0x0,
77 EEnableFocusStop = 0x1, //let SDL thread to be stopped if not on top
78 EOwnThread = 0x1000, //always put SDL running its own thread
79 EMainThread = 0x2000, //always put SDL in application thread
82 IMPORT_C static CSDL* NewL(TInt aFlags = CSDL::ENoFlags);
83 IMPORT_C MSDLObserver* Observer(); //get current observer
84 IMPORT_C void SetObserver(MSDLObserver* aObserver); //set observer to receive events, if NULL then observer is removed
85 IMPORT_C void SetContainerWindowL(RWindow& aWindow, RWsSession& aSession, CWsScreenDevice& aDevice); //the window where drawn happens, should be recalled (propably in application HandleResourceChange) if screen device changes
86 IMPORT_C ~CSDL();
87 IMPORT_C TInt AppendWsEvent(const TWsEvent& aEvent); //give event to SDL, return error code if event buffer is full (insert in application HandleWsEvent)
88 IMPORT_C TInt GetSDLCode(TInt aScanCode); //get SDL internal key code bind to given scancode, return -1 if scancode is not found, aScancode must be postive number
89 IMPORT_C TInt SetSDLCode(TInt aScanCode, TInt aSDLCode); //set internal SDL code with given key code, return replaced code
90 IMPORT_C TInt SDLCodesCount() const; //return count of scancodes
91 IMPORT_C void ResetSDLCodes(); //rest all code replacement to their initial values
92 IMPORT_C void Resume(); //restart SDL main
93 IMPORT_C void Suspend(); //stop SDL main
94 IMPORT_C void SDLPanic(const TDesC& aInfo, TInt aErr); //Panic from SDL thread (see SDLThreadEvent)
95 IMPORT_C TThreadId CallMainL(const TMainFunc& aFunc, TRequestStatus* const aStatus, const CDesC8Array* const iArg, TInt aStackSize); //internal
96 IMPORT_C void Resize();
98 protected:
99 IMPORT_C CSDL();
102 #endif