- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / panels / panel_constants.h
1 // Copyright (c) 2012 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 CHROME_BROWSER_UI_PANELS_PANEL_CONSTANTS_H_
6 #define CHROME_BROWSER_UI_PANELS_PANEL_CONSTANTS_H_
7
8 namespace panel {
9
10 // The height in pixels of the titlebar.
11 static const int kTitlebarHeight = 36;
12
13 // Absolute minimum width and height for panels, including non-client area.
14 // Should only be big enough to accomodate a close button on the reasonably
15 // recognisable titlebar.
16 // These numbers are semi-arbitrary.
17 // Motivation for 'width' is to make main buttons on the titlebar functional.
18 // Motivation for height is to allow autosized tightly-wrapped panel with a
19 // single line of text - so the height is set to be likely less then a titlebar,
20 // to make sure even small content is tightly wrapped.
21 const int kPanelMinWidth = 80;
22 const int kPanelMinHeight = kTitlebarHeight + 10;
23
24 // The panel can be minimized to 4-pixel lines.
25 static const int kMinimizedPanelHeight = 4;
26
27 // The size (width or height) of the app icon (taskbar icon).
28 static const int kPanelAppIconSize = 32;
29
30 // The size (width or height) of the button, which is also the size of the
31 // hit target area.
32 static const int kPanelButtonSize = 24;
33
34 // The padding in pixeles between the icon and the left border.
35 const int kTitlebarLeftPadding = 10;
36
37 // The padding in pixeles between the close button and the right border.
38 const int kTitlebarRightPadding = 6;
39
40 // The padding in piexles between the icon and the title text.
41 const int kIconAndTitlePadding = 11;
42
43 // The padding in piexles between the title text and the button.
44 const int kTitleAndButtonPadding = 11;
45
46 // The padding in pixeles between buttons.
47 static const int kButtonPadding = 5;
48
49 // The number of times to flash the panel's taskbar icon in order to draw the
50 // user's attention (Windows only).
51 static const int kNumberOfTimesToFlashPanelForAttention = 30;
52
53 // Different types of buttons that can be shown on panel's titlebar.
54 enum TitlebarButtonType {
55   CLOSE_BUTTON,
56   MINIMIZE_BUTTON,
57   RESTORE_BUTTON
58 };
59
60 // Different platforms use different modifier keys to change the behavior
61 // of a mouse click. This enum captures the meaning of the modifier rather
62 // than the actual modifier key to generalize across platforms.
63 enum ClickModifier {
64   NO_MODIFIER,
65   APPLY_TO_ALL,  // Apply the click behavior to all panels in the collection.
66 };
67
68 // Edge at which a panel is being resized using the mouse.
69 enum ResizingSides {
70   RESIZE_NONE = 0,
71   RESIZE_TOP,
72   RESIZE_TOP_RIGHT,
73   RESIZE_RIGHT,
74   RESIZE_BOTTOM_RIGHT,
75   RESIZE_BOTTOM,
76   RESIZE_BOTTOM_LEFT,
77   RESIZE_LEFT,
78   RESIZE_TOP_LEFT
79 };
80
81 // Ways a panel can be resized.
82 enum Resizability {
83   NOT_RESIZABLE = 0,
84   RESIZABLE_TOP = 0x1,
85   RESIZABLE_BOTTOM = 0x2,
86   RESIZABLE_LEFT = 0x4,
87   RESIZABLE_RIGHT = 0x8,
88   RESIZABLE_TOP_LEFT = 0x10,
89   RESIZABLE_TOP_RIGHT = 0x20,
90   RESIZABLE_BOTTOM_LEFT = 0x40,
91   RESIZABLE_BOTTOM_RIGHT = 0x80,
92   RESIZABLE_EXCEPT_BOTTOM = RESIZABLE_TOP | RESIZABLE_LEFT | RESIZABLE_RIGHT |
93       RESIZABLE_TOP_LEFT | RESIZABLE_TOP_RIGHT,
94   RESIZABLE_ALL = RESIZABLE_TOP | RESIZABLE_BOTTOM | RESIZABLE_LEFT |
95       RESIZABLE_RIGHT | RESIZABLE_TOP_LEFT | RESIZABLE_TOP_RIGHT |
96       RESIZABLE_BOTTOM_LEFT | RESIZABLE_BOTTOM_RIGHT
97 };
98
99 // Describes how 4 corners of a panel should be painted.
100 enum CornerStyle {
101   NOT_ROUNDED = 0,
102   TOP_ROUNDED = 0x1,
103   BOTTOM_ROUNDED = 0x2,
104   ALL_ROUNDED = TOP_ROUNDED | BOTTOM_ROUNDED
105 };
106
107 }  // namespace panel
108
109 #endif  // CHROME_BROWSER_UI_PANELS_PANEL_CONSTANTS_H_