webappmanager
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProcessManager.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2008-2012 Hewlett-Packard Development Company, L.P.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * LICENSE@@@ */
18 
19 
20 
21 
22 #ifndef __ProcessManager_h__
23 #define __ProcessManager_h__
24 
25 #include "Common.h"
26 
27 #include <vector>
28 #include <QString>
29 #include "SyncTask.h"
30 
32 
34 {
35  public:
36  ProcessInfo( const QString& inProcId, const QString& inAppId )
37  : processId(inProcId)
38  , appId(inAppId) { }
39  ~ProcessInfo( ) { }
40 
41  QString processId;
42  QString appId;
43 };
44 
45 
46 class ProcessManager : public SyncTask
47 {
48  public:
49  static ProcessManager* instance();
50  virtual ~ProcessManager();
51 
52  std::string launchBootTimeApp(const std::string& appDescString);
53  void launch_threadsafe(const std::string& appId,
54  const std::string& params,
55  const std::string& launchingAppId,
56  const std::string& launchingProcId);
57 
58  std::string launch( const std::string& appDescString,
59  const std::string& params,
60  const std::string& launchingAppId,
61  const std::string& launchingProcId,
62  std::string& errMsg);
63  std::string launchModal(const std::string& appDescString,
64  const std::string& params,
65  const std::string& launchingAppId,
66  const std::string& launchingProcId,
67  std::string& errMsg,
68  int& errCode,
69  bool isHeadless,
70  bool isParentPdk);
71  std::vector<ProcessInfo> list( bool includeSystemApps = false );
72  std::string processIdFactory();
73  bool getProcIdsOfApp(const std::string& appId,std::vector<std::string>& procIdList) const; //pass in vector to fill in with proc ids. return false if none found
74 
75  static std::string createParameterJSONString(const std::string& target);
76  static std::string createParameterJSONString(const char * pcstrTarget);
77  private:
78 
79  virtual void handleEvent(sptr<Event> event);
81 };
82 
83 
84 #endif // __ProcessManager_h__
85