30 #ifndef BROWSERAPPMANAGER_H
31 #define BROWSERAPPMANAGER_H
40 #include <QApplication>
45 #include "SignalSlot.h"
47 #include "WindowTypes.h"
48 #include "WindowProperties.h"
51 #include "lunaservice.h"
52 #include <PIpcBuffer.h>
53 #include <PIpcClient.h>
54 #include <PIpcChannelListener.h>
55 #include <PIpcMessage.h>
69 #define WEB_APP_MGR_IPC_NAME "WebAppManager"
156 std::list<const ProcessBase*>
runningApps(WindowType::Type winType);
264 using TaskBase::mainLoop;
428 void onLaunchUrl(
const std::string& url,
int winType,
429 const std::string& appDesc,
const std::string& procId,
430 const std::string& args,
const std::string& launchingAppId,
431 const std::string& launchingProcId);
451 const std::string& appDesc,
const std::string& procId,
452 const std::string& args,
const std::string& launchingAppId,
453 const std::string& launchingProcId,
int& errorCode,
bool isHeadless);
470 void onRelaunchApp(
const std::string& procId,
const std::string& args,
471 const std::string& launchingAppId,
const std::string& launchingProcId);
568 bool onKillApp(
const std::string& appId);
606 void onProcMgrLaunch(
const std::string& appDescString,
const std::string& params,
607 const std::string& launchingAppId,
const std::string& launchingProcId);
631 const std::string& launchingAppId,
const std::string& launchingProcId,
bool isHeadless,
bool isParentPdk);
830 static gboolean BootupTimeoutCallback(gpointer);
831 static gboolean BootupIdleCallback(gpointer);
834 static bool systemServiceConnectCallback(LSHandle *sh, LSMessage *message,
void *ctx);
835 static bool activityManagerCallback(LSHandle* sh, LSMessage* message,
void* ctx);
836 WebAppBase* launchUrlInternal(
const std::string& url, WindowType::Type winType,
837 const std::string& appDesc,
const std::string& procId,
838 const std::string& args,
const std::string& launchingAppId,
839 const std::string& launchingProcId,
int& errorCode,
bool launchAsChild,
bool ignoreLowMemory=
false);
842 void setOrientationInternal(Event::Orientation orient);
844 void restartHeadLessBootApps();
852 void launchImePopup(
const std::string&);
854 bool preventAppUnderLowMemory(
const std::string& appId, WindowType::Type winType,
ApplicationDescription* appDesc)
const;
856 static bool sysServicePrefsCallback(LSHandle *lshandle, LSMessage *message,
void *ctx);
857 static bool displayManagerConnectCallback(LSHandle* sh, LSMessage* message,
void* ctx);
858 static bool displayManagerCallback(LSHandle* sh, LSMessage* message,
void* ctx);
862 static gboolean deletePagesCallback(gpointer arg);
865 void mimeHandoffUrl(
const char* mimeType,
const char* url,
const char* callerId=0);
870 void addHeadlessAppToWatchList(
WebAppBase* app);
871 void removeHeadlessAppFromWatchList(
WebAppBase* app);
872 bool headlessAppWatchCallback();
876 virtual void serverConnected(PIpcChannel*);
877 virtual void serverDisconnected();
879 virtual void setAppWindowProperties(
int appIpcKey, WindowProperties &winProp);
881 void startGcPowerdActivity();
882 void stopGcPowerdActivity();
883 bool gcPowerdActivtyTimerCallback();
884 bool isAppRunning(
const std::string& appId);
888 typedef std::pair<std::string, SysMgrWebBridge*> AppIdWebPagePair;
889 typedef std::multimap<std::string, SysMgrWebBridge*> AppIdWebPageMap;
890 typedef std::map<std::string, SysMgrWebBridge*> AppIdShellPageMap;
891 typedef std::list<WebAppBase*> AppList;
892 typedef std::list<SysMgrWebBridge*> PageList;
893 typedef std::map<WebAppBase*, uint32_t> AppLaunchTimeMap;
895 AppIdShellPageMap m_shellPageMap;
897 AppIdWebPageMap m_appPageMap;
898 AppLaunchTimeMap m_headlessAppLaunchTimeMap;
900 Event::Orientation m_orientation;
901 LSPalmService* m_service;
902 LSHandle* m_servicePublic;
903 LSHandle* m_servicePrivate;
905 PageList m_pagesToDeleteList;
906 bool m_deletingPages;
907 Timer<WebAppManager> m_headlessAppWatchTimer;
910 std::string m_gcPowerdActivityId;
911 Timer<WebAppManager> m_gcPowerdActivityTimer;
913 typedef std::map<int, WindowedWebApp*> AppWindowMap;
914 AppWindowMap m_appWinMap;
916 HostInfo hostInfoCache;
918 int m_uiWidth, m_uiHeight;
919 bool m_deviceIsPortraitType;
920 bool m_disableAppCaching;
922 bool m_inSimulatedMouseEvent;
924 QApplication *m_Application;
926 std::string m_activeAppId;