Package 

Interface TocHandler


  • 
    public interface TocHandler
    
                        

    Interface for Table of Contents handlers. Implement this to create custom TOC UI (sidesheet, bottom sheet, dialog, etc.)

    • Method Summary

      Modifier and Type Method Description
      abstract Unit updateToc(List<PdfBookmark> bookmarks) Update the TOC with the given bookmarks.
      abstract Unit show() Show the TOC UI
      abstract Unit hide() Hide the TOC UI
      Unit toggle() Toggle TOC visibility
      abstract Boolean isVisible()
      abstract Unit onBookmarkSelected(Function1<Integer, Unit> callback) Set the callback for when a bookmark is selected.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • updateToc

         abstract Unit updateToc(List<PdfBookmark> bookmarks)

        Update the TOC with the given bookmarks. Called when the PDF document is loaded.

        Parameters:
        bookmarks - List of bookmarks from the PDF
      • show

         abstract Unit show()

        Show the TOC UI

      • hide

         abstract Unit hide()

        Hide the TOC UI

      • onBookmarkSelected

         abstract Unit onBookmarkSelected(Function1<Integer, Unit> callback)

        Set the callback for when a bookmark is selected. The callback receives the page index to navigate to.

        Parameters:
        callback - Function that receives the target page index (0-indexed)