| 9339 | |
| 9340 | |
| 9341 | class Outline: |
| 9342 | |
| 9343 | def __init__(self, ol): |
| 9344 | self.this = ol |
| 9345 | |
| 9346 | @property |
| 9347 | def dest(self): |
| 9348 | '''outline destination details''' |
| 9349 | return linkDest(self, None, None) |
| 9350 | |
| 9351 | def destination(self, document): |
| 9352 | ''' |
| 9353 | Like `dest` property but uses `document` to resolve destinations for |
| 9354 | kind=LINK_NAMED. |
| 9355 | ''' |
| 9356 | return linkDest(self, None, document) |
| 9357 | |
| 9358 | @property |
| 9359 | def down(self): |
| 9360 | ol = self.this |
| 9361 | down_ol = ol.down() |
| 9362 | if not down_ol.m_internal: |
| 9363 | return |
| 9364 | return Outline(down_ol) |
| 9365 | |
| 9366 | @property |
| 9367 | def is_external(self): |
| 9368 | if g_use_extra: |
| 9369 | # calling _extra.* here appears to save significant time in |
| 9370 | # test_toc.py:test_full_toc, 1.2s=>0.94s. |
| 9371 | # |
| 9372 | return _extra.Outline_is_external( self.this) |
| 9373 | ol = self.this |
| 9374 | if not ol.m_internal: |
| 9375 | return False |
| 9376 | uri = ol.m_internal.uri if 1 else ol.uri() |
| 9377 | if uri is None: |
| 9378 | return False |
| 9379 | return mupdf.fz_is_external_link(uri) |
| 9380 | |
| 9381 | @property |
| 9382 | def is_open(self): |
| 9383 | if 1: |
| 9384 | return self.this.m_internal.is_open |
| 9385 | return self.this.is_open() |
| 9386 | |
| 9387 | @property |
| 9388 | def next(self): |
| 9389 | ol = self.this |
| 9390 | next_ol = ol.next() |
| 9391 | if not next_ol.m_internal: |
| 9392 | return |
| 9393 | return Outline(next_ol) |
| 9394 | |
| 9395 | @property |
| 9396 | def page(self): |
| 9397 | if 1: |
| 9398 | return self.this.m_internal.page.page |
no outgoing calls
no test coverage detected
searching dependent graphs…