epoc-profile-31.hpp

Go to the documentation of this file.
00001 #ifndef __epoc_profile_31_hpp__
00002 #define __epoc_profile_31_hpp__
00003 
00004 #include "application_config.h"
00005 
00006 #if __PROFILE_ENABLED__ && __HAVE_PROFILEENGINE_LIB__
00007 
00008 #include "ld_log_db.h"
00009 
00010 #include <glib.h>
00011 
00012 #include <e32base.h>
00013 
00014 // S60 v3.1, v3.2 and v5.0 SDKs include ``mproengprofile.h``, and
00015 // hence we are using that in all but v3.0 builds. Can link against
00016 // profileengine.lib, use the API in
00017 // ``mproengactiveprofileobserver.h``, WriteDeviceData required only
00018 // for changing profile.
00019 #include <mproengengine.h> // profileengine.lib
00020 #include <mproengnotifyhandler.h>
00021 #include <mproengprofileactivationobserver.h>
00022 
00023 NONSHARABLE_CLASS(CSensor_profile) : 
00024   public CBase, 
00025   public MProEngProfileActivationObserver
00026 {
00027  public:
00028 
00029   // For simplicity, we make sure to implement the same interface here
00030   // as the other CSensor_profile variant(s).
00031 
00032   static CSensor_profile* NewL(LogDb* aLogDb);
00033 
00034   virtual ~CSensor_profile();
00035 
00036   gboolean StartL(GError** error);
00037 
00038   void Stop();
00039 
00040   gboolean IsActive() { return iNotifyHandler && iIsActive; }
00041 
00042  private:
00043  
00044   CSensor_profile(LogDb* aLogDb);
00045 
00046   void ConstructL();
00047 
00048  private: // MProEngProfileActivationObserver
00049 
00050   virtual void HandleProfileActivatedL(TInt aProfileId);
00051 
00052   // The default empty implementation suits us fine.
00053   //virtual void HandleProfileActivationNotificationError(TInt);
00054 
00055  private: // utils
00056 
00057   HBufC8* GetCurrentProfileNameL();
00058 
00059  private: // property
00060 
00061   LogDb* iLogDb; // not owned
00062 
00063   MProEngEngine* iProfileEngine;
00064 
00065   MProEngNotifyHandler* iNotifyHandler;
00066 
00067   TBool iIsActive;
00068 
00069 };
00070 
00071 #endif // __PROFILE_ENABLED__
00072 
00073 #endif /* __epoc_profile_31_hpp__ */
00074 
00075 /**
00076 
00077 epoc-profile-31.hpp
00078 
00079 Copyright 2009 Helsinki Institute for Information Technology (HIIT)
00080 and the authors. All rights reserved.
00081 
00082 Authors: Tero Hasu <tero.hasu@hut.fi>
00083 
00084 Permission is hereby granted, free of charge, to any person
00085 obtaining a copy of this software and associated documentation files
00086 (the "Software"), to deal in the Software without restriction,
00087 including without limitation the rights to use, copy, modify, merge,
00088 publish, distribute, sublicense, and/or sell copies of the Software,
00089 and to permit persons to whom the Software is furnished to do so,
00090 subject to the following conditions:
00091 
00092 The above copyright notice and this permission notice shall be
00093 included in all copies or substantial portions of the Software.
00094 
00095 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00096 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00097 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00098 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
00099 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
00100 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00101 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00102 SOFTWARE.
00103 
00104  **/

ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:52 2011 by Doxygen 1.6.1