1/* 2 * Copyright 2014 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Augustin Cavalier, waddlesplash@gmail.com 7 * 8 * Corresponds to: 9 * headers/os/interface/Size.h hrev48620 10 * src/kits/interface/Size.cpp hrev48620 11 */ 12 13 14/*! 15 \file Size.h 16 \ingroup interface 17 \ingroup libbe 18 \brief BSize class definition and related enum definition. 19*/ 20 21 22/*! 23 \var B_SIZE_UNSET 24 25 A placeholder size value. Controls that are passed this value 26 will create their own sizing. 27 28 \since Haiku R1 29*/ 30 31 32/*! 33 \var B_SIZE_UNLIMITED 34 35 The largest possible size value. 36 37 \since Haiku R1 38*/ 39 40 41/*! 42 \class BSize 43 \ingroup interface 44 \ingroup libbe 45 \brief A two-dimensional size. 46 47 \since Haiku R1 48*/ 49 50 51/*! 52 \var BSize::width 53 \brief The horizontal dimension. 54 55 \since Haiku R1 56*/ 57 58 59/*! 60 \var BSize::height 61 \brief The vertical dimension. 62 63 \since Haiku R1 64*/ 65 66 67/*! 68 \fn inline BSize::BSize() 69 \brief Initializes a BSize object with both dimensions set to \c B_SIZE_UNSET. 70 71 \see BSize::Set() 72 73 \since Haiku R1 74*/ 75 76 77/*! 78 \fn inline BSize::BSize(float width, float height) 79 \brief Initializes a BSize object with the specified \a width and 80 \a height values. 81 82 \param width The \a width value to set. 83 \param height The \a height value to set. 84 85 \since Haiku R1 86*/ 87 88 89/*! 90 \fn inline BSize::BSize(const BSize& other) 91 \brief Initializes a BSize object from another BSize. 92 93 \param other The BSize object to copy from. 94 95 \since Haiku R1 96*/ 97 98 99/*! 100 \fn inline float BSize::Width() const 101 \brief Gets the \a width of the BSize object. 102 103 \returns BSize::width 104 105 \since Haiku R1 106*/ 107 108 109/*! 110 \fn inline float BSize::Height() const 111 \brief Gets the \a height of the BSize object. 112 113 \returns BSize::height 114 115 \since Haiku R1 116*/ 117 118 119/*! 120 \fn inline void BSize::Set(float width, float height) 121 \brief Sets the \a width and \a height values of a BSize object. 122 123 \param width The \a width value to set. 124 \param height The \a height value to set. 125 126 \since Haiku R1 127*/ 128 129 130/*! 131 \fn inline void BSize::SetWidth(float width) 132 \brief Sets the \a width value of a BSize object. 133 134 \param width The \a width value to set. 135 136 \since Haiku R1 137*/ 138 139 140/*! 141 \fn inline void BSize::SetHeight(float height) 142 \brief Sets the \a height value of a BSize object. 143 144 \param height The \a height value to set. 145 146 \since Haiku R1 147*/ 148 149 150/*! 151 \fn inline int32 BSize::IntegerWidth() const 152 \brief Returns the \a width value of a BSize object as an \a int32. 153 154 \returns BSize::width, cast to an \a int32. 155 156 \warning This may lose precision! 157 158 \since Haiku R1 159*/ 160 161 162/*! 163 \fn inline int32 BSize::IntegerHeight() const 164 \brief Returns the \a height value of a BSize object as an \a int32. 165 166 \returns BSize::height, cast to an \a int32. 167 168 \warning This may lose precision! 169 170 \since Haiku R1 171*/ 172 173 174/*! 175 \fn inline bool BSize::IsWidthSet() const 176 \brief Checks if the BSize::width is not \c B_SIZE_UNSET. 177 178 \returns \c true if the width is set, \c false otherwise. 179 180 \since Haiku R1 181*/ 182 183 184/*! 185 \fn inline bool BSize::IsHeightSet() const 186 \brief Checks if the BSize::height is not \c B_SIZE_UNSET. 187 188 \returns \c true if the height is set, \c false otherwise. 189 190 \since Haiku R1 191*/ 192 193 194/*! 195 \name Operators 196*/ 197 198 199//! @{ 200 201 202/*! 203 \fn inline BSize& BSize::operator=(const BSize& other) 204 \brief Initializes a BSize object from another BSize by overloading 205 the = operator. 206 207 \param other The BSize object to copy from. 208 209 \since Haiku R1 210*/ 211 212 213/*! 214 \fn bool BSize::operator!=(const BSize& other) const 215 \brief Returns whether or not the width and height values of the BSize 216 objects differ. 217 218 \return \c true if the width or height values differ, \c false otherwise. 219 220 \since Haiku R1 221*/ 222 223 224/*! 225 \fn bool BSize::operator==(const BSize& other) const 226 \brief Returns whether or not the width and height values of the BSize 227 objects are equal. 228 229 \return \c true if the width and height values are equal, \c false otherwise. 230 231 \since Haiku R1 232*/ 233 234 235//! @} 236