return impl_->id_;
}
+std::list<std::string> AbstractItem::GetSharedPath() const {
+ return {};
+}
+
shared_ptr<AbstractAction> AbstractItem::GetAction() const {
return impl_->action_;
}
virtual AbstractItem& FindByID(std::string id) = 0;
virtual int GetType() const = 0;
static int GetType(Bundle b);
+ virtual std::list<std::string> GetSharedPath() const;
std::string GetId() const;
void SetId(std::string id);
std::shared_ptr<AbstractAction> GetAction() const;
return AbstractItem::ChatMessage;
}
+std::list<std::string> ChatMessageItem::GetSharedPath() const {
+ std::list<std::string> ret;
+
+ auto name = impl_->name_->GetSharedPath();
+ auto text = impl_->text_->GetSharedPath();
+ auto image = impl_->image_->GetSharedPath();
+ auto time = impl_->time_->GetSharedPath();
+
+ for (auto& i : name) {
+ ret.push_back(std::move(i));
+ }
+
+ for (auto& i : text) {
+ ret.push_back(std::move(i));
+ }
+
+ for (auto& i : image) {
+ ret.push_back(std::move(i));
+ }
+
+ for (auto& i : time) {
+ ret.push_back(std::move(i));
+ }
+
+ return ret;
+}
+
Bundle ChatMessageItem::Serialize() const {
Bundle b;
b = AbstractItem::Serialize();
Bundle Serialize() const override;
void Deserialize(Bundle b) override;
AbstractItem& FindByID(std::string id) override;
+ std::list<std::string> GetSharedPath() const override;
TextItem& GetNameItem() const;
TextItem& GetTextItem() const;
ImageItem& GetImageItem() const;
return FactoryManager::GetInst().GetNullItem();
}
+list<string> GroupItem::GetSharedPath() const {
+ list<string> ret;
+
+ for (auto& i : impl_->children_list_) {
+ auto s = i->GetSharedPath();
+ for (auto& j : s) {
+ ret.push_back(move(j));
+ }
+ }
+
+ return ret;
+}
+
void GroupItem::AddChild(shared_ptr<AbstractItem> child) {
impl_->children_list_.emplace_back(child);
}
virtual ~GroupItem();
public:
- virtual Bundle Serialize() const override;
- virtual void Deserialize(Bundle b) override;
- virtual AbstractItem& FindByID(std::string id) override;
+ Bundle Serialize() const override;
+ void Deserialize(Bundle b) override;
+ AbstractItem& FindByID(std::string id) override;
int GetType() const override;
+ std::list<std::string> GetSharedPath() const override;
void SetDirection(bool vertical);
bool IsVertical();
return impl_->SendNotify(noti, EventInfo::Delete);
}
+int Manager::DeleteAll() {
+ //TODO
+ return -1;
+}
+
+int Manager::GetCount() const {
+ //TODO
+ return -1;
+}
+
int Manager::Hide(shared_ptr<item::AbstractItem> noti) {
((IItemInfoInternal*)noti->GetInfo().get())->AddHideViewer(util::GetAppId());
return impl_->SendNotify(noti, EventInfo::Update);
std::list<std::shared_ptr<item::AbstractItem>> Get();
int Update(std::shared_ptr<item::AbstractItem> noti);
int Delete(std::shared_ptr<item::AbstractItem> noti);
+ int DeleteAll();
int Hide(std::shared_ptr<item::AbstractItem> noti);
std::shared_ptr<item::AbstractItem> FindByRootID(std::string id);
int SendEvent(const IEventInfo& info, std::shared_ptr<item::AbstractItem> noti);
void OnEvent(const IEventInfo& info, std::list<Bundle> serialized) override;
std::list<Bundle> OnRequest(const IEventInfo& info) override;
void SendError(const IEventInfo& info, NotificationError error);
+ int GetCount() const;
static std::string GetPath();
protected:
return impl_->SendNotify(noti, EventInfo::Delete);
}
+int Reporter::DeleteAll() {
+ //TODO
+ return -1;
+}
+
std::shared_ptr<AbstractItem> Reporter::FindByRootID(std::string id) {
Bundle serialized;
EventInfo info(EventInfo::Get, util::GetAppId(), "", id);
int Post(std::list<std::shared_ptr<item::AbstractItem>> notiList);
int Update(std::shared_ptr<item::AbstractItem> noti);
int Delete(std::shared_ptr<item::AbstractItem> noti);
+ int DeleteAll();
std::shared_ptr<item::AbstractItem> FindByRootID(std::string id);
virtual void OnEvent(const IEventInfo& info,
std::list<std::shared_ptr<item::AbstractItem>> notiList);