1// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef UI_BASE_WIN_SHELL_H_
6#define UI_BASE_WIN_SHELL_H_
7
8#include <windows.h>
9
10#include "base/strings/string16.h"
11#include "ui/base/ui_base_export.h"
12
13namespace base {
14class FilePath;
15}
16
17namespace ui {
18namespace win {
19
20// Open or run a file via the Windows shell. In the event that there is no
21// default application registered for the file specified by 'full_path',
22// ask the user, via the Windows "Open With" dialog.
23// Returns 'true' on successful open, 'false' otherwise.
24UI_BASE_EXPORT bool OpenItemViaShell(const base::FilePath& full_path);
25
26// Lower level function that allows opening of non-files like urls or GUIDs
27// don't use it if one of the above will do. |mask| is a valid combination
28// of SEE_MASK_FLAG_XXX as stated in msdn. If there is no default application
29// registered for the item, it behaves the same as OpenItemViaShell.
30UI_BASE_EXPORT bool OpenAnyViaShell(const base::string16& full_path,
31                                    const base::string16& directory,
32                                    const base::string16& args,
33                                    DWORD mask);
34
35// Disables the ability of the specified window to be pinned to the taskbar or
36// the Start menu. This will remove "Pin this program to taskbar" from the
37// taskbar menu of the specified window.
38UI_BASE_EXPORT bool PreventWindowFromPinning(HWND hwnd);
39
40// Sets the application id, app icon, relaunch command and relaunch display name
41// for the given window.
42UI_BASE_EXPORT void SetAppDetailsForWindow(
43    const base::string16& app_id,
44    const base::string16& app_icon,
45    const base::string16& relaunch_command,
46    const base::string16& relaunch_display_name,
47    HWND hwnd);
48
49// Sets the application id given as the Application Model ID for the window
50// specified.  This method is used to insure that different web applications
51// do not group together on the Win7 task bar.
52UI_BASE_EXPORT void SetAppIdForWindow(const base::string16& app_id, HWND hwnd);
53
54// Sets the application icon for the window specified.
55UI_BASE_EXPORT void SetAppIconForWindow(const base::string16& app_icon,
56                                        HWND hwnd);
57
58// Sets the relaunch command and relaunch display name for the window specified.
59// Windows will use this information for grouping on the taskbar, and to create
60// a shortcut if the window is pinned to the taskbar.
61UI_BASE_EXPORT void SetRelaunchDetailsForWindow(
62    const base::string16& relaunch_command,
63    const base::string16& display_name,
64    HWND hwnd);
65
66// Returns true if composition is available and turned on on the current
67// platform.
68UI_BASE_EXPORT bool IsAeroGlassEnabled();
69
70}  // namespace win
71}  // namespace ui
72
73#endif  // UI_BASE_WIN_SHELL_H_
74