Lines Matching defs:View

83 // View class
85 // A View is a rectangle within the views View hierarchy. It is the base
88 // A View is a container of other Views (there is no such thing as a Leaf
89 // View - makes code simpler, reduces type conversion headaches, design
92 // The View contains basic properties for sizing (bounds), layout (flex,
95 // The View also uses a simple Box Layout Manager similar to XUL's
106 class VIEWS_EXPORT View : public ui::LayerDelegate,
111 typedef std::vector<View*> Views;
121 View* parent,
122 View* child,
123 View* move_view)
131 View* parent;
133 View* child;
138 // For the remove part of move, |move_view| is the new parent of the View
140 // For the add part of move, |move_view| is the old parent of the View being
142 View* move_view;
147 View();
148 virtual ~View();
150 // By default a View is owned by its parent unless specified otherwise here.
155 // Get the Widget that hosts this View, if any.
160 void AddChildView(View* view);
161 void AddChildViewAt(View* view, int index);
165 void ReorderChildView(View* view, int index);
168 void RemoveChildView(View* view);
178 const View* child_at(int index) const {
183 View* child_at(int index) {
184 return const_cast<View*>(const_cast<const View*>(this)->child_at(index));
188 const View* parent() const { return parent_; }
189 View* parent() { return parent_; }
191 // Returns true if |view| is contained within this View's hierarchy, even as
193 bool Contains(const View* view) const;
196 int GetIndexOf(const View* view) const;
241 // When traversing the View hierarchy in order to compute the bounds, the
243 // each View and therefore it will return the mirrored and transformed version
247 // Return the bounds of the View in screen coordinate system.
254 // Get the size the View would like to be, if enough space were available.
260 // Gets the minimum size of the view. View's implementation invokes
269 // View's implementation returns the value from getPreferredSize.cy.
270 // Override if your View's preferred height depends upon the width (such
297 // already exist for the View, but is a no-op in that case.
316 // View creates the Layer only when it exists in a Widget with a non-NULL
327 // transparent to the View subclasses and therefore you should use the
333 // Given a rectangle specified in this View's coordinate system, the function
334 // computes the 'left' value for the mirrored rectangle within this View. If
335 // the View's UI layout is not right-to-left, then bounds.x() is returned.
337 // UI mirroring is transparent to most View subclasses and therefore there is
342 // Given the X coordinate of a point inside the View, this function returns
343 // the mirrored X coordinate of the point if the View's UI layout is
348 // a View with the bounds {0, 0, 100, 100} and a right-to-left layout:
355 // Given a X coordinate and a width inside the View, this function returns
356 // the mirrored X coordinate if the View's UI layout is right-to-left. If the
360 // a View with the bounds {0, 0, 100, 100} and a right-to-left layout:
380 // The LayoutManager is owned by the View and is deleted when the view is
402 const View* GetAncestorWithClassName(const std::string& name) const;
403 View* GetAncestorWithClassName(const std::string& name);
408 virtual const View* GetViewByID(int id) const;
409 virtual View* GetViewByID(int id);
434 // Returns the View that is currently selected in |group|.
435 // The default implementation simply returns the first View found for that
437 virtual View* GetSelectedViewForGroup(int group);
442 // the mirrored position of the child Views if the parent View uses a
445 // Convert a point from the coordinate system of one View to another.
450 static void ConvertPointToTarget(const View* source,
451 const View* target,
460 static void ConvertRectToTarget(const View* source,
461 const View* target,
464 // Convert a point from a View's coordinate system to that of its Widget.
465 static void ConvertPointToWidget(const View* src, gfx::Point* point);
467 // Convert a point from the coordinate system of a View's Widget to that
468 // View's coordinate system.
469 static void ConvertPointFromWidget(const View* dest, gfx::Point* p);
471 // Convert a point from a View's coordinate system to that of the screen.
472 static void ConvertPointToScreen(const View* src, gfx::Point* point);
474 // Convert a point from a View's coordinate system to that of the screen.
475 static void ConvertPointFromScreen(const View* dst, gfx::Point* point);
487 // Mark all or part of the View's bounds as dirty (needing repaint).
488 // |r| is in the View's coordinates.
496 // Called by the framework to paint a View. Performs translation and clipping
497 // for View coordinates and language direction as required, allows the View
515 // Returns the NativeTheme to use for this View. This calls through to
516 // GetNativeTheme() on the Widget this View is in. If this View is not in a
520 const_cast<const View*>(this)->GetNativeTheme());
527 // View::Paint() needs to be transformed such that anything drawn on the
528 // canvas object during View::Paint() is flipped horizontally.
531 // |flip_canvas_on_paint_for_rtl_ui_|). View subclasses that need to paint on
538 // Enables or disables flipping of the gfx::Canvas during View::Paint().
559 View* GetEventHandlerForPoint(const gfx::Point& point);
561 // Returns the View that should be the target of an event having |rect| as
564 View* GetEventHandlerForRect(const gfx::Rect& rect);
569 virtual View* GetTooltipHandlerForPoint(const gfx::Point& point);
671 virtual void SetMouseHandler(View* new_mouse_handler);
695 // Returns the View's TextInputClient instance or NULL if the View doesn't
760 View* GetNextFocusableView();
761 const View* GetNextFocusableView() const;
764 View* GetPreviousFocusableView();
771 void SetNextFocusableView(View* view);
831 // Gets the tooltip for this View. If the View does not have a tooltip,
832 // return false. If the View does have a tooltip, copy the tooltip into
834 // Any time the tooltip text that a View is displaying changes, it must
840 // Returns the location (relative to this View) for the text on the tooltip
847 // Sets the ContextMenuController. Setting this to non-null makes the View
861 // as it is always equal to the current View.
956 // TODO(beng): Figure out if this can live somewhere other than View, i.e.
959 // Scrolls the specified region, in this View's coordinate system, to be
960 // visible. View's implementation passes the call onto the parent View (after
1016 virtual void ChildPreferredSizeChanged(View* child) {}
1020 virtual void ChildVisibilityChanged(View* child) {}
1023 // if there is one. Be sure to call View::PreferredSizeChanged when
1032 // Notification that this View's visible bounds relative to the root view may
1033 // have changed. The visible bounds are the region of the View not clipped by
1037 // Override to be notified when the enabled state of this View has
1038 // changed. The default implementation calls SchedulePaint() on this View.
1062 virtual void VisibilityChanged(View* starting_from, bool is_visible);
1078 // Override to provide rendering in any part of the View's bounds. Typically
1091 // Returns true if this View is the root for paint events, and should
1115 // Called to update the bounds of any child layers within this View's
1149 // Override to be notified when focus has changed either to or from this View.
1206 // Invoked when the NativeTheme associated with this View changes.
1222 std::string DoPrintViewGraph(bool first, View* view_with_children);
1249 // invoke OnPaint() on the View.
1259 // AddChildView() to a new parent. For this case, |new_parent| is the View
1261 void DoRemoveChildView(View* view,
1265 View* new_parent);
1268 // |old_parent| is the original parent of the View that was removed.
1269 // If |new_parent| is not NULL, the View that was removed will be reparented
1271 void PropagateRemoveNotifications(View* old_parent, View* new_parent);
1291 void PropagateVisibilityNotifications(View* from, bool is_visible);
1295 void VisibilityChangedImpl(View* starting_from, bool is_visible);
1306 static void RegisterChildrenForVisibleBoundsNotification(View* view);
1307 static void UnregisterChildrenForVisibleBoundsNotification(View* view);
1313 void AddDescendantToNotify(View* view);
1314 void RemoveDescendantToNotify(View* view);
1334 // Traverse up the View hierarchy to the first ancestor that is a paint root
1343 bool GetTransformRelativeTo(const View* ancestor,
1351 bool ConvertPointForAncestor(const View* ancestor, gfx::Point* point) const;
1357 bool ConvertPointFromAncestor(const View* ancestor, gfx::Point* point) const;
1362 bool ConvertRectForAncestor(const View* ancestor, gfx::RectF* rect) const;
1368 bool ConvertRectFromAncestor(const View* ancestor, gfx::RectF* rect) const;
1385 // View itself, and all its parent Views are visible. This also updates
1419 void InitFocusSiblings(View* view, int index);
1438 // This must be invoked any time the View hierarchy changes in such a way
1439 // the view under the mouse differs. For example, if the bounds of a View is
1459 // False if this View is owned by its parent - i.e. it will be deleted by its
1465 // The id of this View. Used to find this View.
1476 View* parent_;
1483 // This View's bounds in the parent coordinate system.
1492 // When this flag is on, a View receives a mouse-enter and mouse-leave event
1493 // even if a descendant View is the event-recipient for the real mouse
1518 // If this View IsPaintRoot() then this will be a pointer to a spatial data
1534 // The View's LayoutManager defines the sizing heuristics applied to child
1538 // Whether this View's layer should be snapped to the pixel boundary.
1551 // Indicates whether or not the gfx::Canvas object passed to View::Paint()
1553 // right-to-left locales for this View.
1574 View* next_focusable_view_;
1577 View* previous_focusable_view_;
1605 DISALLOW_COPY_AND_ASSIGN(View);