2019-02-01 13:56:08 +01:00
|
|
|
import { Displayable } from 'app/site/base/displayable';
|
2019-02-14 16:02:18 +01:00
|
|
|
import { IdentifiableProjectorElement, ProjectorElementOptions } from 'app/shared/models/core/projector';
|
2019-01-24 16:25:50 +01:00
|
|
|
import { SlideOptions } from './slide-options';
|
2019-01-10 15:06:10 +01:00
|
|
|
|
2019-01-24 16:25:50 +01:00
|
|
|
export function isProjectorElementBuildDeskriptor(obj: any): obj is ProjectorElementBuildDeskriptor {
|
|
|
|
const deskriptor = <ProjectorElementBuildDeskriptor>obj;
|
|
|
|
return (
|
2019-02-13 10:12:55 +01:00
|
|
|
!!deskriptor &&
|
2019-01-24 16:25:50 +01:00
|
|
|
deskriptor.slideOptions !== undefined &&
|
|
|
|
deskriptor.getBasicProjectorElement !== undefined &&
|
2019-02-15 12:17:08 +01:00
|
|
|
deskriptor.getDialogTitle !== undefined
|
2019-01-24 16:25:50 +01:00
|
|
|
);
|
|
|
|
}
|
2019-01-10 15:06:10 +01:00
|
|
|
|
2019-01-24 16:25:50 +01:00
|
|
|
export interface ProjectorElementBuildDeskriptor {
|
|
|
|
slideOptions: SlideOptions;
|
|
|
|
projectionDefaultName?: string;
|
2019-02-14 16:02:18 +01:00
|
|
|
getBasicProjectorElement(options: ProjectorElementOptions): IdentifiableProjectorElement;
|
2019-01-10 15:06:10 +01:00
|
|
|
|
|
|
|
/**
|
2019-01-24 16:25:50 +01:00
|
|
|
* The title to show in the projection dialog
|
2019-01-10 15:06:10 +01:00
|
|
|
*/
|
2019-02-15 12:17:08 +01:00
|
|
|
getDialogTitle(): string;
|
2019-01-24 16:25:50 +01:00
|
|
|
}
|
2019-01-10 15:06:10 +01:00
|
|
|
|
2019-01-24 16:25:50 +01:00
|
|
|
export function isProjectable(obj: any): obj is Projectable {
|
2019-02-13 10:12:55 +01:00
|
|
|
if (obj) {
|
|
|
|
return (<Projectable>obj).getSlide !== undefined;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
2019-01-24 16:25:50 +01:00
|
|
|
}
|
2019-01-10 15:06:10 +01:00
|
|
|
|
2019-01-24 16:25:50 +01:00
|
|
|
/**
|
|
|
|
* Interface for every model, that should be projectable.
|
|
|
|
*/
|
|
|
|
export interface Projectable extends Displayable {
|
|
|
|
getSlide(): ProjectorElementBuildDeskriptor;
|
2019-01-10 15:06:10 +01:00
|
|
|
}
|