本文整理汇总了C++中Channel::ParentFeed方法的典型用法代码示例。如果您正苦于以下问题:C++ Channel::ParentFeed方法的具体用法?C++ Channel::ParentFeed怎么用?C++ Channel::ParentFeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Channel
的用法示例。
在下文中一共展示了Channel::ParentFeed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MessageReceived
void FeedListener::MessageReceived(BMessage *msg) {
switch (msg->what) {
case B_SOME_APP_LAUNCHED: {
const char *signature = NULL;
if (msg->FindString("be:signature", &signature) != B_OK) return;
if (strcmp(signature, FeedKit::ServerSignature) == 0) {
fMsgr = BMessenger(FeedKit::ServerSignature);
if ((fListening == true) && (fRegistered == false)) {
AddListener(fTarget);
};
for (handler_t::iterator hIt = fHandler.begin(); hIt != fHandler.end(); hIt++) {
(*hIt)->ServerStarted();
}
};
} break;
case B_SOME_APP_QUIT: {
const char *signature = NULL;
if (msg->FindString("be:signature", &signature) != B_OK) return;
if ((fRegistered == true) && (strcmp(signature, FeedKit::ServerSignature) == 0)) {
fRegistered = false;
for (handler_t::iterator hIt = fHandler.begin(); hIt != fHandler.end(); hIt++) {
(*hIt)->ServerShutdown();
};
};
} break;
case FeedKit::Private::FromServer::RegisterFeedComplete: {
Feed feed;
if (msg->FindFlat("feed", &feed) == B_OK) {
for (handler_t::iterator hIt = fHandler.begin(); hIt != fHandler.end(); hIt++) {
(*hIt)->FeedRegistered(&feed);
};
};
} break;
case FeedKit::Private::FromServer::ChannelUpdated: {
Feed feed;
const char *channelUUID;
Channel *channel;
if (msg->FindFlat("feed", &feed) != B_OK) return;
if (msg->FindString("channel", &channelUUID) != B_OK) return;
channel = feed.ChannelByUUID(channelUUID);
for (handler_t::iterator hIt = fHandler.begin(); hIt != fHandler.end(); hIt++) {
(*hIt)->ChannelUpdated(&feed, channel);
};
} break;
case FeedKit::Private::FromServer::ItemRead: {
Feed feed;
const char *channelUUID;
const char *itemUUID;
if (msg->FindFlat("feed", &feed) != B_OK) return;
if (msg->FindString("channel", &channelUUID) != B_OK) return;
if (msg->FindString("item", &itemUUID) != B_OK) return;
Channel *channel = feed.ChannelByUUID(channelUUID);
Item *item = channel->ItemByUUID(itemUUID);
channel->ParentFeed(&feed);
item->ParentChannel(channel);
for (handler_t::iterator hIt = fHandler.begin(); hIt != fHandler.end(); hIt++) {
(*hIt)->ItemRead(&feed, channel, item);
};
} break;
case FeedKit::Private::FromServer::RegisterFeedError: {
Feed feed;
ErrorDetails error;
if (msg->FindFlat("feed", &feed) != B_OK) return;
if (msg->FindFlat("error", &error) != B_OK) return;
for (handler_t::iterator hIt = fHandler.begin(); hIt != fHandler.end(); hIt++) {
(*hIt)->FeedRegisteredError(&feed, &error);
};
} break;
case FeedKit::Private::FromServer::DownloadFeedStarted: {
Feed feed;
DownloadProgress progress;
if (msg->FindFlat("feed", &feed) != B_OK) return;
if (msg->FindFlat("download", &progress) != B_OK) return;
for (handler_t::iterator hIt = fHandler.begin(); hIt != fHandler.end(); hIt++) {
(*hIt)->FeedDownloadStarted(&feed, &progress);
};
} break;
//.........这里部分代码省略.........