On May 18, 7:50 pm, martin <rack...@gmail.com> wrote:
> On May 13, 11:37 am, martin <rack...@gmail.com> wrote:
>
> > hi,
>
> > I would like to implement zoom in and out feature for my embedded
> > browser. I used the new embedding API so I didn't get in touch with
> > XPCOM API, now I would like to learn something more about it but
> > there's no any documentation which could be helpful for a beginner,
> > I've found mozilla cross reference, but it's a bit confusing for
> > someone who's about to start using XPCOM.
> > Could you please point me to the right direction, so I could implement
> > the zooming ability for my browser? what interfaces should I query or
> > point my attention to?
> > Thank you in advance.
>
> Since nobody replied a long time I tried to achieve it alone and this
> is what I've done:
>
> void MozView::SetFullZoom(float aZoomLevel)
> {
>         nsCOMPtr<nsIInterfaceRequestor> requestor;
>         this->GetInterfaceRequestor(getter_AddRefs(requestor));
>         nsCOMPtr<nsIDocShell> docShell = do_GetInterface(requestor);
>         if (docShell){
>                 nsCOMPtr<nsIContentViewer> cv;
>                 docShell->GetContentViewer(getter_AddRefs(cv));
>                 nsCOMPtr<nsIMarkupDocumentViewer> mdv = do_QueryInterface(cv);
>                 if (mdv) {
>                         mdv->SetFullZoom(aZoomLevel);
>                 }
>         }
>
> }
>
> I've added new method to the MozView wrapper class. This one looks to
> work ok. I hope it will help someone in the future.

i wanted the zoom text ability - this is what worked for me...

void CGeckoBasicBrowser::SetTextZoom(const float& fSize)
{
        class nsIDOMWindow *domWindow;
        nsresult rv = m_webBrowser->GetContentDOMWindow(&domWindow);
        if (NS_FAILED(rv)) return;
        domWindow->SetTextZoom(fSize);
}
_______________________________________________
dev-embedding mailing list
dev-embedding@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to