Names.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * The contents of this file are subject to the Mozilla Public
  3. * License Version 1.1 (the "License"); you may not use this file
  4. * except in compliance with the License. You may obtain a copy of
  5. * the License at http://www.mozilla.org/MPL/
  6. *
  7. * Software distributed under the License is distributed on an "AS
  8. * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  9. * implied. See the License for the specific language governing
  10. * rights and limitations under the License.
  11. *
  12. * The Original Code is Vision.
  13. *
  14. * The Initial Developer of the Original Code is The Vision Team.
  15. * Portions created by The Vision Team are
  16. * Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights
  17. * Reserved.
  18. *
  19. * Contributor(s): Wade Majors <wade@ezri.org>
  20. * Rene Gollent
  21. * Todd Lair
  22. * Andrew Bazan
  23. * Jamie Wilkinson
  24. */
  25. #ifndef _NAMES_H_
  26. #define _NAMES_H_
  27. #include <ListItem.h>
  28. #include <ListView.h>
  29. #include <String.h>
  30. class BPopUpMenu;
  31. class BMenu;
  32. class Theme;
  33. class NameItem : public BListItem
  34. {
  35. public:
  36. NameItem (
  37. const char *,
  38. int32);
  39. BString Name (void) const;
  40. BString Address (void) const;
  41. int32 Status (void) const;
  42. void SetName (const char *);
  43. void SetAddress (const char *);
  44. void SetStatus (int32);
  45. virtual void DrawItem (BView *, BRect , bool = false);
  46. private:
  47. BString myName,
  48. myAddress;
  49. int32 myStatus;
  50. };
  51. class NamesView : public BListView
  52. {
  53. public:
  54. NamesView (BRect);
  55. virtual ~NamesView (void);
  56. virtual void AttachedToWindow (void);
  57. virtual void DetachedFromWindow (void);
  58. virtual void MouseDown (BPoint);
  59. virtual void MouseMoved (BPoint, uint32, const BMessage *);
  60. virtual void MouseUp (BPoint);
  61. virtual void KeyDown (const char *, int32);
  62. virtual void MessageReceived (BMessage *);
  63. void ClearList (void);
  64. private:
  65. bool fTracking;
  66. BPopUpMenu *fMyPopUp;
  67. BMenu *fCTCPPopUp;
  68. int32 fLastSelected,
  69. fLastButton,
  70. fCurrentindex;
  71. Theme *fActiveTheme;
  72. };
  73. #endif