2 * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
9 #ifndef CICOHSLIFECYCLECONTROLLER_H
10 #define CICOHSLIFECYCLECONTROLLER_H
15 #include <package-manager.h>
18 #include "CicoAilItems.h"
19 #include "CicoAulItems.h"
22 #ifndef __CICO_SC_WINDOW_H__
27 class CicoHSLifeCycleController {
29 CicoHSLifeCycleController();
30 ~CicoHSLifeCycleController();
32 static CicoHSLifeCycleController* getInstance(void);
34 // Starting application
35 int launch(const char* appid);
36 int launch(const std::string& appid);
37 // Stopping application
38 int terminate(const char* appid);
39 int terminate(const std::string& appid);
40 int terminate(int pid);
41 // suspend application
42 int suspend(const char* appid);
43 int suspend(const std::string& appid);
45 // run application check
46 bool isRunning(const char* appid);
47 bool isRunning(const std::string& appid);
49 const std::vector<CicoAilItems>& getAilList() const;
50 const CicoAilItems* findAIL(const char* appid) const;
51 const CicoAilItems* findAIL(const std::string& appid) const;
52 bool isAilRenew() const;
53 void ailRenewFlagOff();
55 const std::vector<CicoAulItems>& getAulList();
56 // TODO mk_k Should I think about the multiple return values start
58 const CicoAulItems* findAUL(const char* appid) const;
59 const CicoAulItems* findAUL(const std::string& appid) const;
61 const CicoAulItems* findAUL(int pid);
62 bool getPIDs(const char* appid, std::vector<int>& pids) const;
63 bool getPIDs(std::string& appid, std::vector<int>& pids) const;
64 void enterAUL(const char* appid, int pid, const CicoSCWindow* obj = NULL,
65 int aulstt = AUL_R_OK);
70 friend ail_cb_ret_e CSCLCCail_list_appinfo_cbX(const ail_appinfo_h appinfo,
71 CicoHSLifeCycleController* x);
72 bool createAilItems();
75 int CSCLCCpkgmgr_handlerX(int req_id, const char *pkg_type,
76 const char *pkg_name, const char *key,
77 const char *val, const void *pmsg,
78 CicoHSLifeCycleController *x);
80 void ailRenewFlagOn();
82 friend int CSCLCCapp_launch_handlerX(int pid,
83 CicoHSLifeCycleController *x);
84 friend int CSCLCCapp_dead_handlerX(int pid, CicoHSLifeCycleController *x);
86 int terminateR(int pid);
87 void getCategory(const char* sPkg, const char* sNm, const char* sCtg,
88 std::string& category);
89 bool addAIL(const char* sPkg, const char* sIco, const char* sNm,
90 const char* sCtg, const char* sTyp, const char* sExe,
92 bool removeAUL(int pid);
94 static CicoHSLifeCycleController* ms_myInstance;
97 std::vector<CicoAilItems> m_ail;
98 std::vector<CicoAulItems> m_aul;
105 * @brief AIL information list
106 * @return AIL information item list Container
109 const std::vector<CicoAilItems>& CicoHSLifeCycleController::getAilList() const
116 * @brief AIL change flag is on?
118 * @retval true change flag on
119 * @retval false change flag off
121 inline bool CicoHSLifeCycleController::isAilRenew() const
127 * @brief AIL change flag off set
129 inline void CicoHSLifeCycleController::ailRenewFlagOff()
135 * @brief AIL change flag on set
137 inline void CicoHSLifeCycleController::ailRenewFlagOn()
142 #endif // CICOHSLIFECYCLECONTROLLER_H
143 // vim: set expandtab ts=4 sw=4: