AccountListItem.cpp 740 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright 2009-2010, Pier Luigi Fiorini. All rights reserved.
  3. * Distributed under the terms of the MIT License.
  4. *
  5. * Authors:
  6. * Pier Luigi Fiorini, pierluigi.fiorini@gmail.com
  7. */
  8. #include <View.h>
  9. #include "AccountListItem.h"
  10. #include "ProtocolSettings.h"
  11. AccountListItem::AccountListItem(ProtocolSettings* settings,
  12. const char* account)
  13. :
  14. BStringItem(account),
  15. fSettings(settings),
  16. fAccount(account),
  17. fBaselineOffset(0)
  18. {
  19. }
  20. AccountListItem::~AccountListItem()
  21. {
  22. }
  23. ProtocolSettings*
  24. AccountListItem::Settings() const
  25. {
  26. return fSettings;
  27. }
  28. const char*
  29. AccountListItem::Account() const
  30. {
  31. return fAccount.String();
  32. }
  33. void
  34. AccountListItem::SetAccount(const char* name)
  35. {
  36. fAccount = name;
  37. SetText(fAccount);
  38. }