webengine/wmlengine/src/MVC/src/MVCView.cpp
branchRCL_3
changeset 92 e1bea15f9a39
parent 37 cb62a4f66ebe
equal deleted inserted replaced
91:30342f40acbf 92:e1bea15f9a39
   135 NW_LMgr_Box_DumpBoxTree(NW_LMgr_Box_t* box);
   135 NW_LMgr_Box_DumpBoxTree(NW_LMgr_Box_t* box);
   136 #endif /* DEBUG_LOG */
   136 #endif /* DEBUG_LOG */
   137 #endif /* DEBUG */
   137 #endif /* DEBUG */
   138 #endif /* WINS */
   138 #endif /* WINS */
   139 
   139 
   140 
   140 //CONSTANT
       
   141 const TInt KPeriodicTimerStartInterval2Sec(750000);
   141 // ============================= PRIVATE FUNCTIONS ===============================
   142 // ============================= PRIVATE FUNCTIONS ===============================
   142 NW_Bool
   143 NW_Bool
   143 CView::ProcessFontSizeChangeEvent ()
   144 CView::ProcessFontSizeChangeEvent ()
   144 {
   145 {
   145   iDeviceContext->SetFontSizeLevel();
   146   iDeviceContext->SetFontSizeLevel();
  1905     {
  1906     {
  1906     DrawableWindow()->SetPointerGrab(ETrue);
  1907     DrawableWindow()->SetPointerGrab(ETrue);
  1907     EnableDragEvents();
  1908     EnableDragEvents();
  1908     }
  1909     }
  1909   
  1910   
       
  1911   iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityHigh);
       
  1912   
  1910   ActivateL();
  1913   ActivateL();
  1911   }
  1914   }
  1912 
  1915 
  1913 // -----------------------------------------------------------------------------
  1916 // -----------------------------------------------------------------------------
  1914 // CView::NewL
  1917 // CView::NewL
  1927 
  1930 
  1928 //-----------------------------------------------------------------------------
  1931 //-----------------------------------------------------------------------------
  1929 // Destructor
  1932 // Destructor
  1930 CView::~CView()
  1933 CView::~CView()
  1931 {
  1934 {
       
  1935     if(iPeriodicTimer)
       
  1936     {
       
  1937         // Calling Cancel without checking if the timer is active is safe
       
  1938         iPeriodicTimer->Cancel();
       
  1939         delete iPeriodicTimer;
       
  1940     }
  1932   // remove observer
  1941   // remove observer
  1933   //CBrowserSettings::Instance()->RemoveObserver();
  1942   //CBrowserSettings::Instance()->RemoveObserver();
  1934 
  1943 
  1935   if(iNotifyHandler)
  1944   if(iNotifyHandler)
  1936   {
  1945   {
  4318                 }
  4327                 }
  4319             if ((aPointerEvent.iType == TPointerEvent::EButton1Up) && (iShouldActivate))
  4328             if ((aPointerEvent.iType == TPointerEvent::EButton1Up) && (iShouldActivate))
  4320                 {
  4329                 {
  4321                     if((!iDrag))
  4330                     if((!iDrag))
  4322                     {
  4331                     {
       
  4332                         if(!iPeriodicTimer->IsActive() )
       
  4333                         {
       
  4334                             iPeriodicTimer->Start(KPeriodicTimerStartInterval2Sec, NULL, TCallBack(PeriodicTimerCallBack, this));
       
  4335                         }
       
  4336                         else
       
  4337                         {
       
  4338                             continue;
       
  4339                         }
  4323                         NW_Evt_ActivateEvent_t actEvent;
  4340                         NW_Evt_ActivateEvent_t actEvent;
  4324                         NW_Evt_ActivateEvent_Initialize (&actEvent);
  4341                         NW_Evt_ActivateEvent_Initialize (&actEvent);
  4325                         ProcessEvent (NW_Evt_EventOf(&actEvent));
  4342                         ProcessEvent (NW_Evt_EventOf(&actEvent));
  4326                     }
  4343                     }
  4327                 }
  4344                 }
  5578             }
  5595             }
  5579         }    
  5596         }    
  5580     Draw(NW_TRUE);
  5597     Draw(NW_TRUE);
  5581     }
  5598     }
  5582 
  5599 
  5583 
  5600 void CView::CancelPeriodicTimer()
       
  5601     {
       
  5602     if(iPeriodicTimer) 
       
  5603         iPeriodicTimer->Cancel();
       
  5604     }
       
  5605 
       
  5606 TInt CView::PeriodicTimerCallBack(TAny* aAny)
       
  5607     {
       
  5608     CView* self = static_cast<CView*>( aAny );
       
  5609     self->CancelPeriodicTimer();
       
  5610     return KErrNone;
       
  5611     }
  5584 // ============================ MEMBER FUNCTIONS ===============================
  5612 // ============================ MEMBER FUNCTIONS ===============================