--- /dev/null
+BEGIN:VCALENDAR\r
+PRODID:vCal ID Default\r
+VERSION:2.0\r
+BEGIN:VEVENT\r
+SUMMARY:Hdjdbfnf\r
+DTSTART;TZID=Europe/Kiev:20170414T140000\r
+DTEND;TZID=Europe/Kiev:20170414T150000\r
+CLASS:CONFIDENTIAL\r
+CREATED:20170414T102656Z\r
+LAST-MODIFIED:20170414T102656Z\r
+PRIORITY:0\r
+DTSTAMP:20170414T102935Z\r
+END:VEVENT\r
+END:VCALENDAR\r
--- /dev/null
+Big text file
: Message()
, MsgStructDummy(release)
, m_Address(false)
- , m_AddressList(false)
+ , m_AddressList()
{
}
{
}
-const MsgAddressListHandleDummy &MessageDummy::getAddressList() const
+const MsgAddressListDummy &MessageDummy::getAddressList() const
{
return m_AddressList;
}
virtual MsgId getId() const;
virtual ThreadId getThreadId() const;
virtual time_t getTime() const;
- virtual const MsgAddressListHandleDummy &getAddressList() const;
+ virtual const MsgAddressListDummy &getAddressList() const;
virtual MsgAddressDummy &addAddress();
virtual void addAddresses(const MsgAddressList &list);
virtual void setText(const std::string &text);
protected:
mutable MsgAddressDummy m_Address;
- mutable MsgAddressListHandleDummy m_AddressList;
+ mutable MsgAddressListDummy m_AddressList;
};
- typedef class MsgListHandleDummy<MessageDummy, Message> MessageListHandleDummy;
- typedef class MsgStructListDummy<MessageDummy, Message> MessageStructListDummy;
+ typedef class MsgListDummy<MessageDummy, Message> MessageListDummy;
}
#endif /* _MESSAGE_Dummy_H__ */
MessageMmsDummy::MessageMmsDummy(bool release)
: MessageDummy(release)
, MessageMms()
- , m_PageList(false)
- , m_AttachmentList(false)
+ , m_PageList()
+ , m_AttachmentList()
, m_Page(false)
, m_Attachment(false)
{
return 5;
}
-const MsgPageListHandleDummy &MessageMmsDummy::getPageList() const
+const MsgPageListDummy &MessageMmsDummy::getPageList() const
{
return m_PageList;
}
return m_Page;
}
-const MsgAttachmentListHandleDummy &MessageMmsDummy::getAttachmentList() const
+const MsgAttachmentListDummy &MessageMmsDummy::getAttachmentList() const
{
return m_AttachmentList;
}
virtual Type getType() const;
virtual int getSize() const;
- virtual const MsgPageListHandleDummy &getPageList() const;
+ virtual const MsgPageListDummy &getPageList() const;
virtual MsgPageDummy &addPage();
- virtual const MsgAttachmentListHandleDummy &getAttachmentList() const;
+ virtual const MsgAttachmentListDummy &getAttachmentList() const;
virtual MsgAttachmentDummy &addAttachment();
virtual time_t getExpired() const;
int getMediaCount() const;
private:
- mutable MsgPageListHandleDummy m_PageList;
- mutable MsgAttachmentListHandleDummy m_AttachmentList;
+ mutable MsgPageListDummy m_PageList;
+ mutable MsgAttachmentListDummy m_AttachmentList;
MsgPageDummy m_Page;
MsgAttachmentDummy m_Attachment;
};
- typedef class MsgListHandleDummy<MessageMmsDummy, MessageMms> MmsListHandleDummy;
- typedef class MsgStructListDummy<MessageMmsDummy, MessageMms> MmsStructListDummy;
+ typedef class MsgListDummy<MessageMmsDummy, MessageMms> MmsListDummy;
}
#endif /* _MESSAGE_MMS_Dummy_H__ */
#include "MessageSMS.h"
#include "MessageDummy.h"
-#include "MsgListHandleDummy.h"
-#include "MsgStructListDummy.h"
+#include "MsgListDummy.h"
namespace Msg
{
virtual std::string getText() const;
};
- typedef class MsgListHandleDummy<MessageSMSDummy, MessageSMS> SmsListHandleDummy;
- typedef class MsgStructListDummy<MessageSMSDummy, MessageSMS> SmsStructListDummy;
+ typedef class MsgListDummy<MessageSMSDummy, MessageSMS> SmsListDummy;
}
#endif /* _MESSAGE_SMS_Dummy_H__ */
#define MsgAddressDummy_h_
#include "MsgAddress.h"
-#include "MsgListHandleDummy.h"
-#include "MsgStructListDummy.h"
+
+#include "MsgListDummy.h"
#include "MsgStructDummy.h"
namespace Msg
void setFields(const MsgAddress &addr);
};
- typedef class MsgListHandleDummy<MsgAddressDummy, MsgAddress> MsgAddressListHandleDummy;
- typedef class MsgStructListDummy<MsgAddressDummy, MsgAddress> MsgAddressStructListDummy;
+ typedef class MsgListDummy<MsgAddressDummy, MsgAddress> MsgAddressListDummy;
}
#endif /* MsgAddressDummy_h_ */
#define _MSG_ATTACHMENT_Dummy_H__
#include "MsgAttachment.h"
+
+#include "MsgListDummy.h"
#include "MsgStructDummy.h"
-#include "MsgListHandleDummy.h"
-#include "MsgStructListDummy.h"
namespace Msg
{
void setMime(const std::string &mime);
};
- typedef class MsgListHandleDummy<MsgAttachmentDummy, MsgAttachment> MsgAttachmentListHandleDummy;
- typedef class MsgStructListDummy<MsgAttachmentDummy, MsgAttachment> MsgAttachmentStructListDummy;
+ typedef class MsgListDummy<MsgAttachmentDummy, MsgAttachment> MsgAttachmentListDummy;
}
#endif /* _MSG_ATTACHMENT_Dummy_H__ */
#include "MsgConvMediaDummy.h"
#include "MsgUtilsDummy.h"
#include "fakeNames.h"
+#include "PathUtils.h"
using namespace Msg;
+const std::vector<std::string> fileNames = {"cat.png", "Calendar1.vcs", "Contact.vcf",
+ "big.txt", "call.csv", "phone.jpg", "table.3gp", "Voice.m4a"};
+
MsgConvMediaDummy::MsgConvMediaDummy(bool release)
: MsgStructDummy(release)
, MsgConvMedia()
+ , m_Number(0)
{
}
{
}
+int MsgConvMediaDummy::getNumberOfItems()
+{
+ return fileNames.size();
+}
+
std::string MsgConvMediaDummy::getMime() const
{
return std::string();
std::string MsgConvMediaDummy::getName() const
{
- return fakeNames[rand()%fakeNames.size()];
+ return fileNames[m_Number];
}
std::string MsgConvMediaDummy::getPath() const
{
- return std::string();
+ m_Number = rand() % getNumberOfItems();
+ return PathUtils::getResourcePath("dummy_res/" + fileNames[m_Number]);
}
std::string MsgConvMediaDummy::getThumbPath() const
#define MSGCONVMEDIADummy_H_
#include "MsgConvMedia.h"
-#include "MsgListHandleDummy.h"
+
+#include "MsgListDummy.h"
#include "MsgStructDummy.h"
namespace Msg
MsgConvMediaDummy(bool release);
virtual ~MsgConvMediaDummy();
+ static int getNumberOfItems();
virtual std::string getMime() const;
virtual std::string getName() const;
virtual std::string getPath() const;
virtual std::string getThumbPath() const;
virtual std::string getContentId() const;
virtual std::string getContentLocation() const;
+
+ private:
+ mutable int m_Number;
};
- typedef class MsgListHandleDummy<MsgConvMediaDummy, MsgConvMedia> MsgConvMediaListHandleDummy;
+ typedef class MsgListDummy<MsgConvMediaDummy, MsgConvMedia> MsgConvMediaListDummy;
}
#endif /* MSGCONVMEDIADummy_H_ */
MsgConversationItemDummy::MsgConversationItemDummy(bool release)
: MsgStructDummy(release)
- , m_MultipartList(false)
+ , m_MultipartList(rand() % MsgConvMediaDummy::getNumberOfItems())
{
}
return attachments;
}
-const MsgConvMediaListHandleDummy &MsgConversationItemDummy::getMediaList() const
+const MsgConvMediaListDummy &MsgConversationItemDummy::getMediaList() const
{
return m_MultipartList;
}
#define __MSG_CONVERSATION_ITEM_Dummy_H__
#include "MsgConversationItem.h"
-#include "MsgStructDummy.h"
-#include "MsgListHandleDummy.h"
-#include "MsgStructListDummy.h"
#include "MsgConvMediaDummy.h"
+#include "MsgListDummy.h"
namespace Msg
{
virtual bool isRead() const;
virtual int getPagesCount() const;
virtual int getAttachCount() const;
- virtual const MsgConvMediaListHandleDummy &getMediaList() const;
+ virtual const MsgConvMediaListDummy &getMediaList() const;
virtual bool isRestrictedByDpm() const;
protected:
- mutable MsgConvMediaListHandleDummy m_MultipartList;
+ mutable MsgConvMediaListDummy m_MultipartList;
};
- typedef class MsgListHandleDummy<MsgConversationItemDummy, MsgConversationItem> MsgConversationListHandleDummy;
- typedef class MsgStructListDummy<MsgConversationItemDummy, MsgConversationItem> MsgConversationStructListDummy;
+ typedef class MsgListDummy<MsgConversationItemDummy, MsgConversationItem> MsgConversationListDummy;
}
#endif /* __MSG_CONVERSATION_ITEM_Dummy_H__ */
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _MsgListDummy_H__
+#define _MsgListDummy_H__
+
+#include "MsgList.h"
+
+namespace Msg
+{
+ // class T : public BaseT {}
+ template<typename T, typename BaseT>
+ class MsgListDummy
+ : public MsgList<BaseT> // implement interface
+ {
+ public:
+ MsgListDummy(int size)
+ : m_Object(false)
+ , m_Length(size)
+ {
+ }
+ MsgListDummy()
+ : m_Object(false)
+ , m_Length(15)
+ {
+ }
+
+ virtual ~MsgListDummy()
+ {
+ }
+
+ virtual BaseT &at(int i)
+ {
+ return m_Object;
+ }
+
+ virtual const BaseT &at(int i) const
+ {
+ return m_Object;
+ }
+
+ virtual int getLength() const
+ {
+ return m_Length;
+ }
+
+ MsgListDummy(MsgListDummy&) = delete;
+ MsgListDummy &operator=(MsgListDummy&) = delete;
+
+ protected:
+ mutable T m_Object;
+ int m_Length;
+ };
+}
+
+#endif /* _MsgListDummy_H__ */
+++ /dev/null
-/*
- * Copyright 2016 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _MsgListHandleDummy_H__
-#define _MsgListHandleDummy_H__
-
-#include "MsgList.h"
-
-namespace Msg
-{
- // class T : public BaseT {}
- template<typename T, typename BaseT>
- class MsgListHandleDummy
- : public MsgList<BaseT> // implement interface
- {
- public:
- MsgListHandleDummy(bool release)
- : m_Object(false)
- , m_Release(release)
- {
- }
-
- virtual ~MsgListHandleDummy()
- {
- }
-
- virtual BaseT &at(int i)
- {
- return m_Object;
- }
-
- virtual const BaseT &at(int i) const
- {
- return m_Object;
- }
-
- virtual int getLength() const
- {
- return 25;
- }
-
-
- MsgListHandleDummy(MsgListHandleDummy&) = delete;
- MsgListHandleDummy &operator=(MsgListHandleDummy&) = delete;
-
- protected:
- mutable T m_Object;
- bool m_Release;
- };
-}
-
-#endif /* _MsgListHandleDummy_H__ */
#include "Logger.h"
#include "MediaType.h"
#include "FileUtils.h"
-
+#include "PathUtils.h"
using namespace Msg;
MsgMediaDummy::MsgMediaDummy(bool release)
std::string MsgMediaDummy::getFileName() const
{
- return std::string();
+ return "";
}
std::string MsgMediaDummy::getFilePath() const
{
- return std::string();
+ return "";
}
std::string MsgMediaDummy::getMime() const
#define _MSG_MEDIA_Dummy_H__
#include "MsgMedia.h"
+
+#include "MsgListDummy.h"
#include "MsgStructDummy.h"
-#include "MsgListHandleDummy.h"
-#include "MsgStructListDummy.h"
namespace Msg
{
void setType(Type type);
};
- typedef class MsgListHandleDummy<MsgMediaDummy, MsgMedia> MsgMediaListHandleDummy;
- typedef class MsgStructListDummy<MsgMediaDummy, MsgMedia> MsgMediaStructListDummy;
+ typedef class MsgListDummy<MsgMediaDummy, MsgMedia> MsgMediaListDummy;
}
#endif /* _MSG_MEDIA_Dummy_H__ */
MsgPageDummy::MsgPageDummy(bool release)
: MsgStructDummy(release)
- , m_MediaList(false)
+ , m_MediaList()
, m_Media(false)
{
}
{
}
-MsgMediaListHandleDummy &MsgPageDummy::getMediaList()
+MsgMediaListDummy &MsgPageDummy::getMediaList()
{
return m_MediaList;
}
MsgPageDummy(bool release);
virtual ~MsgPageDummy();
- virtual MsgMediaListHandleDummy &getMediaList();
+ virtual MsgMediaListDummy &getMediaList();
virtual MsgMediaDummy &addMedia();
virtual void setPageDuration(int duration);
virtual int getPageDuration() const;
private:
- MsgMediaListHandleDummy m_MediaList;
+ MsgMediaListDummy m_MediaList;
MsgMediaDummy m_Media;
};
- typedef class MsgListHandleDummy<MsgPageDummy, MsgPage> MsgPageListHandleDummy;
- typedef class MsgStructListDummy<MsgPageDummy, MsgPage> MsgPageStructListDummy;
+ typedef class MsgListDummy<MsgPageDummy, MsgPage> MsgPageListDummy;
}
#endif /* _MSG_PAGE_Dummy_H__ */
#define MsgReportDummy_h_
#include "MsgReport.h"
-#include "MsgListHandleDummy.h"
-#include "MsgStructListDummy.h"
+
+#include "MsgListDummy.h"
#include "MsgStructDummy.h"
namespace Msg
virtual time_t getTime() const;
};
- typedef class MsgListHandleDummy<MsgReportDummy, MsgReport> MsgReportListHandleDummy;
- typedef class MsgStructListDummy<MsgReportDummy, MsgReport> MsgReportStructListDummy;
+ typedef class MsgListDummy<MsgReportDummy, MsgReport> MsgReportListDummy;
}
#endif /* MsgReportDummy_h_ */
MsgThreadListRef MsgStorageDummy::getThreadList()
{
MsgThreadListRef res;
- res.reset(new MsgThreadStructListDummy(true));
+ res.reset(new MsgThreadListDummy);
return res;
}
MessageSMSListRef MsgStorageDummy::getSimMsgList()
{
MessageSMSListRef res;
- res.reset(new SmsStructListDummy(true));
+ res.reset(new SmsListDummy);
return res;
}
MsgAddressListRef MsgStorageDummy::getAddressList(ThreadId id)
{
- MsgAddressStructListDummy *result = new MsgAddressStructListDummy(true);
+ MsgAddressListDummy *result = new MsgAddressListDummy;
return MsgAddressListRef(result);
}
MsgConversationListRef MsgStorageDummy::getConversationList(ThreadId id)
{
MsgConversationListRef res;
- res.reset(new MsgConversationStructListDummy(true));
+ res.reset(new MsgConversationListDummy);
return res;
}
MsgReportListRef MsgStorageDummy::getMsgReportList(MsgId msgId)
{
- MsgReportStructListDummy *result = new MsgReportStructListDummy(true);
+ MsgReportListDummy *result = new MsgReportListDummy;
return MsgReportListRef(result);
}
+++ /dev/null
-/*
- * Copyright 2016 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _MsgStructListDummy_H__
-#define _MsgStructListDummy_H__
-
-#include "MsgList.h"
-
-namespace Msg
-{
- // class T : public BaseT {}
- template<typename T, typename BaseT>
- class MsgStructListDummy
- : public MsgList<BaseT> // implement interface
- {
- public:
- MsgStructListDummy(bool release)
- : m_Object(false) // release = false
- , m_Release(release)
- {
- }
-
- virtual ~MsgStructListDummy()
- {
- }
-
- virtual BaseT &at(int i)
- {
- return m_Object;
- }
-
- virtual const BaseT &at(int i) const
- {
- return m_Object;
- }
-
- virtual int getLength() const
- {
- return 16;
- }
-
- MsgStructListDummy(MsgStructListDummy&) = delete;
- MsgStructListDummy &operator=(MsgStructListDummy&) = delete;
-
- protected:
- mutable T m_Object;
- bool m_Release;
- };
-}
-
-#endif /* _MsgStructListDummy_H__ */
#define __MSG_THREAD_ITEM_H__
#include "MsgThreadItem.h"
-#include "MsgListHandleDummy.h"
-#include "MsgStructListDummy.h"
+
+#include "MsgListDummy.h"
#include "MsgStructDummy.h"
namespace Msg
virtual int getUnreadCount() const;
};
- typedef class MsgListHandleDummy<MsgThreadItemDummy, MsgThreadItem> MsgThreadListHandleDummy;
- typedef class MsgStructListDummy<MsgThreadItemDummy, MsgThreadItem> MsgThreadStructListDummy;
+ typedef class MsgListDummy<MsgThreadItemDummy, MsgThreadItem> MsgThreadListDummy;
}
#endif /* __MSG_THREAD_ITEM_H__ */
+++ /dev/null
-/*
- * Copyright 2016 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef BubbleAudioEntity_h_
-#define BubbleAudioEntity_h_
-
-#include "BubbleEntity.h"
-#include "BubbleIconTextLayoutItem.h"
-
-namespace Msg {
- class BubbleAudioEntity
- : public BubbleEntity {
- public:
- BubbleAudioEntity(const std::string &filePath, const std::string fileName, Message::Direction direction);
- virtual ~BubbleAudioEntity();
-
- BubbleIconTextLayoutItem *createView(Evas_Object *parent) override;
-
- private:
- std::string m_FileName;
- };
- inline BubbleAudioEntity::BubbleAudioEntity(const std::string &filePath, const std::string fileName, Message::Direction direction)
- : BubbleEntity(AudioItem, direction, filePath)
- , m_FileName(std::move(fileName))
- {
- }
-
- inline BubbleAudioEntity::~BubbleAudioEntity()
- {
- }
-
- inline BubbleIconTextLayoutItem *BubbleAudioEntity::createView(Evas_Object *parent)
- {
- auto *item = new BubbleIconTextLayoutItem(parent, *this);
- item->setIcon(item->createIcon(ATTACH_MUSIC_ICON));
- item->setMainText(m_FileName);
- return item;
- }
-}
-
-#endif /* BubbleAudioEntity_h_ */
class BubbleTextEntity;
class BubbleImageEntity;
class BubbleVideoEntity;
- class BubbleAudioEntity;
class BubbleRetrieveEntity;
class BubbleUnknownFileEntity;
class BubbleCalEventEntity;
BubbleEntity *createTextEntityFromFile(std::string filePath, Message::Direction direction);
BubbleEntity *createSubjectEntity(const std::string subject, Message::Direction direction);
BubbleEntity *createVideoEntity(std::string filePath, std::string fileName, Message::Direction direction);
- BubbleEntity *createAudioEntity(std::string filePath, std::string fileName, Message::Direction direction);
BubbleEntity *createVoiceEntity(std::string filePath, std::string fileName, Message::Direction direction);
BubbleEntityFactory(BubbleEntityFactory&) = delete;
BubbleEntityFactory& operator=(const BubbleEntityFactory&) = delete;
inline BubbleVoiceViewItem *BubbleVoiceEntity::createView(Evas_Object *parent)
{
auto *item = new BubbleVoiceViewItem(parent, *this);
+ item->setMainText(m_FileName);
return item;
}
}
#include "BubbleCalEventEntity.h"
#include "BubbleContactEntity.h"
#include "BubbleNoContentEntity.h"
-#include "BubbleAudioEntity.h"
#include "BubbleVoiceEntity.h"
#include "BubbleUnknownFileEntity.h"
#include "BubbleSubjectEntity.h"
case MsgMedia::ImageType:
return new BubbleImageEntity(std::move(filePath), direction);
case MsgMedia::AudioType:
- if (mime == "audio/m4a")
- return createVoiceEntity(std::move(filePath), std::move(fileName), direction);
- else
- return createAudioEntity(std::move(filePath), std::move(fileName), direction);
+ return createVoiceEntity(std::move(filePath), std::move(fileName), direction);
case MsgMedia::VideoType:
return createVideoEntity(std::move(filePath), std::move(fileName), direction);
default:
return new BubbleNoContentEntity(direction);
}
-BubbleEntity *BubbleEntityFactory::createAudioEntity(std::string filePath, std::string fileName, Message::Direction direction)
-{
- if (MediaUtils::hasAudio(filePath))
- return new BubbleAudioEntity(filePath, fileName, direction);
-
- // File does not contain audio or broken:
- return new BubbleUnknownFileEntity(filePath, fileName, direction);
-}
-
BubbleEntity *BubbleEntityFactory::createVoiceEntity(std::string filePath, std::string fileName, Message::Direction direction)
{
if (MediaUtils::hasAudio(filePath))
return new BubbleVideoEntity(m_WorkingDir, std::move(filePath), direction);
// Try to create Audio entity.
- return createAudioEntity(std::move(filePath), std::move(fileName), direction);
+ return createVoiceEntity(std::move(filePath), std::move(fileName), direction);
}
BubbleEntity *BubbleEntityFactory::createTextEntityFromFile(std::string filePath, Message::Direction direction)
, m_WorkingDir(workingDir)
{
static const std::string thumbFileName = "thumbnail.jpeg";
- m_ImgPath = m_WorkingDir->genUniqueFilePath(thumbFileName);
+ m_ImgPath = m_WorkingDir->genUniqueFilePath(thumbFileName);
if (!m_ImgPath.empty())
MediaUtils::getVideoFrame(getFilePath(), m_ImgPath);
}
BubbleVideoViewItem *BubbleVideoEntity::createView(Evas_Object *parent)
{
- auto *item = new BubbleVideoViewItem(*this, parent, getFilePath());
+ auto *item = new BubbleVideoViewItem(*this, parent, m_ImgPath);
return item;
}