|
|
User login
Feeds |
Resolving link with Browser Control API
|
|||||
| Tue, 2007-06-05 11:56 | |
|
|
|
Forum posts: 85
{
CreateWindowL();
SetRect(aRect);
ActivateL();
iLayoutObserver = CBrCtlSampleAppLayoutObserver::NewL(this);
iLinkResolver = new CBrCtlSampleAppLinkResolver(this);
iCommandBase = TBrCtlDefs::ECommandIdBase;
iBrCtlCapabilities = TBrCtlDefs::ECapabilityLoadHttpFw | TBrCtlDefs::ECapabilityDisplayScrollBar |TBrCtlDefs::ECapabilityClientNotifyURL | TBrCtlDefs::ECapabilityClientResolveEmbeddedURL;
TRect rect(Position(), Size());
iBrCtlInterface = CreateBrowserControlL( this, aRect, iBrCtlCapabilities, iCommandBase, NULL, iLinkResolver, NULL, iLayoutObserver, NULL);
iBrCtlInterface->ActivateL();
_LIT(KUrl, "http://www.yahoo.com/");
iBrCtlInterface->LoadUrlL(KUrl, -1, TBrCtlDefs::ECacheModeNoCache);
}
TBool CBrCtlLinkResolver::ResolveLinkL(const TDesC& aUrl, const TDesC& aCurrentUrl, MBrCtlLinkContent& aBrCtlLinkContent)
  {
   iMyContainer->UpdatePage(aUrl);
   }
void CMyContainer::UpdatePage(const TDesC& aUrl)
  {Â
  iBrCtlInterface->LoadUrlL(aUrl, -1, TBrCtlDefs::ECacheModeNoCache);
  }
I've also implemented MBrCtlLayoutObserver interface like in the browser control api guide, where a text should be drawn when functions' callback are called. I see that this string text is drawn for a second during the web page loading, but it disappears at once. Then when the page is loaded if I moove the mouse nothing succeeds
If you could please suggest to me where I have a leak....
Thank you very much
Forum posts: 723
As to MBrCtlLayoutObserver interface: why do you expect that anything should happen when you move the mouse? This interface is not about letting you know if the mouse is moving, but about scrolling, layout changes (left-to-right or vice versa) or updating the title.
Tote
Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/
Forum posts: 85
I've implemented ResolveLinkL method as part of CBrCtlSampleAppLinkResolver, I was wrong writing here.
Could be some TBrCtlDefs capabilities leak? Anyway I seem to use all required ones.
How should I implement to scroll the page like it was loaded in in Nokia Web Browser? I wish to could move from a link to another mooving my device mouse. I can capture mouse event like this:
  {
  if (aKeyEvent.iCode == EKeyDownArrow)
  {
  CAknInformationNote* info = new Â
      CAknInformationNote();
  info->ExecuteLD(_L("down"));
  }
  }
Thank you very much for any clue!!!
Bye, Luca
Forum posts: 723
Btw, why do you want to override the default behavior? What is your purpose, extra requirement? Do you want to entirely replace the default behavior with your new one or just do something in addition to that?
Tote
Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/
Forum posts: 723
And no, I don't think you should override OfferKeyEventL - that's already taken care of by the default implementation inside Browser Control. You CAN do it, though, if you wish, but then please don't forget to call the base class' implementation at some point in your code.
Cheers,
Tote
Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/
Forum posts: 85
Is it right implementing MBrCtlLinkResolver and MBrCtlLayoutObserver interfaces to resolve links of a loaded web pages and to scroll it (moove from a link to another with mouse)?
If you can, could you please mail to me (luca.priano@alice.it) a sample code about this, so I can understand the issue, because I'm on the horns of a dilemma
Thank you for your availability,
cheers, Luca.
Forum posts: 723
First of all, I don't have any working sample that I could provide to you. I just know something about BrCtl how it works.
Secondly, please notice that the layout observer is not for making scrolling, but for being notified about the page being scrolled. It's not the same.
And third, I'm very surprised to read that your ResolveLinkL method didn't get called. It should have been called. I am at my wits' end, too.
Tote
Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/
Forum posts: 82
If you are working on S60 3rd edition, there is a bug in Web browser.....
ResolveLink callback is never made, even if you implement observer and have all the capabilities.
I'm also trying to figure out, how to avoid this problem. I'm planning to capture mouse event and then check for the link presses(a kind of hack only for S60 3rd edition).
On FP1, everything works. I found this out by seeing the source code of S60 Webkit(opensource.nokia.com). In S60 3rd edition, webkit doesn't check for the "TBrCtlDefs::ECapabilityClientNotifyURL" and never makes call to ResolveLinkL.
I also found this bug here:
http://lists.macosforge.org/pipermail/webkit-unassigned/2006-June/012652.html
HTH
Gurpreet
www.mobisy.com
Forum posts: 85
...so it's ok
TKeyResponse CMyContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType) { if (iBrCtlInterface) { return iBrCtlInterface->OfferKeyEventL(aKeyEvent, aType); } return EKeyWasConsumed; }bye