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
10 * @brief Homescreen application history sequence manager
14 #ifndef CICOHSAPPHISTORYEXT_H
15 #define CICOHSAPPHISTORYEXT_H
21 #include "CicoHSAppHistory.h"
24 * ecore timer void data typedef
26 typedef struct t_CHSAHE_data {
32 * pid appid convert data item
34 typedef std::pair<int, std::string> pairPidAppid;
37 * order of the start-up window
39 typedef std::pair<bool, pairPidAppid> pairBoolPidAppid;
41 class CicoHSAppHistoryExt :public CicoHSAppHistory
44 CicoHSAppHistoryExt();
45 CicoHSAppHistoryExt(const char* user, const char* path, const char* pathD,
46 const char* flagpath);
47 CicoHSAppHistoryExt(const std::string& user, const std::string& path,
48 const std::string& pathD, const std::string& flagpath);
49 virtual ~CicoHSAppHistoryExt();
50 void setWaitTime(double msec);
53 virtual bool addAppHistory(const std::string& app);
54 virtual bool delAppHistory(const std::string& app);
55 virtual bool moveHistoryHead(const std::string& app);
56 const std::string& getNearHistory();
59 int appLaunch(int pid, const char* appid, int aulstt);
62 // pid to appid converter
63 bool getAppid(int pid, std::string& appid);
65 // swipe operation I/F
66 void selectApp(int pid);
67 void selectApp(const std::string& appid);
68 void selectApp(const char* appid);
69 const std::string& getSelectApp() const;
70 void clearSelectApp();
72 // time out selected app
73 void determined(CHSAHE_data_t* data);
75 // touch operation I/F
76 void activeApp(int pid);
77 void activeApp(const std::string& appid);
78 void activeApp(const char* appid);
81 const std::string& prevSwipe();
82 const std::string& nextSwipe();
83 const std::string& getSwipeCurrentAppid();
84 const std::string& homeSwipe();
86 void update_appid(int pid, std::string& appid, int& aulstt);
87 bool update_pairPidAppid(std::string& appid);
90 // order of the start-up window
91 void startupCheckAdd(int pid, const std::string& appid, bool d = false);
92 bool isStartupChecking() const;
93 void startupEntryFinish(int pid);
94 void startupEntryFinish(const std::string& appid);
96 void stopStartupCheck();
97 const std::string& getLastStartupAppid() const;
98 const std::string& getSubDispAppid() const;
106 virtual void setHandler();
112 std::vector<pairPidAppid> m_vppa;
113 std::vector<int> m_aulstt;
115 std::string m_waitSelApp;
116 std::list<CHSAHE_data_t*> m_lCdt;
117 double m_waitTimer; // ex.) 1sec = 1.0
119 std::vector<pairBoolPidAppid> m_vpbpa;
120 std::string m_lastStartupApp;
121 std::string m_subDispApp;
126 * @brief counter reset
127 * @ret reset counter value
129 inline int CicoHSAppHistoryExt::resetCounter()
131 m_cnt = COUNTER_START;
136 * @brief get counter value
139 inline int CicoHSAppHistoryExt::getCounter()
145 * @brief next counter value
146 * @ret next counter value
148 inline int CicoHSAppHistoryExt::nextCounter()
151 if (COUNTER_MAX < m_cnt) {
158 * @brief set wait timer val
159 * @param sec wait time ex.) 1.0 == 1sec
161 inline void CicoHSAppHistoryExt::setWaitTime(double sec)
167 * @brief get start-up checking state
169 * @retval true cheking
170 * @retval false no checking
172 inline bool CicoHSAppHistoryExt::isStartupChecking() const
174 if (0 == m_vpbpa.size()) {
181 * @brief get last start-up appid
182 * @retuen appid Valid only application startup
183 * @retval empty is application startup finish or no have history
186 inline const std::string& CicoHSAppHistoryExt::getLastStartupAppid() const
188 return m_lastStartupApp;
192 * @brief get history sub display appid
194 * @retval empty is no have history sub display
196 inline const std::string& CicoHSAppHistoryExt::getSubDispAppid() const
202 * @brief get select App entry appid
204 * @retval empty is time out or none select
206 inline const std::string& CicoHSAppHistoryExt::getSelectApp() const
212 * @brief select appid clear
214 inline void CicoHSAppHistoryExt::clearSelectApp()
216 m_waitSelApp.clear();
219 #endif // CICOHSAPPHISTORYEXT_H
220 // vim: set expandtab ts=4 sw=4: