epoc-weburl.cpp

Go to the documentation of this file.
00001 #include "epoc-weburl.hpp"
00002 
00003 #if __WEBURL_ENABLED__
00004 
00005 /*
00006 http://wiki.forum.nokia.com/index.php/Adaptive_History_List_API
00007 http://wiki.forum.nokia.com/index.php/Adaptive_History_List_API_for_5th_Edition
00008 */
00009 
00010 #include "er_errors.h"
00011 #include "ld_logging.h"
00012 #include "sa_sensor_list_log_db.h"
00013 #include "utils_cl2.h"
00014 
00015 #include "common/utilities.h"
00016 
00017 using namespace epocxplat;
00018 
00019 // -------------------------------------------------------------------
00020 // the sensor object implementation...
00021 
00022 CTOR_IMPL_CSensor_weburl;
00023 
00024 void CSensor_weburl::ConstructL()
00025 {
00026   if (epocxplat::HasFeature(EFeatureAhleBrowser)) {
00027     iAhle = AhleBrowser::NewNotifierL(*this);
00028     logt("AhleBrowser feature supported");
00029   } else {
00030     logt("AhleBrowser feature not supported");
00031   }
00032 }
00033 
00034 CSensor_weburl::~CSensor_weburl()
00035 {
00036   delete iAhle;
00037   delete iOldUrlArray;
00038 }
00039 
00040 void CSensor_weburl::AhleBrowserError(TInt errCode)
00041 {
00042   er_log_symbian(0, errCode, "failure in weburl sensor");
00043 }
00044 
00045 // If this leaves, we get an AhleBrowserError callback.
00046 void CSensor_weburl::AhleBrowserDataL(const TDesC& aName, const TDesC& aUrl)
00047 {
00048   HBufC8* name8 = ConvToUtf8ZL(aName);
00049   CleanupStack::PushL(name8);
00050       
00051   HBufC8* url8 = ConvToUtf8ZL(aUrl);
00052 
00053   const char* name = (const char*)(name8->Ptr());
00054   const char* url = (const char*)(url8->Ptr());
00055   logg("name is '%s', URL is '%s'", name, url);
00056   log_db_log_weburl(GetLogDb(), name, url, NULL);
00057 
00058   delete url8;
00059   CleanupStack::PopAndDestroy(name8);
00060 }
00061 
00062 #endif // __WEBURL_ENABLED__
00063 
00064 /**
00065 
00066 epoc-weburl.cpp
00067 
00068 Copyright 2009-2010 Helsinki Institute for Information Technology
00069 (HIIT) and the authors. All rights reserved.
00070 
00071 Authors: Tero Hasu <tero.hasu@hut.fi>
00072 
00073 Permission is hereby granted, free of charge, to any person
00074 obtaining a copy of this software and associated documentation files
00075 (the "Software"), to deal in the Software without restriction,
00076 including without limitation the rights to use, copy, modify, merge,
00077 publish, distribute, sublicense, and/or sell copies of the Software,
00078 and to permit persons to whom the Software is furnished to do so,
00079 subject to the following conditions:
00080 
00081 The above copyright notice and this permission notice shall be
00082 included in all copies or substantial portions of the Software.
00083 
00084 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00085 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00086 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00087 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
00088 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
00089 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00090 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00091 SOFTWARE.
00092 
00093  **/

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