};
/**
+ * @brief Designates Contacts API model object types and their adapters.
+ */
+ enum ObjectType
+ {
+ ObjectTypePerson, /**< _contacts_person record */
+ ObjectTypeContact, /**< _contacts_contact record */
+ ObjectTypeMyProfile, /**< _contacts_my_profile record */
+ ObjectTypeImage, /**< _contacts_image record */
+ ObjectTypeName, /**< _contacts_name record (partial) */
+ ObjectTypeNumber, /**< _contacts_number record */
+ ObjectTypeEmail, /**< _contacts_email record */
+ ObjectTypeNote, /**< _contacts_note record */
+ ObjectTypeAddress, /**< _contacts_address record */
+ ObjectTypeEvent, /**< _contacts_event record */
+ ObjectTypeRelationship, /**< _contacts_relationship record */
+ ObjectTypeUrl, /**< _contacts_url record */
+ ObjectTypeMessenger, /**< _contacts_messenger record */
+ ObjectTypeNickname, /**< _contacts_nickname record */
+ ObjectTypeCompany, /**< _contacts_company record */
+ ObjectTypePhoneticName, /**< _contacts_name record (partial) */
+ ObjectTypeRingtone, /**< _contacts_contact.ringtone_path adapter */
+ ObjectTypeGroups, /**< _contacts_contact.group_relation adapter */
+ ObjectTypeGroupRel /**< _contacts_group_relation record */
+ };
+
+ /**
* @brief Designates Contacts API model enumeration types.
*/
enum EnumType
{
- EnumNumberType, /**< contacts_number_type_e */
- EnumEmailType, /**< contacts_email_type_e */
- EnumAddressType, /**< contacts_address_type_e */
- EnumEventType, /**< contacts_event_type_e */
- EnumRelationshipType, /**< contacts_relationship_type_e */
- EnumUrlType, /**< contacts_url_type_e */
- EnumMessengerType, /**< contacts_messenger_type_e */
- EnumLogType /**< contacts_phone_log_type_e */
+ EnumNumberType, /**< contacts_number_type_e */
+ EnumEmailType, /**< contacts_email_type_e */
+ EnumAddressType, /**< contacts_address_type_e */
+ EnumEventType, /**< contacts_event_type_e */
+ EnumRelationshipType, /**< contacts_relationship_type_e */
+ EnumUrlType, /**< contacts_url_type_e */
+ EnumMessengerType, /**< contacts_messenger_type_e */
+ EnumLogType /**< contacts_phone_log_type_e */
};
/**
#ifndef CONTACTS_COMMON_CONTACT_SELECT_TYPES_H
#define CONTACTS_COMMON_CONTACT_SELECT_TYPES_H
+#include "Common/DataTypes.h"
#include "Ux/SelectTypes.h"
-#include "Contacts/Model/ContactTypes.h"
namespace Contacts
{
enum FilterType
{
FilterNone = -1, /**< All items are displayed */
- FilterNumber = 1 << Model::ObjectTypeNumber, /**< Only items with number */
- FilterEmail = 1 << Model::ObjectTypeEmail /**< Only items with email */
+ FilterNumber = 1 << Common::ObjectTypeNumber, /**< Only items with number */
+ FilterEmail = 1 << Common::ObjectTypeEmail /**< Only items with email */
};
/**
*/
enum ResultType
{
- ResultMyProfile = Model::ObjectTypeMyProfile, /**< My Profile ID is the result */
- ResultPerson = Model::ObjectTypeContact, /**< Person ID is the result */
- ResultNumber = Model::ObjectTypeNumber, /**< Number ID is the result */
- ResultEmail = Model::ObjectTypeEmail, /**< Email ID is the result */
+ ResultMyProfile = Common::ObjectTypeMyProfile, /**< My Profile ID is the result */
+ ResultPerson = Common::ObjectTypeContact, /**< Person ID is the result */
+ ResultNumber = Common::ObjectTypeNumber, /**< Number ID is the result */
+ ResultEmail = Common::ObjectTypeEmail, /**< Email ID is the result */
ResultVcard, /**< vCard file path is the result */
ResultAction /**< @ref ActionType is the result*/
};
*/
enum Type
{
- TypeContact = Model::ObjectTypeContact,
- TypeMyProfile = Model::ObjectTypeMyProfile
+ TypeContact = Common::ObjectTypeContact,
+ TypeMyProfile = Common::ObjectTypeMyProfile
};
/**
void formatTypedObject(std::string &text, Contacts::Model::ContactObject &object);
int m_PersonId;
- Contacts::Model::ContactObjectType m_Type;
+ Common::ObjectType m_Type;
};
}
}
*/
enum Type
{
- TypeContact = Model::ObjectTypeContact,
- TypeMyProfile = Model::ObjectTypeMyProfile
+ TypeContact = Common::ObjectTypeContact,
+ TypeMyProfile = Common::ObjectTypeMyProfile
};
/**
* @brief Create contact object.
* @param[in] type Contact object type (ObjectTypeContact or ObjectTypeMyProfile)
*/
- Contact(ContactObjectType type);
+ Contact(Common::ObjectType type);
Contact(const Contact &that) = delete;
virtual ~Contact() override;
* @param[in] type Contact object type (ObjectTypeContact or ObjectTypeMyProfile)
* @return Contact root object metadata.
*/
- const ContactFieldMetadata *getContactMetadata(ContactObjectType type);
+ const ContactFieldMetadata *getContactMetadata(Common::ObjectType type);
}
}
#ifndef CONTACTS_MODEL_CONTACT_TYPES_H
#define CONTACTS_MODEL_CONTACT_TYPES_H
+#include "Common/DataTypes.h"
+
namespace Contacts
{
namespace Model
};
/**
- * @brief Subtype for field of TypeObject type
- */
- enum ContactObjectType
- {
- ObjectTypeContact,
- ObjectTypeMyProfile,
- ObjectTypeImage,
- ObjectTypeName,
- ObjectTypeNumber,
- ObjectTypeEmail,
- ObjectTypeNote,
- ObjectTypeAddress,
- ObjectTypeEvent,
- ObjectTypeRelationship,
- ObjectTypeUrl,
- ObjectTypeMessenger,
- ObjectTypeNickname,
- ObjectTypeCompany,
- ObjectTypePhoneticName,
- ObjectTypeRingtone,
- ObjectTypeGroups,
- ObjectTypeGroupRel
- };
-
- /**
* @brief Subtype for field of TypeText type
*/
enum ContactTextType
#define TITLE_SIZE 32
+using namespace Common;
using namespace Contacts::Details;
using namespace Contacts::Model;
using namespace std::placeholders;
}
DetailsView::DetailsView(int recordId, Type type)
- : m_RecordId(recordId), m_Contact(ContactObjectType(type)),
+ : m_RecordId(recordId), m_Contact(ObjectType(type)),
m_Genlist(nullptr), m_BasicInfoItem(nullptr), m_Items{nullptr}
{
}
#include "AppsCommonButtons.h"
#include "InputPath.h"
-using namespace Contacts;
+using namespace Common;
using namespace Contacts::Input;
using namespace Contacts::Model;
using namespace std::placeholders;
}
InputView::InputView(int recordId, Type type)
- : m_Contact(ContactObjectType(type)),
+ : m_Contact(ObjectType(type)),
m_DoneButton(nullptr), m_Genlist(nullptr),
m_Items{nullptr}, m_AddFieldsItem(nullptr)
{
#include "Utils/Callback.h"
#include "Utils/Logger.h"
+using namespace Common;
using namespace Contacts::Model;
-Contact::Contact(ContactObjectType type)
+Contact::Contact(ObjectType type)
: ContactObject(nullptr, *getContactMetadata(type)),
m_IsNew(true), m_DbVersion(0)
{
#include "Contacts/Model/ContactName.h"
#include "Contacts/Model/ContactPhoneticName.h"
+using namespace Common;
using namespace Contacts::Model;
ContactFieldPtr ContactFieldFactory::createField(ContactFieldContainer *parent,
} /* Anonymous namespace */
-const ContactFieldMetadata *Model::getContactMetadata(ContactObjectType type)
+const ContactFieldMetadata *Model::getContactMetadata(ObjectType type)
{
if (type == ObjectTypeContact) {
return &contact;