UNPKG

com.phloxui

Version:

PhloxUI Ng2+ Framework

276 lines (275 loc) 10.5 kB
import { OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { PhloxAppInfo, ComponentDialogModel } from './model/models'; import { PhloxAppInfoService } from '../service/PhloxAppInfoService.service'; import { PhloxAppService } from '../service/PhloxAppService.service'; import { ObservableManager } from '../service/ObservableManager.service'; import { NeedFocusService } from '../service/NeedFocusService.service'; import { DialogService } from '../service/DialogService.service'; import { BackgroundProcessManager } from '../service/BackgroundProcessManager.service'; import { INavigator } from './INavigator'; import { INeedFocus } from './INeedFocus'; import { AbstractPage } from './AbstractPage'; /** * <p style="text-indent: 2em;"> * A main bootstrap component class for <code>PhloxUI</code> application. This class implements the [[INavigator]] interface having pages ([[AbstractPage]]) * as <code>navigatee</code> items ([[INavigatee]]). An <code>application</code> may consist of various pages, for example, it may have a login page to allow the user to * login, once the user is logged on, it will navigate the user to the main page, etc. * </p> * * @author shiorin, tee4cute */ export declare class PhloxApp implements INavigator<AbstractPage>, OnInit { static readonly TYPE_NAME: string; /** * This field will be automatically injected by <code>ng</code>. */ private appInfoService; /** * This field will be automatically injected by <code>ng</code>. */ private observableMgr; /** * This field will be automatically injected by <code>ng</code>. */ private needFocusService; /** * A field keeping cache for the last successfully loaded [[PhloxAppInfo]] from method [[reloadAppInfo]]. */ private appInfo; /** * An array keeping all <code>page</code>s of this <code>application</code>. */ private pages; /** * This field will be automatically injected by <code>ng</code>. */ private router; /** * This field will be automatically injected by <code>ng</code>. */ private dialogService; /** * This field will be automatically injected by <code>ng</code>. */ private bgProcessMgr; /** * A [[PhloxDialog]] child component instance of this component. */ private phloxDialog; private barloader; private _showLoader; private curRouterLoading; constructor(router: Router, appInfoService: PhloxAppInfoService, appSvc: PhloxAppService, observableMgr: ObservableManager, needFocusService: NeedFocusService, dialogService: DialogService, bgProcessMgr: BackgroundProcessManager); ngOnInit(): void; isShowLoader(): boolean; /** * <p style="text-indent: 1em;"> * Get app info of currently opened <code>application</code>. * </p> */ getAppInfo(): PhloxAppInfo; /** * <p style="text-indent: 1em;"> * Reload the app info from <code>PhloxAppInfoService</code>. * </p> */ reloadAppInfo(): Promise<PhloxAppInfo>; getRouter(): Router; /** * <p style="text-indent: 1em;"> * Get all available <code>pages</code> ([[AbstractPage]]) in this <code>application</code>. * </p> * * @see [[INavigator.getItems]] */ getItems(): AbstractPage[]; /** * <p style="text-indent: 1em;"> * Get all available <code>page</code> count ([[AbstractPage]]) in this <code>application</code>. * </p> * * @see [[INavigator.getItemCount]] */ getItemCount(): number; /** * <p style="text-indent: 1em;"> * Get current active <code>page</code> ([[AbstractPage]]) index in the array returned from [[getItems]] method. * </p> * * @see [[INavigator.getActiveIndex]] * @returns Returns <code>-1</code> if there is no current active <code>page</code>. */ getActiveIndex(): number; /** * <p style="text-indent: 1em;"> * Get current active <code>page</code> ([[AbstractPage]]) object instance. * </p> * * @see [[INavigator.getActiveItem]] * @returns Returns <code>null</code> if there is no current active <code>page</code>. */ getActiveItem(): AbstractPage; /** * <p style="text-indent: 1em;"> * An implementation of [[INavigator.setItems]] method. Please see the documentation of super class or super interface for more details. * </p> * * @see [[INavigator.setItems]] */ setItems(items: AbstractPage[]): void; /** * <p style="text-indent: 1em;"> * Add a new <code>page</code> ([[AbstractPage]]) into this <code>application</code>. If the <code>page</code> (<code><b>item</b></code>) being added is the * first <code>page</code> of this <code>application</code>, this method will automatically show the given <code>page</code> and set its <code>active</code> * flag to <code>true</code>. * </p> * * @see [[INavigator.addItem]] */ addItem(item: AbstractPage): boolean; /** * <p style="text-indent: 1em;"> * Remove the given <code>page</code> ([[AbstractPage]]) from this <code>application</code>. If the <code>page</code> (<code><b>item</b></code>) being removed is * currently active, this method will automatically unset its <code>active</code> flag and show the first <code>page</code> (if available) in the array returned from * [[getItems]] method instead. * </p> * * @see [[INavigator.removeItem]] */ removeItem(item: AbstractPage): boolean; /** * <p style="text-indent: 1em;"> * An implementation of [[INavigator.containsItem]] method. Please see the documentation of super class or super interface for more details. * </p> * * @see [[INavigator.containsItem]] */ containsItem(item: AbstractPage): boolean; /** * <p style="text-indent: 1em;"> * An implementation of [[INavigator.getItemByIndex]] method. Please see the documentation of super class or super interface for more details. * </p> * * @see [[INavigator.getItemByIndex]] */ getItemByIndex(idx: number): AbstractPage; /** * <p style="text-indent: 1em;"> * An implementation of [[INavigator.getItemByName]] method. Please see the documentation of super class or super interface for more details. * </p> * * @see [[INavigator.getItemByName]] */ getItemByName(name: string): AbstractPage; /** * <p style="text-indent: 1em;"> * An implementation of [[INavigator.getItemIndex]] method. Please see the documentation of super class or super interface for more details. * </p> * * @see [[INavigator.getItemIndex]] */ getItemIndex(item: AbstractPage): number; /** * <p style="text-indent: 1em;"> * An implementation of [[INavigator.getItemIndexByName]] method. Please see the documentation of super class or super interface for more details. * </p> * * @see [[INavigator.getItemIndexByName]] */ getItemIndexByName(name: string): number; /** * <p style="text-indent: 1em;"> * An alias method of [[navigateToName]] passing <code>page</code>'s name ([[AbstractPage.getName]]) as a parameter. * </p> * * @see [[INavigator.navigateTo]] * @see [[navigateToName]] */ navigateTo(item: AbstractPage, options?: any): Promise<boolean>; /** * <p style="text-indent: 1em;"> * An alias method of [[navigateTo]] passing <code>page</code> instance at the given index (<code><b>idx</b></code>) as a parameter. * </p> * * @see [[INavigator.navigateToIndex]] * @see [[navigateTo]] */ navigateToIndex(idx: number, options?: any): Promise<boolean>; /** * <p style="text-indent: 1em;"> * Navigate this <code>application</code> to the given <code>page</code> <code><b>name</b></code>. The <code>page</code> name is also a * <code>router</code>'s uri path specified in [[PHLOX_ROUTES]]. * </p> * * @see [[INavigator.navigateToName]] * @see [[PHLOX_ROUTES]] */ navigateToName(name: string, options?: any): Promise<boolean>; /** * <p style="text-indent: 1em;"> * Try to navigate this <code>application</code> back to the first <code>page</code>. * </p> * * @see [[INavigator.reset]] */ reset(): void; /** * <p style="text-indent: 1em;"> * A delegator method passing method call to <code>[[needFocusService]].setFocusingComponent()</code>. * </p> * * @see [[NeedFocusService.setFocusingComponent]] */ setFocusingComponent(component: INeedFocus, event?: any): void; /** * <p style="text-indent: 1em;"> * A delegator method passing method call to <code>[[needFocusService]].getFocusingComponent()</code>. * </p> * * @see [[NeedFocusService.getFocusingComponent]] */ getFocusingComponent(): INeedFocus; /** * <p style="text-indent: 1em;"> * A delegator method passing method call to <code>[[needFocusService]].resetFocusingComponent()</code>. * </p> * * @see [[NeedFocusService.resetFocusingComponent]] */ resetFocusingComponent(event?: any): void; /** * <p style="text-indent: 1em;"> * A delegator method passing method call to <code>[[phloxDialog]].hideDialog()</code>. * </p> * * @see [[PhloxDialog.hideDialog]] */ hideDialog(): void; /** * <p style="text-indent: 1em;"> * A delegator method passing method call to <code>[[phloxDialog]].showConfirmDialog()</code>. * </p> * * @see [[PhloxDialog.showConfirmDialog]] */ showConfirmDialog(title: string, message: string, showCancelBtn: boolean, width?: string, height?: string): Promise<any>; /** * <p style="text-indent: 1em;"> * A delegator method passing method call to <code>[[phloxDialog]].showMessageDialog()</code>. * </p> * * @see [[PhloxDialog.showMessageDialog]] */ showMessageDialog(title: string, message: string, width?: string, height?: string): Promise<any>; /** * <p style="text-indent: 1em;"> * A delegator method passing method call to <code>[[phloxDialog]].showComponentDialog()</code>. * </p> * * @see [[PhloxDialog.showComponentDialog]] */ showComponentDialog(componentDialogModel: ComponentDialogModel): Promise<any>; runPageLoader(): void; stopPageLoader(): void; }