00001 #ifndef __epoc_profile_hpp__ 00002 #define __epoc_profile_hpp__ 00003 00004 #include "application_config.h" 00005 00006 #if __PROFILE_ENABLED__ && !__HAVE_PROFILEENGINE_LIB__ 00007 00008 #include <glib.h> 00009 00010 #include <e32base.h> 00011 #include <cprofilechangenotifyhandler.h> 00012 #include <mprofilechangeobserver.h> 00013 00014 // For S60 v3.0 there is ProfilesEngine.ZIP SDK API plugin, but not 00015 // for later platform versions. (Mind you though that at least v3.1 00016 // maintains binary compatibility with the ProfilesEngine.ZIP defined 00017 // API. So for now it seems to be okay to just install the v3.0 00018 // ProfilesEngine.ZIP plugin to a v3.1 SDK.) 00019 // 00020 // We require a separate implementation for later platform versions. 00021 #include <mprofileengine.h> 00022 00023 // For info on accessing additional profile info on 3rd, 00024 // see http://mikie.iki.fi/wordpress/?p=31 00025 00026 #include "ld_log_db.h" 00027 00028 NONSHARABLE_CLASS(CSensor_profile) : public CBase, 00029 public MProfileChangeObserver 00030 { 00031 public: 00032 00033 static CSensor_profile* NewL(LogDb* aLogDb); 00034 00035 virtual ~CSensor_profile(); 00036 00037 gboolean StartL(GError** error); 00038 00039 void Stop(); 00040 00041 gboolean IsActive() { return (iReader != NULL); } 00042 00043 private: 00044 00045 CSensor_profile(LogDb* aLogDb); 00046 00047 void ConstructL(); 00048 00049 private: 00050 00051 LogDb* iLogDb; // not owned 00052 00053 private: // MProfileChangeObserver 00054 00055 virtual void HandleActiveProfileEventL(TProfileEvent aProfileEvent, 00056 TInt aProfileId); 00057 00058 private: 00059 00060 // Provides a subscription to notification, i.e. we need not keep 00061 // repeatedly making new requests. 00062 CProfileChangeNotifyHandler* iReader; 00063 00064 private: // for profile name getting 00065 00066 HBufC8* GetCurrentProfileNameL(); 00067 MProfileEngine* iProfileEngine; 00068 }; 00069 00070 #endif // __PROFILE_ENABLED__ 00071 00072 #endif /* __epoc_profile_hpp__ */ 00073 00074 /** 00075 00076 epoc-profile.hpp 00077 00078 Copyright 2009 Helsinki Institute for Information Technology (HIIT) 00079 and the authors. All rights reserved. 00080 00081 Authors: Tero Hasu <tero.hasu@hut.fi> 00082 00083 Permission is hereby granted, free of charge, to any person 00084 obtaining a copy of this software and associated documentation files 00085 (the "Software"), to deal in the Software without restriction, 00086 including without limitation the rights to use, copy, modify, merge, 00087 publish, distribute, sublicense, and/or sell copies of the Software, 00088 and to permit persons to whom the Software is furnished to do so, 00089 subject to the following conditions: 00090 00091 The above copyright notice and this permission notice shall be 00092 included in all copies or substantial portions of the Software. 00093 00094 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00095 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00096 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00097 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 00098 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 00099 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00100 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 00101 SOFTWARE. 00102 00103 **/
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:52 2011 by Doxygen 1.6.1