summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-05-06 08:00:44 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-05-06 10:49:49 (GMT)
commit081fc03556708447610e9697a57235fa191a4f0d (patch)
tree505c8cc9129d2b44968d183a180f0ccddaa08810 /Swiften/Roster/ContactRosterItem.h
parent8c53236875d2ca77f1b463449918458f6b424ab1 (diff)
downloadswift-081fc03556708447610e9697a57235fa191a4f0d.zip
swift-081fc03556708447610e9697a57235fa191a4f0d.tar.bz2
Rewrite of large amounts of roster code.
Now keeps widgets out of Swiften, keeps sorting inside Swiften, and keeps track of presences to show the correct presence per roster item. Resolves: #316 Resolves: #81 Resolves: #239
Diffstat (limited to 'Swiften/Roster/ContactRosterItem.h')
-rw-r--r--Swiften/Roster/ContactRosterItem.h37
1 files changed, 18 insertions, 19 deletions
diff --git a/Swiften/Roster/ContactRosterItem.h b/Swiften/Roster/ContactRosterItem.h
index 92b3056..bd49e05 100644
--- a/Swiften/Roster/ContactRosterItem.h
+++ b/Swiften/Roster/ContactRosterItem.h
@@ -1,48 +1,47 @@
/*
- * Copyright (c) 2010 Remko Tronçon
+ * Copyright (c) 2010 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_ContactRosterItem_H
-#define SWIFTEN_ContactRosterItem_H
+#pragma once
#include "Swiften/Base/String.h"
#include "Swiften/JID/JID.h"
-#include "Swiften/Roster/TreeWidgetFactory.h"
#include "Swiften/Roster/RosterItem.h"
-#include "Swiften/Roster/UserRosterAction.h"
#include "Swiften/Elements/StatusShow.h"
+#include "Swiften/Elements/Presence.h"
+#include <map>
#include <boost/bind.hpp>
#include <boost/signal.hpp>
#include <boost/shared_ptr.hpp>
namespace Swift {
-class TreeWidgetItem;
class GroupRosterItem;
class ContactRosterItem : public RosterItem {
public:
- ContactRosterItem(const JID& jid, const String& name, GroupRosterItem* parent, TreeWidgetFactory* factory);
- ~ContactRosterItem();
+ ContactRosterItem(const JID& jid, const String& name, GroupRosterItem* parent);
+ virtual ~ContactRosterItem();
- StatusShow::Type getStatusShow();
- void setStatusShow(StatusShow::Type show);
- void setStatusText(const String& status);
+ StatusShow::Type getStatusShow() const;
+ StatusShow::Type getSimplifiedStatusShow() const;
+ String getStatusText() const;
void setAvatarPath(const String& path);
+ const String& getAvatarPath() const;
const JID& getJID() const;
- void setName(const String& name);
- void show();
- void hide();
-
+ void applyPresence(const String& resource, boost::shared_ptr<Presence> presence);
+ void clearPresence();
+ void calculateShownPresence();
private:
JID jid_;
- String name_;
- TreeWidgetItem *widget_;
- StatusShow::Type statusShow_;
+ String avatarPath_;
+ bool hidden_;
+ std::map<String, boost::shared_ptr<Presence> > presences_;
+ boost::shared_ptr<Presence> offlinePresence_;
+ boost::shared_ptr<Presence> shownPresence_;
};
}
-#endif