gfx/skia/trunk/include/views/SkStackViewLayout.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1
michael@0 2 /*
michael@0 3 * Copyright 2006 The Android Open Source Project
michael@0 4 *
michael@0 5 * Use of this source code is governed by a BSD-style license that can be
michael@0 6 * found in the LICENSE file.
michael@0 7 */
michael@0 8
michael@0 9
michael@0 10 #ifndef SkStackViewLayout_DEFINED
michael@0 11 #define SkStackViewLayout_DEFINED
michael@0 12
michael@0 13 #include "SkView.h"
michael@0 14
michael@0 15 class SkStackViewLayout : public SkView::Layout {
michael@0 16 public:
michael@0 17 SkStackViewLayout();
michael@0 18
michael@0 19 enum Orient {
michael@0 20 kHorizontal_Orient,
michael@0 21 kVertical_Orient,
michael@0 22
michael@0 23 kOrientCount
michael@0 24 };
michael@0 25 Orient getOrient() const { return (Orient)fOrient; }
michael@0 26 void setOrient(Orient);
michael@0 27
michael@0 28 void getMargin(SkRect*) const;
michael@0 29 void setMargin(const SkRect&);
michael@0 30
michael@0 31 SkScalar getSpacer() const { return fSpacer; }
michael@0 32 void setSpacer(SkScalar);
michael@0 33
michael@0 34 /** Controls the posititioning in the same direction as the orientation
michael@0 35 */
michael@0 36 enum Pack {
michael@0 37 kStart_Pack,
michael@0 38 kCenter_Pack,
michael@0 39 kEnd_Pack,
michael@0 40
michael@0 41 kPackCount
michael@0 42 };
michael@0 43 Pack getPack() const { return (Pack)fPack; }
michael@0 44 void setPack(Pack);
michael@0 45
michael@0 46 /** Controls the posititioning at right angles to the orientation
michael@0 47 */
michael@0 48 enum Align {
michael@0 49 kStart_Align,
michael@0 50 kCenter_Align,
michael@0 51 kEnd_Align,
michael@0 52 kStretch_Align,
michael@0 53
michael@0 54 kAlignCount
michael@0 55 };
michael@0 56 Align getAlign() const { return (Align)fAlign; }
michael@0 57 void setAlign(Align);
michael@0 58
michael@0 59 bool getRound() const { return SkToBool(fRound); }
michael@0 60 void setRound(bool);
michael@0 61
michael@0 62 protected:
michael@0 63 virtual void onLayoutChildren(SkView* parent);
michael@0 64 virtual void onInflate(const SkDOM&, const SkDOM::Node*);
michael@0 65
michael@0 66 private:
michael@0 67 SkRect fMargin;
michael@0 68 SkScalar fSpacer;
michael@0 69 uint8_t fOrient, fPack, fAlign, fRound;
michael@0 70 };
michael@0 71
michael@0 72 class SkFillViewLayout : public SkView::Layout {
michael@0 73 public:
michael@0 74 SkFillViewLayout();
michael@0 75 void getMargin(SkRect*) const;
michael@0 76 void setMargin(const SkRect&);
michael@0 77
michael@0 78 protected:
michael@0 79 // overrides;
michael@0 80 virtual void onLayoutChildren(SkView* parent);
michael@0 81 virtual void onInflate(const SkDOM& dom, const SkDOM::Node* node);
michael@0 82
michael@0 83 private:
michael@0 84 SkRect fMargin;
michael@0 85 typedef SkView::Layout INHERITED;
michael@0 86 };
michael@0 87
michael@0 88 #endif

mercurial