# Introduction

# Features

In MarginNote 3.6.7, we added support for MarginNote plugins. Everyone can now influence how the MarginNote functions. Using JavaScript, developers can develop their own plugins to cater to specific needs that the MarginNote team cannot address or have not addressed. The support for plugins will bring more possibilities to MarginNote and help MarginNote function more efficiently and effectively. There are many plugins on our forum, including ones developed by our users and by us, and they are well-received by many users. We want to help push our plugin community forward, so in this document, we will be introducing to you some basic knowledge in developing MarginNote plugins so that you could create a plugin of your own.

# Preparations

You do not need to install any local dependencies to start developing plugins for MarginNote. All you will need to do is to pull the project template and API head files from github.

git clone https://github.com/MarginNote/Addon.git

In the folder that you've pulled down from github, the API directory lists all the available APIs, and the Samples directory gives you a sample project.

We recommend you to base your development on the HelloWorld file provided under the Samples directory.

# Project Structure

While developing a plugin for MarginNote 3, you should use the following organization structure, on the basis of which you can add your own source files. Here is the project structure:

|- main.js			# Implementing the main functions of your plugin
|- mnaddon.json		# Config information about your plugin
|- pic.png			# Logo for your plugin
|- README.md		# Description of your plugin

# Building and Installing

Go to the current project directory:

cd work_space // If your main.js is stored under the work_space directory

Build your plugin:

zip -r myAddon.mnaddon *
//myAddon.mnaddon is the name of your plugin. You can customize "myAddon" to whatever you like. The suffix `.mnaddon` cannot be altered.

After this, you can click on the file myAddon.mnaddon that has been generated to install it in MarginNote 3.

# Hello World

You've gathered the related resource files and have gained an understanding of the project structure for a typical MarginNote 3 plugin and how to build it. You can now use the source code in HelloWorld to create your first plugin, build it, and install it to MarginNote 3. This pugin will cause "Hello World!" to pop up after MarginNote 3 opens.

Note that, by now, the plugin you have created has not been officially signed, and users would get a safety warning from MarginNote if they use it. You can apply for the official signature to have us check the safety of your plugin and get a signature.

# Life Cycle

Every plugin will go through a series of initialization process, such as setting prompting message, loading WebViewController etc. Developers can add their own code to different stages of the life cycle.

# Instances

  • sceneWillConnect

    Run the code after MarginNote opened a window.

  • sceneDidDisconnect

    Run the code after MarginNote closed a window.

  • sceneWillResignActive

    Run the code after MarginNote reactivated a window

  • scenceDidBecomeActive

    Run the code after MarginNote activated a window

  • notebookWillOpen

    Run the code after MarginNote opened a notebook

  • notebookWillClose

    Run the code after MarginNote closed a notebook

  • documentDidOpen

    Run the code after MarginNote opened a document

  • documentWillClose

    Run the code after MarginNote closed a document

  • queryAddonCommandStatus

    Query the command status of the plugin

# Class

  • addonDidConnect

    The addon has finished loading

  • addonWillDisconnect

    The addon has been turned off

  • applicationDidEnterBackground

    The application has entered background

  • applicationWillEnterForeground

    The application has entered foreground

  • applicationDidReceiveLocalNotification

    The application has received local notivation

# Objective C or JavaScript?

As is know to all, applications in the Apple ecosystem are developed using either Objective-C or Swift. As a result, although the plugins for MarginNote 3 uses JavaScript, it essentially calls the related code written in Objective-C. Therefore, in the following API explanation, we have provided related Objective-C declarations.

In a real-world development scenario, you will be using JavaScript. We use JSBridge to link your JavaScript code into Objective-C. So, you should mainly focus on the data types and grammar of JavaScript, and do not have to pay much attention to the specific linking process.

The link between Objective-C and JavaScript is not complicated. Objective-C defines some classes and the properties and methods inside it. To use a class, simply create an instance of that class in JavaScript in a JavaScript-manner and call its properties and methods.

For example, we can use the following method to know the current color theme of MarginNote 3.

Application.sharedInstance().currentTheme;

The declaration of this property in Objective-C is in the Application class, and the related code are:

+ (id<MbAppDelegate>)sharedInstance; //Class method, returns an instance

@property (nonatomic, readonly) NSString * currentTheme; //property

In JavaScript or other object-oriented programming language, we need to create an instance before calling the properties. Normally, we would use new to create an instance. However, in Objective-C, we declared some class methods (static methods) for the related classes. You can directly call these methods by their names. In this example, you only need to write the following code in JavaScript:

Application.sharedInstance()

What this code does is that it calls the sharedInstance() method in the Application class, which will return an instance of the class. In other words, the code above is equivalent to creating a new instance using the new keyword.

After we have created an instance, we can call for the instance properties and instance methods:

Application.sharedInstance().currentTheme;

Now, this code is easy to understand. First, it uses Application.sharedInstance() to get an instance of the class. Then, it calls the currentTheme property of the instance.

In writing an addon for MarginNote, all you need to care about is what kind of classes have been defined in Objective-C and the ways to get an instance of the class so that you could call the properties and methods of them. You do not need to pay much attention to Objective-C itself.

# Foundation

The Foundation framework is an object-oriented library. It is similar to the standard library and can be used in Mac OS and iOS. It offers numbers, strings, containers such as arrays, dictionaries, and collections, time management, memory management, and file system, etc. As data is the basis of all programs, it is necessary to have a basic understanding of the different data types while developing addons for MarginNote.

# Notification

# Add Observer

Declaration in Objective-C:

JSExportAs(addObserverSelectorName,
- (coid)_addObserver:(id)observer selector: (NSString*)aSelector name:(NSString *)aName);

Calling the function in JavaScript:

NSNotificationCenter.defaultCenter().addObserverSelectorName(self, 'onProcessExcerptText:', 'ProcessNewExcerpt');

# Remove Observer

JSExportAs(remove ObserverName, 
- (void)_removeObserver: (id)observer name: (NSString *)aName);

# Sender

When a message is ==active==, it will send the object NSConcreteNotification to a speficied function. We can use the userInfo property to obtain the information included in the operation.

Normally, when we are dealing with documents, sender.userInfo will contain a documentController object. When we are dealing with notes, sender.userInfo will contain a note object.

# MarginNote

The MarginNote library contains a set of APIs to control MarginNote 3. By knowing the following frequently-used APIs, you can implement features such as manipulating the mindmaps etc.

# Application

# Application

# Create an Instance

Objective-C declaration:

+ (id<MbAppDelegate>)sharedInstance;

Calling it in JavaScript:

Application.sharedInstance()

# Current Theme

Objective-C declaration:

@property (nonatomic, readonly) NSString * currentTheme;

Calling it in JavaScript:

Application.sharedInstance().currentTheme;

# Default Tint Color for Dark Background

Objective-C declaration:

@property (nonatomic, readonly) UIColor* defaultTintColorForDarkBackground;

Calling it in JavaScript:

Application.sharedInstance().defaultTintColorForDarkBackground;

# Default Tint Color for Selected

Objective-C declaration:

@property (nonatomic, readonly) UIColor* defaultTintColorForSelected;

Calling it in JavaScript:

Application.sharedInstance().defaultTintColorForSelected;

# Default Tint Color

Objective-C declaration:

@property (nonatomic, readonly) UIColor* defaultTintColor;

Calling it in JavaScript:

Application.sharedInstance().defaultTintColor;

# Default Book Page Color

Objective-C declaration:

@property (nonatomic, readonly) UIColor* defaultBookPageColor;

Calling it in JavaScript:

Application.sharedInstance().defaultBookPageColor;

# Default Notebook Color

Objective-C declaration:

@property (nonatomic, readonly) UIColor* defaultNotebookColor;

Calling it in JavaScript:

Application.sharedInstance().defaultNotebookColor;

# Default Text Color

Objective-C declaration:

@property (nonatomic, readonly) UIColor* defaultTextColor;

Calling it in JavaScript:

Application.sharedInstance().defaultTextColor;

# Default Disable Color

Objective-C declaration:

@property (nonatomic, readonly) UIColor* defaultDisableColor;

Calling it in JavaScript:

Application.sharedInstance().defaultDisableColor;

# Default Highlight Blend Color

Objective-C declaration:

@property (nonatomic, readonly) UIColor* defaultHighlightBlendColor;

Calling it in JavaScript:

Application.sharedInstance().defaultHighlightBlendColor;

# Focus Window

Objective-C declaration:

@property (nonatomic, readonly, getter=window) UIWindow* focusWindow;

Calling it in JavaScript:

Application.sharedInstance().focusWindow;

# Database Path

Objective-C declaration:

@property (nonatomic, readonly) NSString *dbPath;

Calling it in JavaScript:

Application.sharedInstance().dbPath;

# Document Path

Objective-C declaration:

@property (nonatomic, readonly) NSString *documentPath;

Calling it in JavaScript:

Application.sharedInstance().documentPath;

# Cache Path

Objective-C declaration:

@property (nonatomic, readonly) NSString *cachePath;

Calling it in JavaScript:

Application.sharedInstance().cachePath;

# Temporary Path

Objective-C declaration:

@property (nonatomic, readonly) NSString *tempPath;

Calling it in JavaScript:

Application.sharedInstance().tempPath;

# Operating System Type

Objective-C declaration:

@property (nonatomic, readonly) NSInteger osType; //0: iPadOS 1: iPhoneOS 2: macOS

Calling it in JavaScript:

Application.sharedInstance().osType;

# Refresh After Database Changed

Objective-C declaration:

- (void)refreshAfterDBChanged:(NSString*)topicid;

Calling it in JavaScript:

Application.sharedInstance().refreshAfterDBChanged();

# Query Command with Key Flags in Window

Objective-C declaration:

JSExportAs(queryCommandWithKeyFlagsInWindow,
- (NSDictionary*)queryCommandStatus:(NSString*)command withKeyFlags:(NSInteger)keyFlags inWindow:(UIWindow*)window);

Calling it in JavaScript:

Application.sharedInstance().queryCommandWithKeyFlagsInWindow();

# Process Command

Objective-C declaration:

- (void)processCommand:(NSString*)command withKeyFlags:(NSInteger)keyFlags inWindow:(UIWindow*)window;

Calling it in JavaScript:

Application.sharedInstance().processCommand();

# Open URL

Objective-C declaration:

- (void)openURL:(NSURL*)url;

Calling it in JavaScript:

Application.sharedInstance().openURL();

# Alert Window

Objective-C declaration:

- (void)alert:(NSString*)message;

Calling it in JavaScript:

Application.sharedInstance().alert("hello world!");

# ==Show HUD== ? Heads Up Display?

Objective-C declaration:

-(void)showHUD:(NSString*)message onView:(UIView*)view withDuration:(double)duration);

Calling it in JavaScript:

Application.sharedInstance().showHUD("hello world!",self.window,2);

# ==Wait HUD==

Objective-C declaration:

- (void)waitHUD:(NSString*)message onView:(UIView*)view;

Calling it in JavaScript:

Application.sharedInstance().waitHUD();

# ==Stop Wait HUD==

Objective-C declaration:

- (void)stopWaitHUDOnView:(UIView*)view;

Calling it in JavaScript:

Application.sharedInstance().stopWaitHUDOnView();

# Save File

Objective-C declaration:

- (void)saveFile:(NSString*)mfile withUti:(NSString*)uti;

Calling it in JavaScript:

Application.sharedInstance().saveFile();

# Create Study Board Controller

Objective-C declaration:

JSExportAs(studyController,
- (id<JSBStudyController>)studyboardController:(UIWindow*)window);

Calling it in JavaScript:

Application.sharedInstance().studyController();

# Check Notify Sender in Window

Objective-C declaration:

JSExportAs(checkNotifySenderInWindow,
- (BOOL)checkObject:(id)obj inWindow:(UIWindow*)window);

Calling it in JavaScript:

Application.sharedInstance().checkNotifySenderInWindow();

# Open File With Universal Type Identifier

Objective-C declaration:

JSExportAs(openFileWithUTIs,
- (void)openFileWithUTIs:(NSArray<NSString*>*)types viewController:(UIViewController*)controller block:(JSValue*)block);

Calling it in JavaScript:

Application.sharedInstance().openFileWithUTIs();

# Register HTML Comment Editor

Objective-C declaration:

JSExportAs(regsiterHtmlCommentEditor,
- (void)regsiterHtmlCommentEditor:(NSDictionary*)commentEditor htmlEditor:(JSValue*)htmlEditor htmlRender:(JSValue*)htmlRender withCommentTag:(NSString*)commentTag);

Calling it in JavaScript:

Application.sharedInstance().regsiterHtmlCommentEditor();

# Unregister HTML Comment Editor

Objective-C declaration:

JSExportAs(unregsiterHtmlCommentEditor,
- (void)unregsiterHtmlCommentEditorWithCommentTag:(NSString *)commentTag);

Calling it in JavaScript:

Application.sharedInstance().unregsiterHtmlCommentEditor();

# Document Controller

# Document

Objective-C declaration:

@property (nonatomic, readonly, getter=currBook) MbBook* document;

# Document MD5

Objective-C declaration:

@property (nonatomic, readonly, getter=currentBookMd5) NSString* docMd5;

# Notebook ID

Objective-C declaration:

@property (nonatomic, readonly, getter=currTopicId) NSString* notebookId;

# Focus Note

Objective-C declaration:

@property (nonatomic, readonly, getter=focusNote) MbBookNote* focusNote;

# Visible Focus Note

Objective-C declaration:

@property (nonatomic, readonly, getter=visibleFocusNote) MbBookNote* visibleFocusNote;

# Selected Text

Objective-C declaration:

@property (nonatomic, readonly, getter=selectionText) NSString* selectionText;

# MindMapNode

# Note

Objective-C declaration:

@property (nonatomic,readonly) MbBookNote * note;

# Parent Node

Objective-C declaration:

@property (nonatomic,readonly,getter=parentNote) MindMapNote* parentNode;

Objective-C declaration:

@property (nonatomic,readonly) NSArray* summaryLinks;

# Child Nodes

Objective-C declaration:

@property (nonatomic,readonly,getter=childNotes) NSArray* childNodes;

# Framework

Objective-C declaration:

@property (nonatomic,readonly) CGRect frame;

# Mindmap View

# Mindmap Nodes

Objective-C declaration:

@property (nonatomic,readonly) NSArray * mindmapNodes;

# Selection View

Objective-C declaration:

@property (nonatomic,readonly) NSArray * selViewLst;

# Outline View

Objective-C declaration:

@property (nonatomic,readonly) id<JSBOutlineView> outlineView;

# Mindmap View

Objective-C declaration:

@property (nonatomic,readonly,getter=noteMindMap) id<JSBMindMapView> mindmapView;

# Notebook ID

Objective-C declaration:

@property (nonatomic, readonly, getter=currTopic) NSString* notebookId;

# Focus Note

Objective-C declaration:

@property (nonatomic, readonly, getter=focusNote) MbBookNote* focusNote;

# Visible Focus Note

Objective-C declaration:

@property (nonatomic, readonly, getter=visibleFocusNote) MbBookNote* visibleFocusNote;

# Outline View

# Note From Index Path

Objective-C declaration:

- (MbBookNote*)noteFromIndexPath:(NSIndexPath*)indexPath;

# Reader Controller

# Current Document Controller

Objective-C declaration:

@property (nonatomic, readonly, getter=fBookViewController) id<JSBDocumentController> currentDocumentController;

# Document Controllers

Objective-C declaration:

@property (nonatomic, readonly, getter=bookViewControllers) NSMutableArray* documentControllers;

# Study Controller

# Study Mode

Objective-C declaration:

@property (nonatomic,readonly) int studyMode; //0 & 1: doc mode 2: study mode 3: review mode

# Narrow Mode

Objective-C declaration:

@property (nonatomic,readonly,getter=isNarrowMode) BOOL narrowMode; //when narrowmode, book split mode 1 is disabled

# Document and Mindmap Split Mode

Objective-C declaration:

@property (nonatomic,assign,getter=bookSplitMode,setter=setBookSplitMode:) int docMapSplitMode; //0: all map 1:half map half doc 2: all doc

# Right Mindmap Mode

Objective-C declaration:

@property (nonatomic,assign) BOOL rightMapMode;

# Notebook Controller

Objective-C declaration:

@property (nonatomic,readonly,getter=fSearchViewController) id<JSBNotebookController> notebookController;

# Reader Controller

Objective-C declaration:

@property (nonatomic,readonly,getter=detailController) id<JSBReaderController> readerController;

# Focus Note in Mindmap by ID

Objective-C declaration:

- (void)focusNoteInMindMapById:(NSString*)noteId;

# Focus Note in Document by ID

Objective-C declaration:

- (void)focusNoteInDocumentById:(NSString*)noteId;

# Refresh Addon Commands

Objective-C declaration:

- (void)refreshAddonCommands;

# NoteDatabase

# MbBook

# Current Topic ID

Objective-C declaration:

@property (nonatomic,readonly,getter=currenttopicid) NSString * currentTopicId;

# Last Visit

Objective-C declaration:

@property (nonatomic,readonly,getter=lastvisit) NSDate * lastVisit;

# Document MD5

Objective-C declaration:

@property (nonatomic,readonly,getter=md5real) NSString * docMd5;

# Path File

Objective-C declaration:

@property (nonatomic,readonly) NSString * pathFile;

# Document Title

Objective-C declaration:

@property (nonatomic,readonly,getter=bookTitle) NSString * docTitle;

# MbBookNote

# Excerpt Text

Objective-C declaration:

@property (nonatomic,readwrite,getter=highlight_text,setter=_setHighlightText:) NSString * excerptText;

# Note Title

Objective-C declaration:

@property (nonatomic,readwrite,getter=notetitle,setter=_setNoteTitle:) NSString * noteTitle;

# Color Index

Objective-C declaration:

@property (nonatomic,readwrite,getter=highStyleColorType,setter=_setHighStyleColorType:) int colorIndex;

# Fill Index

Objective-C declaration:

@property (nonatomic,readwrite,getter=highStyleFillType,setter=_setHighStyleFillType:) int fillIndex;

# Mindmap Position

Objective-C declaration:

@property (nonatomic,readwrite) CGPoint mindmapPosition;

# Note ID

Objective-C declaration:

@property (nonatomic,readonly,getter=noteid) NSString * noteId;

# Document MD5

Objective-C declaration:

@property (nonatomic,readonly,getter=bookmd5) NSString * docMd5;

# Notebook ID

Objective-C declaration:

@property (nonatomic,readonly,getter=topicid) NSString * notebookId;

# Start Page

Objective-C declaration:

@property (nonatomic,readonly,getter=startpage) NSNumber * startPage;

# End Page

Objective-C declaration:

@property (nonatomic,readonly,getter=endpage) NSNumber * endPage;

# Start Position

Objective-C declaration:

@property (nonatomic,readonly,getter=startpos) NSString * startPos;

# End Position

Objective-C declaration:

@property (nonatomic,readonly,getter=endpos) NSString * endPos;

# Excerpt Pic

Objective-C declaration:

@property (nonatomic,readonly,getter=highlight_pic) NSDictionary * excerptPic;

# Create Date

Objective-C declaration:

@property (nonatomic,readonly,getter=highlight_date) NSDate * createDate;

# Modified Date

Objective-C declaration:

@property (nonatomic,readonly,getter=note_date) NSDate * modifiedDate;

# Media List

Objective-C declaration:

@property (nonatomic,readonly,getter=media_list) NSString * mediaList;

# Original Note ID

Objective-C declaration:

@property (nonatomic,readonly,getter=evernoteid) NSString * originNoteId;

# Mindmap Branch Close

Objective-C declaration:

@property (nonatomic,readonly,getter=mindclose) NSNumber * mindmapBranchClose;

# Notes Text

Objective-C declaration:

@property (nonatomic,readonly,getter=notes_text) NSString * notesText;

# Group Note ID

Objective-C declaration:

@property (nonatomic,readonly,getter=groupnoteid) NSString * groupNoteId;

# Comments

Objective-C declaration:

@property (nonatomic,readonly,getter=comments) NSArray * comments;

# Parent Note

Objective-C declaration:

@property (nonatomic,readonly) MbBookNote * parentNote;

# Linked Notes

Objective-C declaration:

@property (nonatomic,readonly,getter=linkNotes) NSArray * linkedNotes;

# Child Notes

Objective-C declaration:

@property (nonatomic,readonly,getter=childNotes) NSArray * childNotes;

Objective-C declaration:

@property (nonatomic,readonly,getter=summaryLinks) NSArray * summaryLinks;

# Z Level

Objective-C declaration:

@property (nonatomic,readonly) NSNumber * zLevel;

# Hidden

Objective-C declaration:

@property (nonatomic,readonly) NSNumber * hidden;

# TOC

Objective-C declaration:

@property (nonatomic,readonly) NSNumber * toc;

# Annotation

Objective-C declaration:

@property (nonatomic,readonly) NSNumber * annotation;

# Text First

Objective-C declaration:

@property (nonatomic,readonly) NSNumber * textFirst;

# Group Mode

Objective-C declaration:

@property (nonatomic,readonly) NSNumber * groupMode;

# Flashcard

Objective-C declaration:

@property (nonatomic,readonly) NSNumber * flashcard;

# Summary

Objective-C declaration:

@property (nonatomic,readonly,getter=hasSummaryLinks) BOOL summary;

# Flagged

Objective-C declaration:

@property (nonatomic,readonly) NSNumber * flagged;

# Text Highlight

Objective-C declaration:

@property (nonatomic,readonly) NSDictionary * textHighlight;

# Options

Objective-C declaration:

@property (nonatomic,readonly) NSDictionary * options;

# MbModelTool

# Get Notebook by ID

Objective-C declaration:

JSExportAs(getNotebookById,
- (id)getTopicFromId:(NSString*)topicid);

# Get Media by Hash

Objective-C declaration:

JSExportAs(getMediaByHash,
- (NSData*)getMediaFromHash:(NSString*)hash);

# Get Note by ID

Objective-C declaration:

JSExportAs(getNoteById,
- (id)getNoteFromId:(NSString*)noteid);

# Get Document by ID

Objective-C declaration:

JSExportAs(getDocumentById,
- (id)getBookFromMd5:(NSString*)md5);

# Get Flashcard by Note ID

Objective-C declaration:

JSExportAs(getFlashcardByNoteId,
- (id)getNoteByEvernoteId:(NSString*)noteid topicid:(NSString*)topicid);

# Get Flashcards by Note ID

Objective-C declaration:

JSExportAs(getFlashcardsByNoteId,
- (NSArray*)getNotesByEvernoteId:(NSString*)noteid);

# Has Flashcard by Note ID

Objective-C declaration:

JSExportAs(hasFlashcardByNoteId,
- (BOOL)hasNotesForEvernoteId:(NSString*)noteid);

# Save Database

Objective-C declaration:

- (void)savedb;

# All Notebooks

Objective-C declaration:

- (NSArray *)allNotebooks;

# All Documents

Objective-C declaration:

- (NSArray*)allDocuments;

# Set Notebooks Sync Dirty

Objective-C declaration:

JSExportAs(setNotebookSyncDirty,
- (void)setTopicDirty:(NSString*)topicid);

# Save History Archive

Objective-C declaration:

- (NSArray*)saveHistoryArchive:(NSString*)topicid key:(NSString*)key;

# Load History Archive

Objective-C declaration:

- (NSArray*)loadHistoryArchive:(NSString*)topicid key:(NSString*)key;

# Delete Book Note

Objective-C declaration:

- (void)deleteBookNote:(NSString*)noteid;

# Delete Book Note Tree

Objective-C declaration:

- (void)deleteBookNoteTree:(NSString*)noteid;

# Clone Notes

Objective-C declaration:

- (NSArray*)cloneNotes:(NSArray*)notes toTopic:(NSString*)topicid;

# Clone Notes to Flashcards

Objective-C declaration:

- (NSArray*)cloneNotesToFlashcards:(NSArray*)notes toTopic:(NSString*)topicid;

# Export Notebook

Objective-C declaration:

- (BOOL)exportNotebook:(NSString*)topicid storePath:(NSString*)storePath;

# Import Notebook From Store Path

Objective-C declaration:

- (id)importNotebookFromStorePath:(NSString*)storePath merge:(BOOL)merge;

# MbTopic

# Title

Objective-C declaration:

@property (nonatomic,readwrite,setter=setTopicTitle:) NSString * title;

# Topic ID

Objective-C declaration:

@property (nonatomic,readonly,getter=topicid) NSString * topicId;

# Last Visit

Objective-C declaration:

@property (nonatomic,readonly,getter=lastvisit) NSDate * lastVisit;

# Main Document MD5

Objective-C declaration:

@property (nonatomic,readonly,getter=localbookmd5) NSString * mainDocMd5;

# History Date

Objective-C declaration:

@property (nonatomic,readonly,getter=historydate) NSDate * historyDate;

# Sync Mode

Objective-C declaration:

@property (nonatomic,readonly,getter=syncmode) NSNumber * syncMode;

# Category List

Objective-C declaration:

@property (nonatomic,readonly,getter=taglist) NSString * categoryList;

# Hash Tags

Objective-C declaration:

@property (nonatomic,readonly) NSString * hashtags;

# Document List

Objective-C declaration:

@property (nonatomic,readonly,getter=booklist) NSString * docList;

# Options

Objective-C declaration:

@property (nonatomic,readonly) NSDictionary * options;

# Documents

Objective-C declaration:

@property (nonatomic,readonly,getter=books) NSArray * documents;

# Notes

Objective-C declaration:

@property (nonatomic,readonly) NSArray * notes;

Objective-C declaration:

@property (nonatomic,readwrite) BOOL hideLinksInMindMapNode;

# Utility

Objective-C declaration:

@property (nonatomic,retain)    UITableView* menuTableView;

# Command Table

Objective-C declaration:

@property (nonatomic,retain)    NSArray* commandTable;

# Sections

Objective-C declaration:

@property (nonatomic,retain)    NSArray* sections;

# Row Height

Objective-C declaration:

@property (nonatomic,assign)    int rowHeight;

# Sec Height

Objective-C declaration:

@property (nonatomic,assign)    int secHeight;

# Font Size

Objective-C declaration:

@property (nonatomic,assign)    int fontSize;

# Speech Manager

# Start Speech Notes

Objective-C declaration:

- (void)startSpeechNotes:(NSArray*)notes;

# Stop Speech

Objective-C declaration:

- (void)stopSpeech;

# Pause Speech

Objective-C declaration:

- (void)pauseSpeech;

# Continue Speech

Objective-C declaration:

- (void)continueSpeech;

# Previous Speech

Objective-C declaration:

- (void)prevSpeech;

# Next Speech

Objective-C declaration:

- (void)nextSpeech;

# Can go to Previous

Objective-C declaration:

- (BOOL)canPrev;

# Can go to Next

Objective-C declaration:

- (BOOL)canNext;

# Text

Objective-C declaration:

- (void)playText:(NSString*)text;

# Language Txt

Objective-C declaration:

- (void)playText:(NSString *)text languageTxt:(NSString*)languageTxt;

# Speaking

Objective-C declaration:

@property (nonatomic,readonly) BOOL speaking;

# Paused

Objective-C declaration:

@property (nonatomic,readonly) BOOL paused;

# Scene Window

Objective-C declaration:

@property (nonatomic,weak) UIWindow * sceneWindow;

# Language Code

Objective-C declaration:

@property (nonatomic,strong) NSString * languageCode;

# Undo Control

# Undo Grouping

Objective-C declaration:

JSExportAs(undoGrouping,
- (void)undoGrouping:(NSString*)actionName inNotebook:(NSString*)topicid block:(JSValue*)block);

# Undo

Objective-C declaration:

- (void)undo;

# Redo

Objective-C declaration:

- (void)redo;

# Can Undo

Objective-C declaration:

- (BOOL)canUndo;

# Can Redo

Objective-C declaration:

- (BOOL)canRedo;

# Clear All

Objective-C declaration:

- (void)clearAll;

# Zipped Files

# Unzip File at Path

Objective-C declaration:

+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination;

# Zip File at Path

Objective-C declaration:

+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password;

# Create Zip File at Path

Objective-C declaration:

+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)filenames;

# Init with Path

Objective-C declaration:

- (id)initWithPath:(NSString *)path;

# Open

Objective-C declaration:

- (BOOL)open;

# Write File

Objective-C declaration:

- (BOOL)writeFile:(NSString *)path;

# Write Data

Objective-C declaration:

- (BOOL)writeData:(NSData *)data filename:(NSString *)filename;

# Close File

Objective-C declaration:

- (BOOL)close;

# SQLite

We do not recommend users to directly manipulate the database in SQLite. Therefore, we won't spend time introducing it here. If you need to use certain APIs related to SQLite, you can check them out in the API document by yourself.