windowService.ts 2.1 KB
Newer Older
J
Joao Moreno 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

'use strict';

import { TPromise } from 'vs/base/common/winjs.base';
import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows';

export class WindowService implements IWindowService {

	_serviceBrand: any;

	constructor(
		private windowId: number,
		@IWindowsService private windowsService: IWindowsService
	) { }

J
Joao Moreno 已提交
20 21 22 23
	getCurrentWindowId(): number {
		return this.windowId;
	}

J
Joao Moreno 已提交
24 25 26 27
	openFileFolderPicker(forceNewWindow?: boolean): TPromise<void> {
		return this.windowsService.openFileFolderPicker(this.windowId, forceNewWindow);
	}

28 29
	openFilePicker(forceNewWindow?: boolean, path?: string): TPromise<void> {
		return this.windowsService.openFilePicker(this.windowId, forceNewWindow, path);
J
Joao Moreno 已提交
30 31 32 33 34
	}

	openFolderPicker(forceNewWindow?: boolean): TPromise<void> {
		return this.windowsService.openFolderPicker(this.windowId, forceNewWindow);
	}
35 36 37 38

	reloadWindow(): TPromise<void> {
		return this.windowsService.reloadWindow(this.windowId);
	}
J
Joao Moreno 已提交
39

J
Joao Moreno 已提交
40 41 42 43
	openDevTools(): TPromise<void> {
		return this.windowsService.openDevTools(this.windowId);
	}

J
Joao Moreno 已提交
44 45 46
	toggleDevTools(): TPromise<void> {
		return this.windowsService.toggleDevTools(this.windowId);
	}
J
Joao Moreno 已提交
47 48 49 50

	closeFolder(): TPromise<void> {
		return this.windowsService.closeFolder(this.windowId);
	}
J
Joao Moreno 已提交
51 52 53 54

	toggleFullScreen(): TPromise<void> {
		return this.windowsService.toggleFullScreen(this.windowId);
	}
55 56 57 58

	setRepresentedFilename(fileName: string): TPromise<void> {
		return this.windowsService.setRepresentedFilename(this.windowId, fileName);
	}
J
Joao Moreno 已提交
59 60 61 62

	getRecentlyOpen(): TPromise<{ files: string[]; folders: string[]; }> {
		return this.windowsService.getRecentlyOpen(this.windowId);
	}
J
Joao Moreno 已提交
63 64 65 66

	focusWindow(): TPromise<void> {
		return this.windowsService.focusWindow(this.windowId);
	}
J
Joao Moreno 已提交
67 68 69 70

	setDocumentEdited(flag: boolean): TPromise<void> {
		return this.windowsService.setDocumentEdited(this.windowId, flag);
	}
J
Joao Moreno 已提交
71
}