m_isDefault(false)
{
m_types = ContactPhoneNumberTypeArrayPtr(new ContactPhoneNumberTypeArray());
+ is_typesSetJSArray = false;
+ m_context = NULL;
+ m_typesJsValue = NULL;
+ m_typesObj = NULL;
}
ContactPhoneNumber::~ContactPhoneNumber()
{
+ if(IsTypesSetJSArray()){
+ JSContextRef contextRef = getContext();
+ JSObjectRef tempJSObject = getTypesJSObj();
+ JSValueUnprotect(contextRef, tempJSObject);
+ }
}
std::string ContactPhoneNumber::getNumber() const
return result;
}
+void ContactPhoneNumber::setTypesJSArray(bool value, JSObjectRef initValue)
+{
+ is_typesSetJSArray = value;
+ m_typesObj = initValue;
+}
+
+JSObjectRef ContactPhoneNumber::getTypesJSObj()
+{
+ return m_typesObj;
+}
+
+JSValueRef ContactPhoneNumber::getTypesJSArray()
+{
+ return m_typesJsValue;
+}
+
+bool ContactPhoneNumber::IsTypesSetJSArray() const
+{
+ return is_typesSetJSArray;
+}
+
+void ContactPhoneNumber::setContext(JSContextRef contextRef)
+{
+ if(m_context == NULL)
+ m_context = contextRef;
+}
+
+JSContextRef ContactPhoneNumber::getContext()
+{
+ return m_context;
+}
+
} // Contact
} // DeviceAPI