1/* 2 * Copyright 2014 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Adrien Destugues, pulkomandy@pulkomandy.ath.cx 7 * Axel Dörfler, axeld@pinc-software.de 8 * John Scipione, jscipione@gmail.com 9 * 10 * Corresponds to: 11 * headers/private/interface/ToolTip.h hrev48560 12 * src/kits/interface/ToolTip.cpp hrev48560 13 */ 14 15 16//! \cond INTERNAL 17 18 19/*! 20 \file ToolTip.h 21 \ingroup interface 22 \ingroup libbe 23 \brief Provides the BToolTip class. 24*/ 25 26 27/*! 28 \class BToolTip 29 \ingroup interface 30 \ingroup libbe 31 \brief Displays help text on hover. 32 33 \attention Use at your own risk! This class is private and may change 34 before release. 35 36 This class is for advanced uses of tool tips with custom contents or 37 behavior. The simple way to use tooltips is via BView::SetToolTip(). 38 39 \since Haiku R1 40*/ 41 42 43/*! 44 \fn BToolTip::BToolTip() 45 \brief Creates a new BToolTip object. 46 47 \since Haiku R1 48*/ 49 50 51/*! 52 \fn BToolTip::BToolTip(BMessage* archive) 53 \brief Creates a BToolTip object from the passed in \a archive. 54 55 \since Haiku R1 56*/ 57 58 59/*! 60 \fn BToolTip::~BToolTip() 61 \brief Frees the memory allocated and destroys the object. 62 63 \since Haiku R1 64*/ 65 66 67/*! 68 \fn status_t BToolTip::Archive(BMessage* archive, bool deep) const 69 \brief Archives the object into the \a data message. 70 71 Saves the tool tip's sticky flag. 72 73 \param archive A pointer to the BMessage object to archive the object into. 74 \param deep Whether or not to archive child views as well. 75 76 \return A status code, \c B_OK if everything went well or an error code 77 otherwise. 78 \retval B_OK The object was archived. 79 \retval B_NO_MEMORY Ran out of memory while archiving the object. 80 81 \since Haiku R1 82*/ 83 84 85/*! 86 \fn void BToolTip::SetSticky(bool enable) 87 \brief Turns sticky flag on or off which determines whether or not the 88 tool tip stays visible when the mouse moves. 89 90 \since Haiku R1 91*/ 92 93 94/*! 95 \fn bool BToolTip::IsSticky() const 96 \brief Returns whether or not the sticky flag is set. 97 98 \since Haiku R1 99*/ 100 101 102/*! 103 \fn void BToolTip::SetMouseRelativeLocation(BPoint location) 104 \brief Set the location of the tooltip relative to the current mouse position. 105 106 The position is relative to the mouse cursor location at the time the 107 tool tip is shown. It should be as close as possible to the mouse cursor 108 without hiding important parts of the UI near the cursor while the parent 109 view remains visible and reachable. 110 111 \since Haiku R1 112*/ 113 114 115/*! 116 \fn BPoint BToolTip::MouseRelativeLocation() const 117 \brief Returns the tool tip's relative mouse location. 118 119 \since Haiku R1 120*/ 121 122 123/*! 124 \fn void BToolTip::SetAlignment(BAlignment alignment) 125 \brief Set the alignment of the tool tip which determines where the tool 126 tip should appear i.e. left or right from the current mouse cursor 127 position, etc. 128 129 \since Haiku R1 130*/ 131 132 133/*! 134 \fn BAlignment BToolTip::Alignment() const 135 \brief Returns the tool tip's alignment. 136 137 \since Haiku R1 138*/ 139 140 141/*! 142 \fn bool BToolTip::Lock() 143 \brief Allows derived classes to lock the tool tip while modifying it. 144 145 \since Haiku R1 146*/ 147 148 149/*! 150 \fn void BToolTip::Unlock() 151 \brief Allows derived classes to unlock the tool tip. 152 153 \since Haiku R1 154*/ 155 156 157/*! 158 \fn virtual void BToolTip::AttachedToWindow() 159 \brief Undocumented public method 160 161 \since Haiku R1 162*/ 163 164 165/*! 166 \fn virtual void BToolTip::DetachedFromWindow() 167 \brief Undocumented public method 168 169 \since Haiku R1 170*/ 171 172 173/*! 174 \fn virtual BView* BToolTip::View() const =0 175 \brief Undocumented public method 176 177 \return Undocumented 178 \retval <value> Undocumented 179 180 \since Haiku R1 181*/ 182 183 184/*! 185 \class BTextToolTip 186 \ingroup interface 187 \ingroup libbe 188 \brief Undocumented class. 189 190 \since Haiku R1 191*/ 192 193 194/*! 195 \fn BTextToolTip::BTextToolTip(BMessage *archive) 196 \brief Undocumented public method 197 198 \param archive Undocumented 199 200 \return Undocumented 201 \retval <value> Undocumented 202 203 \since Haiku R1 204*/ 205 206 207/*! 208 \fn BTextToolTip::BTextToolTip(const char *text) 209 \brief Undocumented public method 210 211 \param text Undocumented 212 213 \return Undocumented 214 \retval <value> Undocumented 215 216 \since Haiku R1 217*/ 218 219 220/*! 221 \fn virtual BTextToolTip::~BTextToolTip() 222 \brief Undocumented public method 223 224 \return Undocumented 225 \retval <value> Undocumented 226 227 \since Haiku R1 228*/ 229 230 231/*! 232 \fn void BTextToolTip::SetText(const char *text) 233 \brief Undocumented public method 234 235 \param text Undocumented 236 237 \since Haiku R1 238*/ 239 240 241/*! 242 \fn const char* BTextToolTip::Text() const 243 \brief Undocumented public method 244 245 \return Undocumented 246 \retval <value> Undocumented 247 248 \since Haiku R1 249*/ 250 251 252/*! 253 \fn virtual BView* BTextToolTip::View() const 254 \brief Undocumented public method 255 256 \return Undocumented 257 \retval <value> Undocumented 258 259 \since Haiku R1 260*/ 261 262 263/*! 264 \fn static BTextToolTip* BTextToolTip::Instantiate(BMessage *archive) 265 \brief Undocumented public method 266 267 \param archive Undocumented 268 269 \return Undocumented 270 \retval <value> Undocumented 271 272 \since Haiku R1 273*/ 274 275 276//! \endcond INTERNAL 277