180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru/* 380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Copyright 2006 The Android Open Source Project 480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * 580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Use of this source code is governed by a BSD-style license that can be 680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * found in the LICENSE file. 780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */ 880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 1080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#ifndef SkStackViewLayout_DEFINED 1180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#define SkStackViewLayout_DEFINED 1280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 1380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "SkView.h" 1480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 1580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruclass SkStackViewLayout : public SkView::Layout { 1680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Querupublic: 1780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru SkStackViewLayout(); 1880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 1980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru enum Orient { 2080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kHorizontal_Orient, 2180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kVertical_Orient, 2280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 2380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kOrientCount 2480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru }; 2580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru Orient getOrient() const { return (Orient)fOrient; } 2680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void setOrient(Orient); 2780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 2880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void getMargin(SkRect*) const; 2980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void setMargin(const SkRect&); 3080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 3180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru SkScalar getSpacer() const { return fSpacer; } 3280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void setSpacer(SkScalar); 3380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 3480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru /** Controls the posititioning in the same direction as the orientation 3580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */ 3680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru enum Pack { 3780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kStart_Pack, 3880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kCenter_Pack, 3980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kEnd_Pack, 4080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 4180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kPackCount 4280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru }; 4380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru Pack getPack() const { return (Pack)fPack; } 4480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void setPack(Pack); 4580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 4680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru /** Controls the posititioning at right angles to the orientation 4780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */ 4880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru enum Align { 4980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kStart_Align, 5080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kCenter_Align, 5180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kEnd_Align, 5280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kStretch_Align, 5380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 5480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kAlignCount 5580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru }; 5680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru Align getAlign() const { return (Align)fAlign; } 5780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void setAlign(Align); 5880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 5980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru bool getRound() const { return SkToBool(fRound); } 6080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void setRound(bool); 6180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 6280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruprotected: 6380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru virtual void onLayoutChildren(SkView* parent); 6480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru virtual void onInflate(const SkDOM&, const SkDOM::Node*); 6580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 6680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruprivate: 6780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru SkRect fMargin; 6880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru SkScalar fSpacer; 6980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru uint8_t fOrient, fPack, fAlign, fRound; 7080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru}; 7180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 7280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruclass SkFillViewLayout : public SkView::Layout { 7380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Querupublic: 7480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru SkFillViewLayout(); 7580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void getMargin(SkRect*) const; 7680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void setMargin(const SkRect&); 7780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 7880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruprotected: 7980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru // overrides; 8080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru virtual void onLayoutChildren(SkView* parent); 8180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru virtual void onInflate(const SkDOM& dom, const SkDOM::Node* node); 8280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 8380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruprivate: 8480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru SkRect fMargin; 8580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru typedef SkView::Layout INHERITED; 8680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru}; 8780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 8880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#endif 89