2023-06-30 10:55:56 +02:00
|
|
|
/* eslint-disable multiline-comment-style */
|
|
|
|
|
2020-10-09 19:35:46 +02:00
|
|
|
import Plugin from '../Plugin';
|
|
|
|
import JoplinViewsDialogs from './JoplinViewsDialogs';
|
|
|
|
import JoplinViewsMenuItems from './JoplinViewsMenuItems';
|
2020-10-13 13:57:03 +02:00
|
|
|
import JoplinViewsMenus from './JoplinViewsMenus';
|
2020-10-09 19:35:46 +02:00
|
|
|
import JoplinViewsToolbarButtons from './JoplinViewsToolbarButtons';
|
|
|
|
import JoplinViewsPanels from './JoplinViewsPanels';
|
2023-09-18 18:40:36 +02:00
|
|
|
import JoplinViewsNoteList from './JoplinViewsNoteList';
|
2020-10-09 19:35:46 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This namespace provides access to view-related services.
|
|
|
|
*
|
|
|
|
* All view services provide a `create()` method which you would use to create the view object, whether it's a dialog, a toolbar button or a menu item.
|
|
|
|
* In some cases, the `create()` method will return a [[ViewHandle]], which you would use to act on the view, for example to set certain properties or call some methods.
|
|
|
|
*/
|
|
|
|
export default class JoplinViews {
|
|
|
|
|
2024-04-05 13:16:49 +02:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
2020-10-09 19:35:46 +02:00
|
|
|
private store: any;
|
|
|
|
private plugin: Plugin;
|
|
|
|
|
2020-11-12 21:13:28 +02:00
|
|
|
private panels_: JoplinViewsPanels = null;
|
|
|
|
private menuItems_: JoplinViewsMenuItems = null;
|
|
|
|
private menus_: JoplinViewsMenus = null;
|
|
|
|
private toolbarButtons_: JoplinViewsToolbarButtons = null;
|
2023-09-18 18:40:36 +02:00
|
|
|
private dialogs_: JoplinViewsDialogs = null;
|
|
|
|
private noteList_: JoplinViewsNoteList = null;
|
2024-04-05 13:16:49 +02:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
2020-11-12 21:13:28 +02:00
|
|
|
private implementation_: any = null;
|
|
|
|
|
2024-04-05 13:16:49 +02:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
2023-03-06 16:22:01 +02:00
|
|
|
public constructor(implementation: any, plugin: Plugin, store: any) {
|
2020-10-09 19:35:46 +02:00
|
|
|
this.store = store;
|
|
|
|
this.plugin = plugin;
|
|
|
|
this.implementation_ = implementation;
|
|
|
|
}
|
|
|
|
|
2023-09-18 18:40:36 +02:00
|
|
|
public get dialogs() {
|
2020-10-09 19:35:46 +02:00
|
|
|
if (!this.dialogs_) this.dialogs_ = new JoplinViewsDialogs(this.implementation_.dialogs, this.plugin, this.store);
|
|
|
|
return this.dialogs_;
|
|
|
|
}
|
|
|
|
|
2023-09-18 18:40:36 +02:00
|
|
|
public get panels() {
|
2020-10-09 19:35:46 +02:00
|
|
|
if (!this.panels_) this.panels_ = new JoplinViewsPanels(this.plugin, this.store);
|
|
|
|
return this.panels_;
|
|
|
|
}
|
|
|
|
|
2023-09-18 18:40:36 +02:00
|
|
|
public get menuItems() {
|
2020-10-09 19:35:46 +02:00
|
|
|
if (!this.menuItems_) this.menuItems_ = new JoplinViewsMenuItems(this.plugin, this.store);
|
|
|
|
return this.menuItems_;
|
|
|
|
}
|
|
|
|
|
2023-09-18 18:40:36 +02:00
|
|
|
public get menus() {
|
2020-10-13 13:57:03 +02:00
|
|
|
if (!this.menus_) this.menus_ = new JoplinViewsMenus(this.plugin, this.store);
|
|
|
|
return this.menus_;
|
|
|
|
}
|
|
|
|
|
2023-09-18 18:40:36 +02:00
|
|
|
public get toolbarButtons() {
|
2020-10-09 19:35:46 +02:00
|
|
|
if (!this.toolbarButtons_) this.toolbarButtons_ = new JoplinViewsToolbarButtons(this.plugin, this.store);
|
|
|
|
return this.toolbarButtons_;
|
|
|
|
}
|
|
|
|
|
2023-09-18 18:40:36 +02:00
|
|
|
public get noteList() {
|
|
|
|
if (!this.noteList_) this.noteList_ = new JoplinViewsNoteList(this.plugin, this.store);
|
|
|
|
return this.noteList_;
|
|
|
|
}
|
|
|
|
|
2020-10-09 19:35:46 +02:00
|
|
|
}
|