2019-07-26 11:46:59 +02:00
|
|
|
import { ConfigService } from 'app/core/ui-services/config.service';
|
2019-02-14 16:02:18 +01:00
|
|
|
import { IdentifiableProjectorElement, ProjectorElementOptions } from 'app/shared/models/core/projector';
|
2019-07-26 11:46:59 +02:00
|
|
|
import { Displayable } from 'app/site/base/displayable';
|
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-04-23 16:57:35 +02:00
|
|
|
return !!obj && obj.getSlide !== undefined && obj.getProjectorTitle !== 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
|
|
|
/**
|
|
|
|
* Interface for every model, that should be projectable.
|
|
|
|
*/
|
|
|
|
export interface Projectable extends Displayable {
|
2019-04-23 16:57:35 +02:00
|
|
|
getProjectorTitle: () => string;
|
|
|
|
|
2019-02-28 09:51:54 +01:00
|
|
|
getSlide(configSerice?: ConfigService): ProjectorElementBuildDeskriptor;
|
2019-01-10 15:06:10 +01:00
|
|
|
}
|