MCPcopy Create free account
hub / github.com/KDE/okular / canModifyPageAnnotation

Method canModifyPageAnnotation

core/document.cpp:3449–3479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3447}
3448
3449bool Document::canModifyPageAnnotation(const Annotation *annotation) const
3450{
3451 if (!annotation || (annotation->flags() & Annotation::DenyWrite)) {
3452 return false;
3453 }
3454
3455 if (!isAllowed(Okular::AllowNotes)) {
3456 return false;
3457 }
3458
3459 if ((annotation->flags() & Annotation::External) && !d->canModifyExternalAnnotations()) {
3460 return false;
3461 }
3462
3463 switch (annotation->subType()) {
3464 case Annotation::AText:
3465 case Annotation::ALine:
3466 case Annotation::AGeom:
3467 case Annotation::AHighlight:
3468 case Annotation::AStamp:
3469 case Annotation::AInk:
3470 return true;
3471 case Annotation::AWidget:
3472#if HAVE_NEW_SIGNATURE_API
3473 return dynamic_cast<const SignatureAnnotation *>(annotation);
3474#endif
3475 return false;
3476 default:
3477 return false;
3478 }
3479}
3480
3481void Document::prepareToModifyAnnotationProperties(Annotation *annotation)
3482{

Callers 4

canBeMovedMethod · 0.80
canBeResizedMethod · 0.80
AnnotWindowMethod · 0.80

Calls 3

subTypeMethod · 0.80
flagsMethod · 0.45

Tested by

no test coverage detected