LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
NativeAlertManager.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2009-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 NATIVEALERTMANAGER_H
23 #define NATIVEALERTMANAGER_H
24 
25 #include "Common.h"
26 
27 #include <lunaservice.h>
28 #include <string>
30 #include "Timer.h"
31 
33 {
34 public:
35 
36  static NativeAlertManager* instance();
38 
39  bool init();
40 
41  static bool cbAudioControlsChanged(LSHandle* lshandle, LSMessage *msg,void *user_data);
42  static bool cbAudioDServiceState(LSHandle* lshandle, LSMessage *message,void *user_data);
43 
44  void actOnChanged(const std::string& scenarioName,int volume,bool ringer);
46 
47  void closeWindow(Window* win);
48 
49  /*
50  void dbg_common();
51  void dbg_volumeUp();
52  void dbg_volumeDown();
53  void dbg_ringerOn();
54  void dbg_ringerOff();
55  void dbg_phoneMode();
56  void dbg_ringerMode();
57  void dbg_mediaMode();
58  */
59 
60 private:
61 
63  static NativeAlertManager * s_inst;
64 
65  static bool isPhoneScenario(const std::string& scenarioName);
66  static bool isMediaScenario(const std::string& scenarioName);
67  static bool isRingtoneScenario(const std::string& scenarioName);
68  static bool isSystemScenario(const std::string& scenarioName);
69  static bool isVolumeEvent(const std::string& eventName);
70  static bool isVolumeRelatedChangedEvent(const std::string& changedEventName);
71  static bool shouldIgnoreAction(const std::string& actionName);
72 
73 private:
74 
75  LSHandle* m_service;
76 
78  // timer for removing the VCAWin
79  Timer<NativeAlertManager> * m_pVCAWindowTimer;
80 
81 };
82 
83 #endif