NotifyList.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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): Rene Gollent
  20. *
  21. */
  22. #ifndef _NOTIFYLIST_H_
  23. #define _NOTIFYLIST_H_
  24. #include <ListView.h>
  25. #include "ObjectList.h"
  26. class BPopUpMenu;
  27. class NotifyListItem;
  28. class Theme;
  29. class NotifyList : public BListView
  30. {
  31. public:
  32. NotifyList (BRect);
  33. virtual ~NotifyList (void);
  34. void UpdateList (BObjectList<NotifyListItem> *);
  35. virtual void AttachedToWindow (void);
  36. virtual void DetachedFromWindow (void);
  37. virtual void MessageReceived (BMessage *);
  38. virtual void MouseDown (BPoint);
  39. private:
  40. void BuildPopUp(void);
  41. Theme *fActiveTheme;
  42. int16 fLastButton,
  43. fClickCount;
  44. BPoint fLastClick;
  45. bigtime_t fLastClickTime;
  46. BPopUpMenu *fMyPopUp;
  47. };
  48. class NotifyListItem : public BStringItem
  49. {
  50. public:
  51. NotifyListItem (const char *, bool);
  52. NotifyListItem (const NotifyListItem &);
  53. virtual ~NotifyListItem (void);
  54. void SetState (bool);
  55. bool GetState (void) const;
  56. virtual void DrawItem (BView *, BRect, bool);
  57. private:
  58. bool fNotifyState;
  59. };
  60. #endif // _NOTIFYLIST_H_