OLD | NEW |
| (Empty) |
1 // Copyright 2006-2009 Google Inc. | |
2 // | |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 // you may not use this file except in compliance with the License. | |
5 // You may obtain a copy of the License at | |
6 // | |
7 // http://www.apache.org/licenses/LICENSE-2.0 | |
8 // | |
9 // Unless required by applicable law or agreed to in writing, software | |
10 // distributed under the License is distributed on an "AS IS" BASIS, | |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 // See the License for the specific language governing permissions and | |
13 // limitations under the License. | |
14 // ======================================================================== | |
15 | |
16 // | |
17 // static_line.h | |
18 | |
19 #ifndef OMAHA_UI_UILIB_STATIC_LINE_H_ | |
20 #define OMAHA_UI_UILIB_STATIC_LINE_H_ | |
21 | |
22 #include <atlstr.h> | |
23 #include <atltypes.h> | |
24 #include <vector> | |
25 #include "base/basictypes.h" | |
26 | |
27 class Node; | |
28 | |
29 class StaticLine { | |
30 public: | |
31 StaticLine(); | |
32 virtual ~StaticLine(); | |
33 | |
34 int AdjustBaseLine(int base_line); | |
35 int AdjustHeight(int height); | |
36 | |
37 int base_line() const { return base_line_; } | |
38 int height() const { return height_; } | |
39 | |
40 void AddNode(Node* node, int start, int end, int height, int base_line, | |
41 int width); | |
42 void AddEllipses() { elipses_ = true; } | |
43 | |
44 bool IsUrlUnderMouse(CPoint point, CString* action); | |
45 | |
46 int Paint(HDC hdc, int left, int right, int y, DWORD window_style, | |
47 int ellipsis); | |
48 | |
49 protected: | |
50 int HitTest(CPoint point); | |
51 | |
52 int base_line_; | |
53 int height_; | |
54 | |
55 struct Nodes { | |
56 Node* node; | |
57 int start; // first char to output | |
58 int length; // number of chars | |
59 int height; | |
60 int base_line; | |
61 int width; | |
62 CRect rect; | |
63 | |
64 Nodes(Node* node, int start, int length, int height, int base_line, | |
65 int width) | |
66 : node(node), start(start), length(length), height(height), | |
67 base_line(base_line), width(width), rect(0, 0, 0, 0) {} | |
68 }; | |
69 | |
70 std::vector<Nodes> nodes_; | |
71 bool elipses_; | |
72 | |
73 DISALLOW_EVIL_CONSTRUCTORS(StaticLine); | |
74 }; | |
75 | |
76 #endif // OMAHA_UI_UILIB_STATIC_LINE_H_ | |
OLD | NEW |