How to mimic "licensed features" as in EU Editor
Posted: Wed Jan 29, 2020 3:28 pm
Hi support,
In EU Editor (without license) if some features are used, like "flatten comments", the info bar will display the "licensed features used ... demo stamps placed.. if saved...".
How would I go about adding something like "licensed features" using the SDK?
Say I have defined some actions and I have IPXV_Document::OperationHistory.AddNew (or [Begin|End]Macro) for each. Some of those actions are "special" and if they were used I'd like to disable saving of the document.
My idea:
- Before (any type of) save operation is initiated, I'll somehow check if "special" actions were used and cancel the save (via events).
- How to lookup IPXV_Document::OperationHistory to see if it contains my "special" action(s)? The AddNew methods accepts nFlags parameter - so maybe I could use it to store something that would mark the item as "special" - however I do not see how to read this from IOperationHistoryItem.
- Is there a limit to OperationHistory items? As if the above makes sense, I need to ensure the following will not happen: my special action executed, then a series of standard actions, and as a result my special action is lost in OperationHistory due to, and I guess, MaxUsedMemSize.
Also: how can I check if some of the standard features, like "flatten comments" was executed (and not undone) on a document?
Finally: how can I add my own message (type) to the document info bar? If my special features are used I'd like the info bar to display my custom message (like it does for licensed features in EU Editor).
p.s.
I think I've found a bug in the EU Editor related to "licensed options" - if "Bookmark Every Nth page" is executed, the protected feature warning will appear, but the info bar will not display the warning nor will the demo stamp be placed upon save.
-žarko
In EU Editor (without license) if some features are used, like "flatten comments", the info bar will display the "licensed features used ... demo stamps placed.. if saved...".
How would I go about adding something like "licensed features" using the SDK?
Say I have defined some actions and I have IPXV_Document::OperationHistory.AddNew (or [Begin|End]Macro) for each. Some of those actions are "special" and if they were used I'd like to disable saving of the document.
My idea:
- Before (any type of) save operation is initiated, I'll somehow check if "special" actions were used and cancel the save (via events).
- How to lookup IPXV_Document::OperationHistory to see if it contains my "special" action(s)? The AddNew methods accepts nFlags parameter - so maybe I could use it to store something that would mark the item as "special" - however I do not see how to read this from IOperationHistoryItem.
- Is there a limit to OperationHistory items? As if the above makes sense, I need to ensure the following will not happen: my special action executed, then a series of standard actions, and as a result my special action is lost in OperationHistory due to, and I guess, MaxUsedMemSize.
Also: how can I check if some of the standard features, like "flatten comments" was executed (and not undone) on a document?
Finally: how can I add my own message (type) to the document info bar? If my special features are used I'd like the info bar to display my custom message (like it does for licensed features in EU Editor).
p.s.
I think I've found a bug in the EU Editor related to "licensed options" - if "Bookmark Every Nth page" is executed, the protected feature warning will appear, but the info bar will not display the warning nor will the demo stamp be placed upon save.
-žarko