/*
 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
 */
package com.sun.glass.ui.win;

import com.sun.glass.ui.Application;
import com.sun.glass.ui.CommonDialogs.ExtensionFilter;
import com.sun.glass.ui.Window;

/**
 * MS Windows platform implementation class for CommonDialogs.
 *
 * @author Dmitry Cherepanov
 */
final class WinCommonDialogs {
    native private static void _initIDs();
    static {
        Application.loadNativeLibrary();
        _initIDs();
    }

    private static native String[] _showFileChooser(long owner, String folder, String title, int type,
						    boolean multipleMode, ExtensionFilter[] extensionFilters);

    private static native String _showFolderChooser(long owner, String folder, String title);

    static String[] showFileChooser_impl(Window owner, String folder, String title, int type,
                                         boolean multipleMode, ExtensionFilter[] extensionFilters) {
        return _showFileChooser(owner != null ? owner.getNativeWindow() : 0L,
                folder, title, type, multipleMode, extensionFilters);
    }

    static String showFolderChooser_impl(Window owner, String folder, String title) {
        return _showFolderChooser(owner != null ? owner.getNativeWindow() : 0L,
                folder, title);
    }
}
