summaryrefslogtreecommitdiffstats
path: root/views/controls/table/table_view.h
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls/table/table_view.h')
-rw-r--r--views/controls/table/table_view.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/views/controls/table/table_view.h b/views/controls/table/table_view.h
index 282d590..0ed3396 100644
--- a/views/controls/table/table_view.h
+++ b/views/controls/table/table_view.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -23,6 +23,10 @@ typedef struct tagNMLVCUSTOMDRAW NMLVCUSTOMDRAW;
#include "views/controls/native_control.h"
#endif // defined(OS_WIN)
+namespace gfx {
+class Font;
+}
+
struct TableColumn;
class TableModel;
class SkBitmap;
@@ -232,6 +236,10 @@ class TableView : public NativeControl,
return view_to_model_.get() ? view_to_model_[view_index] : view_index;
}
+ // Sets the text to display on top of the table. This is useful if the table
+ // is empty and you want to inform the user why.
+ void SetAltText(const std::wstring& alt_text);
+
protected:
// Overriden to return the position of the first selected row.
virtual gfx::Point GetKeyboardContextMenuLocation();
@@ -293,6 +301,9 @@ class TableView : public NativeControl,
// content.
int content_offset() const { return content_offset_; }
+ // Draws the alt_text_. Does nothing if there is no alt_text_.
+ void PaintAltText();
+
// Size (width and height) of images.
static const int kImageSize;
@@ -398,6 +409,12 @@ class TableView : public NativeControl,
// Updates content_offset_ from the position of the header.
void UpdateContentOffset();
+ // Returns the bounds of the alt text.
+ gfx::Rect GetAltTextBounds();
+
+ // Returns the font used for alt text.
+ gfx::Font GetAltTextFont();
+
TableModel* model_;
TableTypes table_type_;
TableViewObserver* table_view_observer_;
@@ -463,6 +480,8 @@ class TableView : public NativeControl,
scoped_array<int> view_to_model_;
scoped_array<int> model_to_view_;
+ std::wstring alt_text_;
+
DISALLOW_COPY_AND_ASSIGN(TableView);
};
#endif // defined(OS_WIN)