diff --git a/source/android/adaptivecards/src/AdaptiveCardObjectModel.i b/source/android/adaptivecards/src/AdaptiveCardObjectModel.i index 33b53fcb69..ce1e95d92f 100644 --- a/source/android/adaptivecards/src/AdaptiveCardObjectModel.i +++ b/source/android/adaptivecards/src/AdaptiveCardObjectModel.i @@ -341,6 +341,8 @@ namespace Json { %template(ToggleVisibilityTargetVector) std::vector >; %template(StringVector) std::vector; %template(CharVector) std::vector; +%template(InlineVector) std::vector>; +%template(ParagraphVector) std::vector>; %template(EnableSharedFromThisContainer) std::enable_shared_from_this; @@ -659,6 +661,21 @@ namespace Json { } }; +%exception AdaptiveCards::TextRun::dynamic_cast(AdaptiveCards::Inline *inlineVar) { + $action + if (!result) { + jclass excep = jenv->FindClass("java/lang/ClassCastException"); + if (excep) { + jenv->ThrowNew(excep, "dynamic_cast exception"); + } + } +} +%extend AdaptiveCards::TextRun { + static AdaptiveCards::TextRun *dynamic_cast(AdaptiveCards::Inline *inlineVar) { + return dynamic_cast(inlineVar); + } +}; + %include "../../../shared/cpp/ObjectModel/pch.h" %include "../../../shared/cpp/ObjectModel/EnumMagic.h" %include "../../../shared/cpp/ObjectModel/Enums.h" diff --git a/source/android/adaptivecards/src/main/cpp/objectmodel_wrap.cpp b/source/android/adaptivecards/src/main/cpp/objectmodel_wrap.cpp index 226f81872e..7e996f8528 100644 --- a/source/android/adaptivecards/src/main/cpp/objectmodel_wrap.cpp +++ b/source/android/adaptivecards/src/main/cpp/objectmodel_wrap.cpp @@ -1611,6 +1611,124 @@ SWIGINTERN void std_vector_Sl_char_Sg__doRemoveRange(std::vector< char > *self,j throw std::out_of_range("vector index out of range"); } } +SWIGINTERN std::vector< std::shared_ptr< AdaptiveCards::Inline > > *new_std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg___SWIG_2(jint count){ + if (count < 0) + throw std::out_of_range("vector count must be positive"); + return new std::vector< std::shared_ptr< AdaptiveCards::Inline > >(static_cast >::size_type>(count)); + } +SWIGINTERN std::vector< std::shared_ptr< AdaptiveCards::Inline > > *new_std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg___SWIG_3(jint count,std::shared_ptr< AdaptiveCards::Inline > const &value){ + if (count < 0) + throw std::out_of_range("vector count must be positive"); + return new std::vector< std::shared_ptr< AdaptiveCards::Inline > >(static_cast >::size_type>(count), value); + } +SWIGINTERN jint std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg__doSize(std::vector< std::shared_ptr< AdaptiveCards::Inline > > const *self){ + return SWIG_VectorSize(self->size()); + } +SWIGINTERN void std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg__doAdd__SWIG_0(std::vector< std::shared_ptr< AdaptiveCards::Inline > > *self,std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type const &value){ + self->push_back(value); + } +SWIGINTERN void std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg__doAdd__SWIG_1(std::vector< std::shared_ptr< AdaptiveCards::Inline > > *self,jint index,std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type const &value){ + jint size = static_cast(self->size()); + if (0 <= index && index <= size) { + self->insert(self->begin() + index, value); + } else { + throw std::out_of_range("vector index out of range"); + } + } +SWIGINTERN std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg__doRemove(std::vector< std::shared_ptr< AdaptiveCards::Inline > > *self,jint index){ + jint size = static_cast(self->size()); + if (0 <= index && index < size) { + std::shared_ptr< AdaptiveCards::Inline > const old_value = (*self)[index]; + self->erase(self->begin() + index); + return old_value; + } else { + throw std::out_of_range("vector index out of range"); + } + } +SWIGINTERN std::shared_ptr< AdaptiveCards::Inline > const &std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg__doGet(std::vector< std::shared_ptr< AdaptiveCards::Inline > > *self,jint index){ + jint size = static_cast(self->size()); + if (index >= 0 && index < size) + return (*self)[index]; + else + throw std::out_of_range("vector index out of range"); + } +SWIGINTERN std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg__doSet(std::vector< std::shared_ptr< AdaptiveCards::Inline > > *self,jint index,std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type const &value){ + jint size = static_cast(self->size()); + if (index >= 0 && index < size) { + std::shared_ptr< AdaptiveCards::Inline > const old_value = (*self)[index]; + (*self)[index] = value; + return old_value; + } + else + throw std::out_of_range("vector index out of range"); + } +SWIGINTERN void std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg__doRemoveRange(std::vector< std::shared_ptr< AdaptiveCards::Inline > > *self,jint fromIndex,jint toIndex){ + jint size = static_cast(self->size()); + if (0 <= fromIndex && fromIndex <= toIndex && toIndex <= size) { + self->erase(self->begin() + fromIndex, self->begin() + toIndex); + } else { + throw std::out_of_range("vector index out of range"); + } + } +SWIGINTERN std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *new_std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg___SWIG_2(jint count){ + if (count < 0) + throw std::out_of_range("vector count must be positive"); + return new std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >(static_cast >::size_type>(count)); + } +SWIGINTERN std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *new_std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg___SWIG_3(jint count,std::shared_ptr< AdaptiveCards::Paragraph > const &value){ + if (count < 0) + throw std::out_of_range("vector count must be positive"); + return new std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >(static_cast >::size_type>(count), value); + } +SWIGINTERN jint std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg__doSize(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > const *self){ + return SWIG_VectorSize(self->size()); + } +SWIGINTERN void std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg__doAdd__SWIG_0(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *self,std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type const &value){ + self->push_back(value); + } +SWIGINTERN void std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg__doAdd__SWIG_1(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *self,jint index,std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type const &value){ + jint size = static_cast(self->size()); + if (0 <= index && index <= size) { + self->insert(self->begin() + index, value); + } else { + throw std::out_of_range("vector index out of range"); + } + } +SWIGINTERN std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg__doRemove(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *self,jint index){ + jint size = static_cast(self->size()); + if (0 <= index && index < size) { + std::shared_ptr< AdaptiveCards::Paragraph > const old_value = (*self)[index]; + self->erase(self->begin() + index); + return old_value; + } else { + throw std::out_of_range("vector index out of range"); + } + } +SWIGINTERN std::shared_ptr< AdaptiveCards::Paragraph > const &std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg__doGet(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *self,jint index){ + jint size = static_cast(self->size()); + if (index >= 0 && index < size) + return (*self)[index]; + else + throw std::out_of_range("vector index out of range"); + } +SWIGINTERN std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg__doSet(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *self,jint index,std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type const &value){ + jint size = static_cast(self->size()); + if (index >= 0 && index < size) { + std::shared_ptr< AdaptiveCards::Paragraph > const old_value = (*self)[index]; + (*self)[index] = value; + return old_value; + } + else + throw std::out_of_range("vector index out of range"); + } +SWIGINTERN void std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg__doRemoveRange(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *self,jint fromIndex,jint toIndex){ + jint size = static_cast(self->size()); + if (0 <= fromIndex && fromIndex <= toIndex && toIndex <= size) { + self->erase(self->begin() + fromIndex, self->begin() + toIndex); + } else { + throw std::out_of_range("vector index out of range"); + } + } SWIGINTERN jobject AdaptiveCards_BaseCardElement_swigOriginalObject(AdaptiveCards::BaseCardElement *self,JNIEnv *jenv){ Swig::Director *dir = dynamic_cast(self); if (dir) { @@ -1688,6 +1806,9 @@ SWIGINTERN AdaptiveCards::ActionSet *AdaptiveCards_ActionSet_dynamic_cast(Adapti SWIGINTERN AdaptiveCards::RichTextBlock *AdaptiveCards_RichTextBlock_dynamic_cast(AdaptiveCards::BaseCardElement *baseCardElement){ return dynamic_cast(baseCardElement); } +SWIGINTERN AdaptiveCards::TextRun *AdaptiveCards_TextRun_dynamic_cast(AdaptiveCards::Inline *inlineVar){ + return dynamic_cast(inlineVar); + } /* --------------------------------------------------- @@ -6674,37 +6795,633 @@ SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectMod (void)jenv; (void)jcls; arg1 = jarg1; - if(!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - return 0; - } - const char *arg2_pstr = (const char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2_pstr) return 0; - std::string arg2_str(arg2_pstr); - arg2 = &arg2_str; - jenv->ReleaseStringUTFChars(jarg2, arg2_pstr); + if(!jarg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); + return 0; + } + const char *arg2_pstr = (const char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2_pstr) return 0; + std::string arg2_str(arg2_pstr); + arg2 = &arg2_str; + jenv->ReleaseStringUTFChars(jarg2, arg2_pstr); + try { + result = (std::vector< std::string > *)new_std_vector_Sl_std_string_Sg___SWIG_3(arg1,(std::string const &)*arg2); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return 0; + } + *(std::vector< std::string > **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_StringVector_1doSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jint jresult = 0 ; + std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; + jint result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< std::string > **)&jarg1; + try { + result = std_vector_Sl_std_string_Sg__doSize((std::vector< std::string > const *)arg1); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return 0; + } + jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_StringVector_1doAdd_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { + std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; + std::vector< std::string >::value_type *arg2 = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< std::string > **)&jarg1; + if(!jarg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); + return ; + } + const char *arg2_pstr = (const char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2_pstr) return ; + std::vector< std::string >::value_type arg2_str(arg2_pstr); + arg2 = &arg2_str; + jenv->ReleaseStringUTFChars(jarg2, arg2_pstr); + std_vector_Sl_std_string_Sg__doAdd__SWIG_0(arg1,(std::string const &)*arg2); +} + + +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_StringVector_1doAdd_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3) { + std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; + jint arg2 ; + std::vector< std::string >::value_type *arg3 = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< std::string > **)&jarg1; + arg2 = jarg2; + if(!jarg3) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); + return ; + } + const char *arg3_pstr = (const char *)jenv->GetStringUTFChars(jarg3, 0); + if (!arg3_pstr) return ; + std::vector< std::string >::value_type arg3_str(arg3_pstr); + arg3 = &arg3_str; + jenv->ReleaseStringUTFChars(jarg3, arg3_pstr); + try { + std_vector_Sl_std_string_Sg__doAdd__SWIG_1(arg1,arg2,(std::string const &)*arg3); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return ; + } +} + + +SWIGEXPORT jstring JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_StringVector_1doRemove(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + jstring jresult = 0 ; + std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; + jint arg2 ; + std::vector< std::string >::value_type result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< std::string > **)&jarg1; + arg2 = jarg2; + try { + result = std_vector_Sl_std_string_Sg__doRemove(arg1,arg2); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return 0; + } + jresult = jenv->NewStringUTF((&result)->c_str()); + return jresult; +} + + +SWIGEXPORT jstring JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_StringVector_1doGet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + jstring jresult = 0 ; + std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; + jint arg2 ; + std::string *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< std::string > **)&jarg1; + arg2 = jarg2; + try { + result = (std::string *) &std_vector_Sl_std_string_Sg__doGet(arg1,arg2); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return 0; + } + jresult = jenv->NewStringUTF(result->c_str()); + return jresult; +} + + +SWIGEXPORT jstring JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_StringVector_1doSet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3) { + jstring jresult = 0 ; + std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; + jint arg2 ; + std::vector< std::string >::value_type *arg3 = 0 ; + std::vector< std::string >::value_type result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< std::string > **)&jarg1; + arg2 = jarg2; + if(!jarg3) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); + return 0; + } + const char *arg3_pstr = (const char *)jenv->GetStringUTFChars(jarg3, 0); + if (!arg3_pstr) return 0; + std::vector< std::string >::value_type arg3_str(arg3_pstr); + arg3 = &arg3_str; + jenv->ReleaseStringUTFChars(jarg3, arg3_pstr); + try { + result = std_vector_Sl_std_string_Sg__doSet(arg1,arg2,(std::string const &)*arg3); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return 0; + } + jresult = jenv->NewStringUTF((&result)->c_str()); + return jresult; +} + + +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_StringVector_1doRemoveRange(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) { + std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; + jint arg2 ; + jint arg3 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< std::string > **)&jarg1; + arg2 = jarg2; + arg3 = jarg3; + try { + std_vector_Sl_std_string_Sg__doRemoveRange(arg1,arg2,arg3); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return ; + } +} + + +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_delete_1StringVector(JNIEnv *jenv, jclass jcls, jlong jarg1) { + std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(std::vector< std::string > **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1CharVector_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { + jlong jresult = 0 ; + std::vector< char > *result = 0 ; + + (void)jenv; + (void)jcls; + result = (std::vector< char > *)new std::vector< char >(); + *(std::vector< char > **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1CharVector_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + std::vector< char > *arg1 = 0 ; + std::vector< char > *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< char > **)&jarg1; + if (!arg1) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > const & reference is null"); + return 0; + } + result = (std::vector< char > *)new std::vector< char >((std::vector< char > const &)*arg1); + *(std::vector< char > **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1capacity(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + std::vector< char > *arg1 = (std::vector< char > *) 0 ; + std::vector< char >::size_type result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< char > **)&jarg1; + result = ((std::vector< char > const *)arg1)->capacity(); + jresult = (jlong)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1reserve(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { + std::vector< char > *arg1 = (std::vector< char > *) 0 ; + std::vector< char >::size_type arg2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< char > **)&jarg1; + arg2 = (std::vector< char >::size_type)jarg2; + try { + (arg1)->reserve(arg2); + } catch(std::length_error &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return ; + } +} + + +SWIGEXPORT jboolean JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1isEmpty(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jboolean jresult = 0 ; + std::vector< char > *arg1 = (std::vector< char > *) 0 ; + bool result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< char > **)&jarg1; + result = (bool)((std::vector< char > const *)arg1)->empty(); + jresult = (jboolean)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + std::vector< char > *arg1 = (std::vector< char > *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< char > **)&jarg1; + (arg1)->clear(); +} + + +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1CharVector_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jint jarg1) { + jlong jresult = 0 ; + jint arg1 ; + std::vector< char > *result = 0 ; + + (void)jenv; + (void)jcls; + arg1 = jarg1; + try { + result = (std::vector< char > *)new_std_vector_Sl_char_Sg___SWIG_2(arg1); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return 0; + } + *(std::vector< char > **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1CharVector_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jint jarg1, jchar jarg2) { + jlong jresult = 0 ; + jint arg1 ; + char *arg2 = 0 ; + char temp2 ; + std::vector< char > *result = 0 ; + + (void)jenv; + (void)jcls; + arg1 = jarg1; + temp2 = (char)jarg2; + arg2 = &temp2; + try { + result = (std::vector< char > *)new_std_vector_Sl_char_Sg___SWIG_3(arg1,(char const &)*arg2); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return 0; + } + *(std::vector< char > **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1doSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jint jresult = 0 ; + std::vector< char > *arg1 = (std::vector< char > *) 0 ; + jint result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< char > **)&jarg1; + try { + result = std_vector_Sl_char_Sg__doSize((std::vector< char > const *)arg1); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return 0; + } + jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1doAdd_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jchar jarg2) { + std::vector< char > *arg1 = (std::vector< char > *) 0 ; + std::vector< char >::value_type *arg2 = 0 ; + std::vector< char >::value_type temp2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< char > **)&jarg1; + temp2 = (std::vector< char >::value_type)jarg2; + arg2 = &temp2; + std_vector_Sl_char_Sg__doAdd__SWIG_0(arg1,(char const &)*arg2); +} + + +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1doAdd_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jchar jarg3) { + std::vector< char > *arg1 = (std::vector< char > *) 0 ; + jint arg2 ; + std::vector< char >::value_type *arg3 = 0 ; + std::vector< char >::value_type temp3 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< char > **)&jarg1; + arg2 = jarg2; + temp3 = (std::vector< char >::value_type)jarg3; + arg3 = &temp3; + try { + std_vector_Sl_char_Sg__doAdd__SWIG_1(arg1,arg2,(char const &)*arg3); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return ; + } +} + + +SWIGEXPORT jchar JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1doRemove(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + jchar jresult = 0 ; + std::vector< char > *arg1 = (std::vector< char > *) 0 ; + jint arg2 ; + std::vector< char >::value_type result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< char > **)&jarg1; + arg2 = jarg2; + try { + result = (std::vector< char >::value_type)std_vector_Sl_char_Sg__doRemove(arg1,arg2); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return 0; + } + jresult = (jchar)result; + return jresult; +} + + +SWIGEXPORT jchar JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1doGet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + jchar jresult = 0 ; + std::vector< char > *arg1 = (std::vector< char > *) 0 ; + jint arg2 ; + char *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< char > **)&jarg1; + arg2 = jarg2; + try { + result = (char *) &std_vector_Sl_char_Sg__doGet(arg1,arg2); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return 0; + } + jresult = (jchar)*result; + return jresult; +} + + +SWIGEXPORT jchar JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1doSet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jchar jarg3) { + jchar jresult = 0 ; + std::vector< char > *arg1 = (std::vector< char > *) 0 ; + jint arg2 ; + std::vector< char >::value_type *arg3 = 0 ; + std::vector< char >::value_type temp3 ; + std::vector< char >::value_type result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< char > **)&jarg1; + arg2 = jarg2; + temp3 = (std::vector< char >::value_type)jarg3; + arg3 = &temp3; + try { + result = (std::vector< char >::value_type)std_vector_Sl_char_Sg__doSet(arg1,arg2,(char const &)*arg3); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return 0; + } + jresult = (jchar)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1doRemoveRange(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) { + std::vector< char > *arg1 = (std::vector< char > *) 0 ; + jint arg2 ; + jint arg3 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< char > **)&jarg1; + arg2 = jarg2; + arg3 = jarg3; + try { + std_vector_Sl_char_Sg__doRemoveRange(arg1,arg2,arg3); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return ; + } +} + + +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_delete_1CharVector(JNIEnv *jenv, jclass jcls, jlong jarg1) { + std::vector< char > *arg1 = (std::vector< char > *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(std::vector< char > **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1InlineVector_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { + jlong jresult = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *result = 0 ; + + (void)jenv; + (void)jcls; + result = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *)new std::vector< std::shared_ptr< AdaptiveCards::Inline > >(); + *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1InlineVector_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *arg1 = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jarg1; + if (!arg1) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< std::shared_ptr< AdaptiveCards::Inline > > const & reference is null"); + return 0; + } + result = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *)new std::vector< std::shared_ptr< AdaptiveCards::Inline > >((std::vector< std::shared_ptr< AdaptiveCards::Inline > > const &)*arg1); + *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_InlineVector_1capacity(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *) 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > >::size_type result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jarg1; + result = ((std::vector< std::shared_ptr< AdaptiveCards::Inline > > const *)arg1)->capacity(); + jresult = (jlong)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_InlineVector_1reserve(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *) 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > >::size_type arg2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jarg1; + arg2 = (std::vector< std::shared_ptr< AdaptiveCards::Inline > >::size_type)jarg2; + try { + (arg1)->reserve(arg2); + } catch(std::length_error &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return ; + } +} + + +SWIGEXPORT jboolean JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_InlineVector_1isEmpty(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jboolean jresult = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *) 0 ; + bool result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jarg1; + result = (bool)((std::vector< std::shared_ptr< AdaptiveCards::Inline > > const *)arg1)->empty(); + jresult = (jboolean)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_InlineVector_1clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jarg1; + (arg1)->clear(); +} + + +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1InlineVector_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jint jarg1) { + jlong jresult = 0 ; + jint arg1 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *result = 0 ; + + (void)jenv; + (void)jcls; + arg1 = jarg1; + try { + result = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *)new_std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg___SWIG_2(arg1); + } catch(std::out_of_range &_e) { + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); + return 0; + } + *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1InlineVector_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2, jobject jarg2_) { + jlong jresult = 0 ; + jint arg1 ; + std::shared_ptr< AdaptiveCards::Inline > *arg2 = 0 ; + std::shared_ptr< AdaptiveCards::Inline > tempnull2 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg2_; + arg1 = jarg1; + arg2 = jarg2 ? *(std::shared_ptr< AdaptiveCards::Inline > **)&jarg2 : &tempnull2; try { - result = (std::vector< std::string > *)new_std_vector_Sl_std_string_Sg___SWIG_3(arg1,(std::string const &)*arg2); + result = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *)new_std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg___SWIG_3(arg1,(std::shared_ptr< AdaptiveCards::Inline > const &)*arg2); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return 0; } - *(std::vector< std::string > **)&jresult = result; + *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jresult = result; return jresult; } -SWIGEXPORT jint JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_StringVector_1doSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { +SWIGEXPORT jint JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_InlineVector_1doSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; - std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *) 0 ; jint result; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< std::string > **)&jarg1; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jarg1; try { - result = std_vector_Sl_std_string_Sg__doSize((std::vector< std::string > const *)arg1); + result = std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg__doSize((std::vector< std::shared_ptr< AdaptiveCards::Inline > > const *)arg1); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return 0; @@ -6714,48 +7431,36 @@ SWIGEXPORT jint JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectMode } -SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_StringVector_1doAdd_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; - std::vector< std::string >::value_type *arg2 = 0 ; +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_InlineVector_1doAdd_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *) 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type *arg2 = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type tempnull2 ; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< std::string > **)&jarg1; - if(!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - return ; - } - const char *arg2_pstr = (const char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2_pstr) return ; - std::vector< std::string >::value_type arg2_str(arg2_pstr); - arg2 = &arg2_str; - jenv->ReleaseStringUTFChars(jarg2, arg2_pstr); - std_vector_Sl_std_string_Sg__doAdd__SWIG_0(arg1,(std::string const &)*arg2); + (void)jarg2_; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jarg1; + arg2 = jarg2 ? *(std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type **)&jarg2 : &tempnull2; + std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg__doAdd__SWIG_0(arg1,(std::shared_ptr< AdaptiveCards::Inline > const &)*arg2); } -SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_StringVector_1doAdd_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3) { - std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_InlineVector_1doAdd_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jlong jarg3, jobject jarg3_) { + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *) 0 ; jint arg2 ; - std::vector< std::string >::value_type *arg3 = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type *arg3 = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type tempnull3 ; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< std::string > **)&jarg1; + (void)jarg3_; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jarg1; arg2 = jarg2; - if(!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - return ; - } - const char *arg3_pstr = (const char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3_pstr) return ; - std::vector< std::string >::value_type arg3_str(arg3_pstr); - arg3 = &arg3_str; - jenv->ReleaseStringUTFChars(jarg3, arg3_pstr); + arg3 = jarg3 ? *(std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type **)&jarg3 : &tempnull3; try { - std_vector_Sl_std_string_Sg__doAdd__SWIG_1(arg1,arg2,(std::string const &)*arg3); + std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg__doAdd__SWIG_1(arg1,arg2,(std::shared_ptr< AdaptiveCards::Inline > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return ; @@ -6763,95 +7468,89 @@ SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectMode } -SWIGEXPORT jstring JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_StringVector_1doRemove(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jstring jresult = 0 ; - std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_InlineVector_1doRemove(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + jlong jresult = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *) 0 ; jint arg2 ; - std::vector< std::string >::value_type result; + std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type result; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< std::string > **)&jarg1; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jarg1; arg2 = jarg2; try { - result = std_vector_Sl_std_string_Sg__doRemove(arg1,arg2); + result = std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg__doRemove(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return 0; } - jresult = jenv->NewStringUTF((&result)->c_str()); + *(std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type **)&jresult = result ? new std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type(result) : 0; return jresult; } -SWIGEXPORT jstring JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_StringVector_1doGet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jstring jresult = 0 ; - std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_InlineVector_1doGet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + jlong jresult = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *) 0 ; jint arg2 ; - std::string *result = 0 ; + std::shared_ptr< AdaptiveCards::Inline > *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< std::string > **)&jarg1; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jarg1; arg2 = jarg2; try { - result = (std::string *) &std_vector_Sl_std_string_Sg__doGet(arg1,arg2); + result = (std::shared_ptr< AdaptiveCards::Inline > *) &std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg__doGet(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return 0; } - jresult = jenv->NewStringUTF(result->c_str()); + *(std::shared_ptr< AdaptiveCards::Inline > **)&jresult = *result ? new std::shared_ptr< AdaptiveCards::Inline >(*result) : 0; return jresult; } -SWIGEXPORT jstring JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_StringVector_1doSet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3) { - jstring jresult = 0 ; - std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_InlineVector_1doSet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jlong jarg3, jobject jarg3_) { + jlong jresult = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *) 0 ; jint arg2 ; - std::vector< std::string >::value_type *arg3 = 0 ; - std::vector< std::string >::value_type result; + std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type *arg3 = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type tempnull3 ; + std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type result; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< std::string > **)&jarg1; + (void)jarg3_; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jarg1; arg2 = jarg2; - if(!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - return 0; - } - const char *arg3_pstr = (const char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3_pstr) return 0; - std::vector< std::string >::value_type arg3_str(arg3_pstr); - arg3 = &arg3_str; - jenv->ReleaseStringUTFChars(jarg3, arg3_pstr); + arg3 = jarg3 ? *(std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type **)&jarg3 : &tempnull3; try { - result = std_vector_Sl_std_string_Sg__doSet(arg1,arg2,(std::string const &)*arg3); + result = std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg__doSet(arg1,arg2,(std::shared_ptr< AdaptiveCards::Inline > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return 0; } - jresult = jenv->NewStringUTF((&result)->c_str()); + *(std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type **)&jresult = result ? new std::vector< std::shared_ptr< AdaptiveCards::Inline > >::value_type(result) : 0; return jresult; } -SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_StringVector_1doRemoveRange(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) { - std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_InlineVector_1doRemoveRange(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) { + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *) 0 ; jint arg2 ; jint arg3 ; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< std::string > **)&jarg1; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jarg1; arg2 = jarg2; arg3 = jarg3; try { - std_vector_Sl_std_string_Sg__doRemoveRange(arg1,arg2,arg3); + std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Inline_Sg__Sg__doRemoveRange(arg1,arg2,arg3); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return ; @@ -6859,71 +7558,71 @@ SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectMode } -SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_delete_1StringVector(JNIEnv *jenv, jclass jcls, jlong jarg1) { - std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_delete_1InlineVector(JNIEnv *jenv, jclass jcls, jlong jarg1) { + std::vector< std::shared_ptr< AdaptiveCards::Inline > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Inline > > *) 0 ; (void)jenv; (void)jcls; - arg1 = *(std::vector< std::string > **)&jarg1; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Inline > > **)&jarg1; delete arg1; } -SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1CharVector_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1ParagraphVector_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; - std::vector< char > *result = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *result = 0 ; (void)jenv; (void)jcls; - result = (std::vector< char > *)new std::vector< char >(); - *(std::vector< char > **)&jresult = result; + result = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *)new std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >(); + *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jresult = result; return jresult; } -SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1CharVector_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1ParagraphVector_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; - std::vector< char > *arg1 = 0 ; - std::vector< char > *result = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *arg1 = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< char > **)&jarg1; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jarg1; if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > const & reference is null"); + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > const & reference is null"); return 0; } - result = (std::vector< char > *)new std::vector< char >((std::vector< char > const &)*arg1); - *(std::vector< char > **)&jresult = result; + result = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *)new std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >((std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > const &)*arg1); + *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jresult = result; return jresult; } -SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1capacity(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_ParagraphVector_1capacity(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - std::vector< char >::size_type result; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *) 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::size_type result; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< char > **)&jarg1; - result = ((std::vector< char > const *)arg1)->capacity(); + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jarg1; + result = ((std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > const *)arg1)->capacity(); jresult = (jlong)result; return jresult; } -SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1reserve(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - std::vector< char >::size_type arg2 ; +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_ParagraphVector_1reserve(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *) 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::size_type arg2 ; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< char > **)&jarg1; - arg2 = (std::vector< char >::size_type)jarg2; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jarg1; + arg2 = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::size_type)jarg2; try { (arg1)->reserve(arg2); } catch(std::length_error &_e) { @@ -6933,85 +7632,85 @@ SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectMode } -SWIGEXPORT jboolean JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1isEmpty(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { +SWIGEXPORT jboolean JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_ParagraphVector_1isEmpty(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jboolean jresult = 0 ; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *) 0 ; bool result; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< char > **)&jarg1; - result = (bool)((std::vector< char > const *)arg1)->empty(); + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jarg1; + result = (bool)((std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > const *)arg1)->empty(); jresult = (jboolean)result; return jresult; } -SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - std::vector< char > *arg1 = (std::vector< char > *) 0 ; +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_ParagraphVector_1clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *) 0 ; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< char > **)&jarg1; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jarg1; (arg1)->clear(); } -SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1CharVector_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jint jarg1) { +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1ParagraphVector_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jint jarg1) { jlong jresult = 0 ; jint arg1 ; - std::vector< char > *result = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *result = 0 ; (void)jenv; (void)jcls; arg1 = jarg1; try { - result = (std::vector< char > *)new_std_vector_Sl_char_Sg___SWIG_2(arg1); + result = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *)new_std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg___SWIG_2(arg1); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return 0; } - *(std::vector< char > **)&jresult = result; + *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jresult = result; return jresult; } -SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1CharVector_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jint jarg1, jchar jarg2) { +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_new_1ParagraphVector_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2, jobject jarg2_) { jlong jresult = 0 ; jint arg1 ; - char *arg2 = 0 ; - char temp2 ; - std::vector< char > *result = 0 ; + std::shared_ptr< AdaptiveCards::Paragraph > *arg2 = 0 ; + std::shared_ptr< AdaptiveCards::Paragraph > tempnull2 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *result = 0 ; (void)jenv; (void)jcls; + (void)jarg2_; arg1 = jarg1; - temp2 = (char)jarg2; - arg2 = &temp2; + arg2 = jarg2 ? *(std::shared_ptr< AdaptiveCards::Paragraph > **)&jarg2 : &tempnull2; try { - result = (std::vector< char > *)new_std_vector_Sl_char_Sg___SWIG_3(arg1,(char const &)*arg2); + result = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *)new_std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg___SWIG_3(arg1,(std::shared_ptr< AdaptiveCards::Paragraph > const &)*arg2); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return 0; } - *(std::vector< char > **)&jresult = result; + *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jresult = result; return jresult; } -SWIGEXPORT jint JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1doSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { +SWIGEXPORT jint JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_ParagraphVector_1doSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *) 0 ; jint result; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< char > **)&jarg1; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jarg1; try { - result = std_vector_Sl_char_Sg__doSize((std::vector< char > const *)arg1); + result = std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg__doSize((std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > const *)arg1); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return 0; @@ -7021,36 +7720,36 @@ SWIGEXPORT jint JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectMode } -SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1doAdd_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jchar jarg2) { - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - std::vector< char >::value_type *arg2 = 0 ; - std::vector< char >::value_type temp2 ; +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_ParagraphVector_1doAdd_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *) 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type *arg2 = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type tempnull2 ; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< char > **)&jarg1; - temp2 = (std::vector< char >::value_type)jarg2; - arg2 = &temp2; - std_vector_Sl_char_Sg__doAdd__SWIG_0(arg1,(char const &)*arg2); + (void)jarg2_; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jarg1; + arg2 = jarg2 ? *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type **)&jarg2 : &tempnull2; + std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg__doAdd__SWIG_0(arg1,(std::shared_ptr< AdaptiveCards::Paragraph > const &)*arg2); } -SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1doAdd_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jchar jarg3) { - std::vector< char > *arg1 = (std::vector< char > *) 0 ; +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_ParagraphVector_1doAdd_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jlong jarg3, jobject jarg3_) { + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *) 0 ; jint arg2 ; - std::vector< char >::value_type *arg3 = 0 ; - std::vector< char >::value_type temp3 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type *arg3 = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type tempnull3 ; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< char > **)&jarg1; + (void)jarg3_; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jarg1; arg2 = jarg2; - temp3 = (std::vector< char >::value_type)jarg3; - arg3 = &temp3; + arg3 = jarg3 ? *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type **)&jarg3 : &tempnull3; try { - std_vector_Sl_char_Sg__doAdd__SWIG_1(arg1,arg2,(char const &)*arg3); + std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg__doAdd__SWIG_1(arg1,arg2,(std::shared_ptr< AdaptiveCards::Paragraph > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return ; @@ -7058,89 +7757,89 @@ SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectMode } -SWIGEXPORT jchar JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1doRemove(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jchar jresult = 0 ; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_ParagraphVector_1doRemove(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + jlong jresult = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *) 0 ; jint arg2 ; - std::vector< char >::value_type result; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type result; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< char > **)&jarg1; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jarg1; arg2 = jarg2; try { - result = (std::vector< char >::value_type)std_vector_Sl_char_Sg__doRemove(arg1,arg2); + result = std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg__doRemove(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return 0; } - jresult = (jchar)result; + *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type **)&jresult = result ? new std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type(result) : 0; return jresult; } -SWIGEXPORT jchar JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1doGet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jchar jresult = 0 ; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_ParagraphVector_1doGet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + jlong jresult = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *) 0 ; jint arg2 ; - char *result = 0 ; + std::shared_ptr< AdaptiveCards::Paragraph > *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< char > **)&jarg1; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jarg1; arg2 = jarg2; try { - result = (char *) &std_vector_Sl_char_Sg__doGet(arg1,arg2); + result = (std::shared_ptr< AdaptiveCards::Paragraph > *) &std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg__doGet(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return 0; } - jresult = (jchar)*result; + *(std::shared_ptr< AdaptiveCards::Paragraph > **)&jresult = *result ? new std::shared_ptr< AdaptiveCards::Paragraph >(*result) : 0; return jresult; } -SWIGEXPORT jchar JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1doSet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jchar jarg3) { - jchar jresult = 0 ; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_ParagraphVector_1doSet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jlong jarg3, jobject jarg3_) { + jlong jresult = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *) 0 ; jint arg2 ; - std::vector< char >::value_type *arg3 = 0 ; - std::vector< char >::value_type temp3 ; - std::vector< char >::value_type result; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type *arg3 = 0 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type tempnull3 ; + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type result; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< char > **)&jarg1; + (void)jarg3_; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jarg1; arg2 = jarg2; - temp3 = (std::vector< char >::value_type)jarg3; - arg3 = &temp3; + arg3 = jarg3 ? *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type **)&jarg3 : &tempnull3; try { - result = (std::vector< char >::value_type)std_vector_Sl_char_Sg__doSet(arg1,arg2,(char const &)*arg3); + result = std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg__doSet(arg1,arg2,(std::shared_ptr< AdaptiveCards::Paragraph > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return 0; } - jresult = (jchar)result; + *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type **)&jresult = result ? new std::vector< std::shared_ptr< AdaptiveCards::Paragraph > >::value_type(result) : 0; return jresult; } -SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_CharVector_1doRemoveRange(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) { - std::vector< char > *arg1 = (std::vector< char > *) 0 ; +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_ParagraphVector_1doRemoveRange(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) { + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *) 0 ; jint arg2 ; jint arg3 ; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< char > **)&jarg1; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jarg1; arg2 = jarg2; arg3 = jarg3; try { - std_vector_Sl_char_Sg__doRemoveRange(arg1,arg2,arg3); + std_vector_Sl_std_shared_ptr_Sl_AdaptiveCards_Paragraph_Sg__Sg__doRemoveRange(arg1,arg2,arg3); } catch(std::out_of_range &_e) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, (&_e)->what()); return ; @@ -7148,12 +7847,12 @@ SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectMode } -SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_delete_1CharVector(JNIEnv *jenv, jclass jcls, jlong jarg1) { - std::vector< char > *arg1 = (std::vector< char > *) 0 ; +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_delete_1ParagraphVector(JNIEnv *jenv, jclass jcls, jlong jarg1) { + std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *arg1 = (std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > *) 0 ; (void)jenv; (void)jcls; - arg1 = *(std::vector< char > **)&jarg1; + arg1 = *(std::vector< std::shared_ptr< AdaptiveCards::Paragraph > > **)&jarg1; delete arg1; } @@ -26447,6 +27146,71 @@ SWIGEXPORT jstring JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectM } +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_TextRun_1GetSelectAction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + AdaptiveCards::TextRun *arg1 = (AdaptiveCards::TextRun *) 0 ; + std::shared_ptr< AdaptiveCards::TextRun const > *smartarg1 = 0 ; + std::shared_ptr< AdaptiveCards::BaseActionElement > result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< const AdaptiveCards::TextRun > **)&jarg1; + arg1 = (AdaptiveCards::TextRun *)(smartarg1 ? smartarg1->get() : 0); + result = ((AdaptiveCards::TextRun const *)arg1)->GetSelectAction(); + *(std::shared_ptr< AdaptiveCards::BaseActionElement > **)&jresult = result ? new std::shared_ptr< AdaptiveCards::BaseActionElement >(result) : 0; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_TextRun_1SetSelectAction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + AdaptiveCards::TextRun *arg1 = (AdaptiveCards::TextRun *) 0 ; + std::shared_ptr< AdaptiveCards::BaseActionElement > arg2 ; + std::shared_ptr< AdaptiveCards::TextRun > *smartarg1 = 0 ; + std::shared_ptr< AdaptiveCards::BaseActionElement > const *argp2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + + smartarg1 = *(std::shared_ptr< AdaptiveCards::TextRun > **)&jarg1; + arg1 = (AdaptiveCards::TextRun *)(smartarg1 ? smartarg1->get() : 0); + argp2 = *(std::shared_ptr< AdaptiveCards::BaseActionElement > **)&jarg2; + if (argp2) arg2 = *argp2; + (arg1)->SetSelectAction(arg2); +} + + +SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_TextRun_1dynamic_1cast(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + AdaptiveCards::Inline *arg1 = (AdaptiveCards::Inline *) 0 ; + std::shared_ptr< AdaptiveCards::Inline > *smartarg1 = 0 ; + AdaptiveCards::TextRun *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< AdaptiveCards::Inline > **)&jarg1; + arg1 = (AdaptiveCards::Inline *)(smartarg1 ? smartarg1->get() : 0); + { + result = (AdaptiveCards::TextRun *)AdaptiveCards_TextRun_dynamic_cast(arg1); + if (!result) { + jclass excep = jenv->FindClass("java/lang/ClassCastException"); + if (excep) { + jenv->ThrowNew(excep, "dynamic_cast exception"); + } + } + } + + *(std::shared_ptr< AdaptiveCards::TextRun > **)&jresult = result ? new std::shared_ptr< AdaptiveCards::TextRun >(result SWIG_NO_NULL_DELETER_0) : 0; + + return jresult; +} + + SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_BaseCardElement_1SWIGSmartPtrUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) { jlong baseptr = 0; std::shared_ptr< AdaptiveCards::BaseCardElement > *argp1; diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/AdaptiveCardObjectModelJNI.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/AdaptiveCardObjectModelJNI.java index e0292fd5a6..37b3def6b1 100644 --- a/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/AdaptiveCardObjectModelJNI.java +++ b/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/AdaptiveCardObjectModelJNI.java @@ -250,6 +250,38 @@ public class AdaptiveCardObjectModelJNI { public final static native char CharVector_doSet(long jarg1, CharVector jarg1_, int jarg2, char jarg3); public final static native void CharVector_doRemoveRange(long jarg1, CharVector jarg1_, int jarg2, int jarg3); public final static native void delete_CharVector(long jarg1); + public final static native long new_InlineVector__SWIG_0(); + public final static native long new_InlineVector__SWIG_1(long jarg1, InlineVector jarg1_); + public final static native long InlineVector_capacity(long jarg1, InlineVector jarg1_); + public final static native void InlineVector_reserve(long jarg1, InlineVector jarg1_, long jarg2); + public final static native boolean InlineVector_isEmpty(long jarg1, InlineVector jarg1_); + public final static native void InlineVector_clear(long jarg1, InlineVector jarg1_); + public final static native long new_InlineVector__SWIG_2(int jarg1); + public final static native long new_InlineVector__SWIG_3(int jarg1, long jarg2, Inline jarg2_); + public final static native int InlineVector_doSize(long jarg1, InlineVector jarg1_); + public final static native void InlineVector_doAdd__SWIG_0(long jarg1, InlineVector jarg1_, long jarg2, Inline jarg2_); + public final static native void InlineVector_doAdd__SWIG_1(long jarg1, InlineVector jarg1_, int jarg2, long jarg3, Inline jarg3_); + public final static native long InlineVector_doRemove(long jarg1, InlineVector jarg1_, int jarg2); + public final static native long InlineVector_doGet(long jarg1, InlineVector jarg1_, int jarg2); + public final static native long InlineVector_doSet(long jarg1, InlineVector jarg1_, int jarg2, long jarg3, Inline jarg3_); + public final static native void InlineVector_doRemoveRange(long jarg1, InlineVector jarg1_, int jarg2, int jarg3); + public final static native void delete_InlineVector(long jarg1); + public final static native long new_ParagraphVector__SWIG_0(); + public final static native long new_ParagraphVector__SWIG_1(long jarg1, ParagraphVector jarg1_); + public final static native long ParagraphVector_capacity(long jarg1, ParagraphVector jarg1_); + public final static native void ParagraphVector_reserve(long jarg1, ParagraphVector jarg1_, long jarg2); + public final static native boolean ParagraphVector_isEmpty(long jarg1, ParagraphVector jarg1_); + public final static native void ParagraphVector_clear(long jarg1, ParagraphVector jarg1_); + public final static native long new_ParagraphVector__SWIG_2(int jarg1); + public final static native long new_ParagraphVector__SWIG_3(int jarg1, long jarg2, Paragraph jarg2_); + public final static native int ParagraphVector_doSize(long jarg1, ParagraphVector jarg1_); + public final static native void ParagraphVector_doAdd__SWIG_0(long jarg1, ParagraphVector jarg1_, long jarg2, Paragraph jarg2_); + public final static native void ParagraphVector_doAdd__SWIG_1(long jarg1, ParagraphVector jarg1_, int jarg2, long jarg3, Paragraph jarg3_); + public final static native long ParagraphVector_doRemove(long jarg1, ParagraphVector jarg1_, int jarg2); + public final static native long ParagraphVector_doGet(long jarg1, ParagraphVector jarg1_, int jarg2); + public final static native long ParagraphVector_doSet(long jarg1, ParagraphVector jarg1_, int jarg2, long jarg3, Paragraph jarg3_); + public final static native void ParagraphVector_doRemoveRange(long jarg1, ParagraphVector jarg1_, int jarg2, int jarg3); + public final static native void delete_ParagraphVector(long jarg1); public final static native long EnableSharedFromThisContainer_shared_from_this(long jarg1, EnableSharedFromThisContainer jarg1_); public final static native long new_CaseInsensitiveEqualTo(); public final static native void delete_CaseInsensitiveEqualTo(long jarg1); @@ -1281,6 +1313,9 @@ public class AdaptiveCardObjectModelJNI { public final static native void TextRun_SetIsSubtle(long jarg1, TextRun jarg1_, boolean jarg2); public final static native void TextRun_SetLanguage(long jarg1, TextRun jarg1_, String jarg2); public final static native String TextRun_GetLanguage(long jarg1, TextRun jarg1_); + public final static native long TextRun_GetSelectAction(long jarg1, TextRun jarg1_); + public final static native void TextRun_SetSelectAction(long jarg1, TextRun jarg1_, long jarg2, BaseActionElement jarg2_); + public final static native long TextRun_dynamic_cast(long jarg1, Inline jarg1_); public final static native long BaseCardElement_SWIGSmartPtrUpcast(long jarg1); public final static native long BaseActionElement_SWIGSmartPtrUpcast(long jarg1); public final static native long BaseInputElement_SWIGSmartPtrUpcast(long jarg1); diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/InlineVector.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/InlineVector.java new file mode 100644 index 0000000000..762fa2740a --- /dev/null +++ b/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/InlineVector.java @@ -0,0 +1,148 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.0 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package io.adaptivecards.objectmodel; + +public class InlineVector extends java.util.AbstractList implements java.util.RandomAccess { + private transient long swigCPtr; + protected transient boolean swigCMemOwn; + + protected InlineVector(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + protected static long getCPtr(InlineVector obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + AdaptiveCardObjectModelJNI.delete_InlineVector(swigCPtr); + } + swigCPtr = 0; + } + } + + public InlineVector(Inline[] initialElements) { + this(); + for (Inline element : initialElements) { + add(element); + } + } + + public InlineVector(Iterable initialElements) { + this(); + for (Inline element : initialElements) { + add(element); + } + } + + public Inline get(int index) { + return doGet(index); + } + + public Inline set(int index, Inline e) { + return doSet(index, e); + } + + public boolean add(Inline e) { + modCount++; + doAdd(e); + return true; + } + + public void add(int index, Inline e) { + modCount++; + doAdd(index, e); + } + + public Inline remove(int index) { + modCount++; + return doRemove(index); + } + + protected void removeRange(int fromIndex, int toIndex) { + modCount++; + doRemoveRange(fromIndex, toIndex); + } + + public int size() { + return doSize(); + } + + public InlineVector() { + this(AdaptiveCardObjectModelJNI.new_InlineVector__SWIG_0(), true); + } + + public InlineVector(InlineVector other) { + this(AdaptiveCardObjectModelJNI.new_InlineVector__SWIG_1(InlineVector.getCPtr(other), other), true); + } + + public long capacity() { + return AdaptiveCardObjectModelJNI.InlineVector_capacity(swigCPtr, this); + } + + public void reserve(long n) { + AdaptiveCardObjectModelJNI.InlineVector_reserve(swigCPtr, this, n); + } + + public boolean isEmpty() { + return AdaptiveCardObjectModelJNI.InlineVector_isEmpty(swigCPtr, this); + } + + public void clear() { + AdaptiveCardObjectModelJNI.InlineVector_clear(swigCPtr, this); + } + + public InlineVector(int count) { + this(AdaptiveCardObjectModelJNI.new_InlineVector__SWIG_2(count), true); + } + + public InlineVector(int count, Inline value) { + this(AdaptiveCardObjectModelJNI.new_InlineVector__SWIG_3(count, Inline.getCPtr(value), value), true); + } + + private int doSize() { + return AdaptiveCardObjectModelJNI.InlineVector_doSize(swigCPtr, this); + } + + private void doAdd(Inline value) { + AdaptiveCardObjectModelJNI.InlineVector_doAdd__SWIG_0(swigCPtr, this, Inline.getCPtr(value), value); + } + + private void doAdd(int index, Inline value) { + AdaptiveCardObjectModelJNI.InlineVector_doAdd__SWIG_1(swigCPtr, this, index, Inline.getCPtr(value), value); + } + + private Inline doRemove(int index) { + long cPtr = AdaptiveCardObjectModelJNI.InlineVector_doRemove(swigCPtr, this, index); + return (cPtr == 0) ? null : new Inline(cPtr, true); + } + + private Inline doGet(int index) { + long cPtr = AdaptiveCardObjectModelJNI.InlineVector_doGet(swigCPtr, this, index); + return (cPtr == 0) ? null : new Inline(cPtr, true); + } + + private Inline doSet(int index, Inline value) { + long cPtr = AdaptiveCardObjectModelJNI.InlineVector_doSet(swigCPtr, this, index, Inline.getCPtr(value), value); + return (cPtr == 0) ? null : new Inline(cPtr, true); + } + + private void doRemoveRange(int fromIndex, int toIndex) { + AdaptiveCardObjectModelJNI.InlineVector_doRemoveRange(swigCPtr, this, fromIndex, toIndex); + } + +} diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/Paragraph.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/Paragraph.java index d8450edfd0..4196734222 100644 --- a/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/Paragraph.java +++ b/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/Paragraph.java @@ -51,8 +51,8 @@ public JsonValue SerializeToJsonValue() { return new JsonValue(AdaptiveCardObjectModelJNI.Paragraph_SerializeToJsonValue(swigCPtr, this), true); } - public SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Inline_t_t GetInlines() { - return new SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Inline_t_t(AdaptiveCardObjectModelJNI.Paragraph_GetInlines__SWIG_0(swigCPtr, this), false); + public InlineVector GetInlines() { + return new InlineVector(AdaptiveCardObjectModelJNI.Paragraph_GetInlines__SWIG_0(swigCPtr, this), false); } public static Paragraph Deserialize(ParseContext context, JsonValue root) { diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/ParagraphVector.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/ParagraphVector.java new file mode 100644 index 0000000000..380a9bbb40 --- /dev/null +++ b/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/ParagraphVector.java @@ -0,0 +1,148 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.0 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package io.adaptivecards.objectmodel; + +public class ParagraphVector extends java.util.AbstractList implements java.util.RandomAccess { + private transient long swigCPtr; + protected transient boolean swigCMemOwn; + + protected ParagraphVector(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + protected static long getCPtr(ParagraphVector obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + AdaptiveCardObjectModelJNI.delete_ParagraphVector(swigCPtr); + } + swigCPtr = 0; + } + } + + public ParagraphVector(Paragraph[] initialElements) { + this(); + for (Paragraph element : initialElements) { + add(element); + } + } + + public ParagraphVector(Iterable initialElements) { + this(); + for (Paragraph element : initialElements) { + add(element); + } + } + + public Paragraph get(int index) { + return doGet(index); + } + + public Paragraph set(int index, Paragraph e) { + return doSet(index, e); + } + + public boolean add(Paragraph e) { + modCount++; + doAdd(e); + return true; + } + + public void add(int index, Paragraph e) { + modCount++; + doAdd(index, e); + } + + public Paragraph remove(int index) { + modCount++; + return doRemove(index); + } + + protected void removeRange(int fromIndex, int toIndex) { + modCount++; + doRemoveRange(fromIndex, toIndex); + } + + public int size() { + return doSize(); + } + + public ParagraphVector() { + this(AdaptiveCardObjectModelJNI.new_ParagraphVector__SWIG_0(), true); + } + + public ParagraphVector(ParagraphVector other) { + this(AdaptiveCardObjectModelJNI.new_ParagraphVector__SWIG_1(ParagraphVector.getCPtr(other), other), true); + } + + public long capacity() { + return AdaptiveCardObjectModelJNI.ParagraphVector_capacity(swigCPtr, this); + } + + public void reserve(long n) { + AdaptiveCardObjectModelJNI.ParagraphVector_reserve(swigCPtr, this, n); + } + + public boolean isEmpty() { + return AdaptiveCardObjectModelJNI.ParagraphVector_isEmpty(swigCPtr, this); + } + + public void clear() { + AdaptiveCardObjectModelJNI.ParagraphVector_clear(swigCPtr, this); + } + + public ParagraphVector(int count) { + this(AdaptiveCardObjectModelJNI.new_ParagraphVector__SWIG_2(count), true); + } + + public ParagraphVector(int count, Paragraph value) { + this(AdaptiveCardObjectModelJNI.new_ParagraphVector__SWIG_3(count, Paragraph.getCPtr(value), value), true); + } + + private int doSize() { + return AdaptiveCardObjectModelJNI.ParagraphVector_doSize(swigCPtr, this); + } + + private void doAdd(Paragraph value) { + AdaptiveCardObjectModelJNI.ParagraphVector_doAdd__SWIG_0(swigCPtr, this, Paragraph.getCPtr(value), value); + } + + private void doAdd(int index, Paragraph value) { + AdaptiveCardObjectModelJNI.ParagraphVector_doAdd__SWIG_1(swigCPtr, this, index, Paragraph.getCPtr(value), value); + } + + private Paragraph doRemove(int index) { + long cPtr = AdaptiveCardObjectModelJNI.ParagraphVector_doRemove(swigCPtr, this, index); + return (cPtr == 0) ? null : new Paragraph(cPtr, true); + } + + private Paragraph doGet(int index) { + long cPtr = AdaptiveCardObjectModelJNI.ParagraphVector_doGet(swigCPtr, this, index); + return (cPtr == 0) ? null : new Paragraph(cPtr, true); + } + + private Paragraph doSet(int index, Paragraph value) { + long cPtr = AdaptiveCardObjectModelJNI.ParagraphVector_doSet(swigCPtr, this, index, Paragraph.getCPtr(value), value); + return (cPtr == 0) ? null : new Paragraph(cPtr, true); + } + + private void doRemoveRange(int fromIndex, int toIndex) { + AdaptiveCardObjectModelJNI.ParagraphVector_doRemoveRange(swigCPtr, this, fromIndex, toIndex); + } + +} diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/RichTextBlock.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/RichTextBlock.java index d05b573984..bfbd086e38 100644 --- a/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/RichTextBlock.java +++ b/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/RichTextBlock.java @@ -78,8 +78,8 @@ public void SetHorizontalAlignment(HorizontalAlignment value) { AdaptiveCardObjectModelJNI.RichTextBlock_SetHorizontalAlignment(swigCPtr, this, value.swigValue()); } - public SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Paragraph_t_t GetParagraphs() { - return new SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Paragraph_t_t(AdaptiveCardObjectModelJNI.RichTextBlock_GetParagraphs__SWIG_0(swigCPtr, this), false); + public ParagraphVector GetParagraphs() { + return new ParagraphVector(AdaptiveCardObjectModelJNI.RichTextBlock_GetParagraphs__SWIG_0(swigCPtr, this), false); } public static RichTextBlock dynamic_cast(BaseCardElement baseCardElement) { diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Inline_t_t.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Inline_t_t.java deleted file mode 100644 index c1c38cacd0..0000000000 --- a/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Inline_t_t.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.0 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package io.adaptivecards.objectmodel; - -public class SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Inline_t_t { - private transient long swigCPtr; - - protected SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Inline_t_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Inline_t_t() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Inline_t_t obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Paragraph_t_t.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Paragraph_t_t.java deleted file mode 100644 index 60afd7f1ed..0000000000 --- a/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Paragraph_t_t.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.0 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package io.adaptivecards.objectmodel; - -public class SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Paragraph_t_t { - private transient long swigCPtr; - - protected SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Paragraph_t_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Paragraph_t_t() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_std__vectorT_std__shared_ptrT_AdaptiveCards__Paragraph_t_t obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/TextRun.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/TextRun.java index d26628ee34..e6e38ce58c 100644 --- a/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/TextRun.java +++ b/source/android/adaptivecards/src/main/java/io/adaptivecards/objectmodel/TextRun.java @@ -119,4 +119,18 @@ public String GetLanguage() { return AdaptiveCardObjectModelJNI.TextRun_GetLanguage(swigCPtr, this); } + public BaseActionElement GetSelectAction() { + long cPtr = AdaptiveCardObjectModelJNI.TextRun_GetSelectAction(swigCPtr, this); + return (cPtr == 0) ? null : new BaseActionElement(cPtr, true); + } + + public void SetSelectAction(BaseActionElement action) { + AdaptiveCardObjectModelJNI.TextRun_SetSelectAction(swigCPtr, this, BaseActionElement.getCPtr(action), action); + } + + public static TextRun dynamic_cast(Inline inlineVar) { + long cPtr = AdaptiveCardObjectModelJNI.TextRun_dynamic_cast(Inline.getCPtr(inlineVar), inlineVar); + return (cPtr == 0) ? null : new TextRun(cPtr, true); + } + } diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/readonly/RichTextBlockRenderer.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/readonly/RichTextBlockRenderer.java new file mode 100644 index 0000000000..6a6c21627f --- /dev/null +++ b/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/readonly/RichTextBlockRenderer.java @@ -0,0 +1,233 @@ +package io.adaptivecards.renderer.readonly; + +import android.content.Context; +import android.drm.DrmStore; +import android.os.Build; +import android.support.annotation.NonNull; +import android.support.v4.app.FragmentManager; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.TextUtils; +import android.text.method.LinkMovementMethod; +import android.text.style.AbsoluteSizeSpan; +import android.text.style.ClickableSpan; +import android.text.style.ForegroundColorSpan; +import android.text.style.StyleSpan; +import android.text.style.TypefaceSpan; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.TextView; + +import io.adaptivecards.objectmodel.ActionElementParser; +import io.adaptivecards.objectmodel.BaseActionElement; +import io.adaptivecards.objectmodel.BaseCardElement; +import io.adaptivecards.objectmodel.ContainerStyle; +import io.adaptivecards.objectmodel.HeightType; +import io.adaptivecards.objectmodel.HostConfig; +import io.adaptivecards.objectmodel.Inline; +import io.adaptivecards.objectmodel.InlineElementType; +import io.adaptivecards.objectmodel.InlineVector; +import io.adaptivecards.objectmodel.Paragraph; +import io.adaptivecards.objectmodel.ParagraphVector; +import io.adaptivecards.objectmodel.RichTextBlock; +import io.adaptivecards.objectmodel.TextBlock; +import io.adaptivecards.objectmodel.TextRun; +import io.adaptivecards.renderer.BaseCardElementRenderer; +import io.adaptivecards.renderer.RenderedAdaptiveCard; +import io.adaptivecards.renderer.TagContent; +import io.adaptivecards.renderer.action.ActionElementRenderer; +import io.adaptivecards.renderer.actionhandler.ICardActionHandler; + +public class RichTextBlockRenderer extends BaseCardElementRenderer +{ + + public static RichTextBlockRenderer getInstance() + { + if (s_instance == null) + { + s_instance = new RichTextBlockRenderer(); + } + + return s_instance; + } + + private class ActionSpan extends ClickableSpan + { + public ActionSpan(BaseActionElement action, RenderedAdaptiveCard renderedCard, ICardActionHandler cardActionHandler) + { + m_actionListener = new ActionElementRenderer.ButtonOnClickListener(renderedCard, action, cardActionHandler); + } + + @Override + public void onClick(@NonNull View widget) + { + // Delegate the job to the listener + m_actionListener.onClick(widget); + } + + private ActionElementRenderer.ButtonOnClickListener m_actionListener; + } + + private SpannableStringBuilder buildSpannableParagraph( + RenderedAdaptiveCard renderedCard, + InlineVector inlines, + ICardActionHandler cardActionHandler, + HostConfig hostConfig, + ContainerStyle containerStyle) + { + SpannableStringBuilder paragraph = new SpannableStringBuilder(); + int lastStringLength = 0; + for(int i = 0; i < inlines.size(); ++i, lastStringLength = paragraph.length()) + { + Inline inline = inlines.get(i); + if(inline.GetInlineType() == InlineElementType.TextRun) + { + TextRun textRun = null; + if (inline instanceof TextRun) + { + textRun = (TextRun) inline; + } + else if ((textRun = TextRun.dynamic_cast(inline)) == null) + { + throw new InternalError("Unable to convert BaseCardElement to TextBlock object model."); + } + + DateTimeParser parser = new DateTimeParser(textRun.GetLanguage()); + String textWithFormattedDates = parser.GenerateString(textRun.GetTextForDateParsing()); + CharSequence text = RendererUtil.handleSpecialText(textWithFormattedDates); + + paragraph.append(text); + + int spanStart = lastStringLength; + int spanEnd = lastStringLength + text.length(); + + int color = getColor(TextRendererUtil.getTextColor(textRun.GetTextColor(), hostConfig, textRun.GetIsSubtle(), containerStyle)); + paragraph.setSpan(new ForegroundColorSpan(color), spanStart, spanEnd, Spannable.SPAN_INCLUSIVE_EXCLUSIVE); + paragraph.setSpan(new StyleSpan(TextRendererUtil.getTextWeight(textRun.GetTextWeight())), spanStart, spanEnd, Spannable.SPAN_INCLUSIVE_EXCLUSIVE); + + long textSize = TextRendererUtil.getTextSize(textRun.GetFontStyle(), textRun.GetTextSize(), hostConfig); + paragraph.setSpan(new AbsoluteSizeSpan((int)textSize, true), spanStart, spanEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); + + // On API 28, TypefaceSpan(Typeface) was added so we don't have to use the TypefaceSpan(String) constructor + String fontName = hostConfig.GetFontFamily(textRun.GetFontStyle()); + if(fontName.isEmpty()) + { + fontName = "monospace"; + } + + paragraph.setSpan(new TypefaceSpan(fontName), spanStart, spanEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); + + if(textRun.GetSelectAction() != null) + { + paragraph.setSpan(new ActionSpan(textRun.GetSelectAction(), renderedCard, cardActionHandler), spanStart, spanEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); + } + } + } + + return paragraph; + } + + @Override + public View render( + RenderedAdaptiveCard renderedCard, + Context context, + FragmentManager fragmentManager, + ViewGroup viewGroup, + BaseCardElement baseCardElement, + ICardActionHandler cardActionHandler, + HostConfig hostConfig, + ContainerStyle containerStyle) + { + RichTextBlock richTextBlock = null; + if (baseCardElement instanceof TextBlock) + { + richTextBlock = (RichTextBlock) baseCardElement; + } + else if ((richTextBlock = RichTextBlock.dynamic_cast(baseCardElement)) == null) + { + throw new InternalError("Unable to convert BaseCardElement to TextBlock object model."); + } + + TextView textView = new TextView(context); + textView.setTag(new TagContent(richTextBlock)); + textView.setEllipsize(TextUtils.TruncateAt.END); + textView.setHorizontallyScrolling(false); + + // BaseCardElement properties + // Separator + // Height + // IsVisible + // Spacing + setSpacingAndSeparator(context, viewGroup, richTextBlock.GetSpacing(), richTextBlock.GetSeparator(), hostConfig, true); + + if(!baseCardElement.GetIsVisible()) + { + textView.setVisibility(View.GONE); + } + + if( richTextBlock.GetHeight() == HeightType.Stretch ) + { + textView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT, 1)); + } + else + { + textView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); + } + + // RichTextBlock properties + // Wrap + // MaxLines + // HorizontalAlignment + // Paragraphs + if (!richTextBlock.GetWrap()) + { + textView.setMaxLines(1); + } + + int maxLines = (int)richTextBlock.GetMaxLines(); + if (maxLines > 0 && richTextBlock.GetWrap()) + { + textView.setMaxLines(maxLines); + } + else if (!richTextBlock.GetWrap()) + { + textView.setMaxLines(1); + } + + textView.setGravity(TextRendererUtil.getTextAlignment(richTextBlock.GetHorizontalAlignment())); + + // This is the section for rendering the paragraphs + // Every paragraph may contain contains any number of inlines + // The current inline element types are TextRun + ParagraphVector paragraphs = richTextBlock.GetParagraphs(); + int paragraphCount = paragraphs.size(); + + textView.setText(""); + + for (int i = 0; i < paragraphCount; ++i) + { + Paragraph p = paragraphs.get(i); + InlineVector inlines = p.GetInlines(); + + if ((i != 0) && (inlines.size() != 0)) + { + textView.append(System.getProperty("line.separator")); + } + + SpannableStringBuilder convertedString = buildSpannableParagraph(renderedCard, inlines, cardActionHandler, hostConfig, containerStyle); + + textView.append(convertedString); + } + + // Properties required for actions to fire onClick event + textView.setMovementMethod(LinkMovementMethod.getInstance()); + textView.setClickable(true); + + viewGroup.addView(textView); + return textView; + } + + private static RichTextBlockRenderer s_instance = null; +} diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/readonly/TextBlockRenderer.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/readonly/TextBlockRenderer.java index ea7d87afbf..5fec5ac2a2 100644 --- a/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/readonly/TextBlockRenderer.java +++ b/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/readonly/TextBlockRenderer.java @@ -16,6 +16,8 @@ import android.widget.LinearLayout; import android.widget.TextView; +import org.w3c.dom.Text; + import io.adaptivecards.objectmodel.ContainerStyle; import io.adaptivecards.objectmodel.FontStyle; import io.adaptivecards.objectmodel.ForegroundColor; @@ -53,55 +55,24 @@ public static TextBlockRenderer getInstance() return s_instance; } - static void setTextSize(TextView textView, FontStyle style, TextSize textSize, HostConfig hostConfig) + static void setTextAlignment(TextView textView, HorizontalAlignment textAlignment) { - long value = hostConfig.GetFontSize(style, textSize); - textView.setTextSize(value); + textView.setGravity(TextRendererUtil.getTextAlignment(textAlignment)); } - static void setTextAlignment(TextView textView, HorizontalAlignment textAlignment) + static void setTextSize(TextView textView, FontStyle style, TextSize textSize, HostConfig hostConfig) { - int alignment; - if (textAlignment == HorizontalAlignment.Center) - { - alignment = Gravity.CENTER; - } - else if (textAlignment == HorizontalAlignment.Left) - { - alignment = Gravity.LEFT; - } - else if (textAlignment == HorizontalAlignment.Right) - { - alignment = Gravity.RIGHT; - } - else - { - throw new IllegalArgumentException("Invalid text alignment: " + textAlignment.toString()); - } - - textView.setGravity(alignment); + textView.setTextSize(TextRendererUtil.getTextSize(style, textSize, hostConfig)); } void setTextFormat(TextView textView, HostConfig hostConfig, FontStyle style, TextWeight textWeight) { - String fontFamily = hostConfig.GetFontFamily(style); - - Typeface typeface; - if (fontFamily.isEmpty() && style == FontStyle.Monospace) - { - typeface = Typeface.MONOSPACE; - } - else - { - typeface = Typeface.create(fontFamily, Typeface.NORMAL); - } - - textView.setTypeface(typeface, m_textWeightMap.get(textWeight)); + textView.setTypeface(TextRendererUtil.getTextFormat(hostConfig, style), m_textWeightMap.get(textWeight)); } static void setTextColor(TextView textView, ForegroundColor foregroundColor, HostConfig hostConfig, boolean isSubtle, ContainerStyle containerStyle) { - textView.setTextColor(getColor(hostConfig.GetForegroundColor(containerStyle, foregroundColor, isSubtle))); + textView.setTextColor(getColor(TextRendererUtil.getTextColor(foregroundColor, hostConfig, isSubtle, containerStyle))); } static class TouchTextView implements View.OnTouchListener diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/readonly/TextRendererUtil.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/readonly/TextRendererUtil.java new file mode 100644 index 0000000000..976467db51 --- /dev/null +++ b/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/readonly/TextRendererUtil.java @@ -0,0 +1,91 @@ +package io.adaptivecards.renderer.readonly; + +import android.graphics.Typeface; +import android.view.Gravity; +import android.widget.TextView; + +import io.adaptivecards.objectmodel.ContainerStyle; +import io.adaptivecards.objectmodel.FontStyle; +import io.adaptivecards.objectmodel.ForegroundColor; +import io.adaptivecards.objectmodel.HorizontalAlignment; +import io.adaptivecards.objectmodel.HostConfig; +import io.adaptivecards.objectmodel.TextSize; +import io.adaptivecards.objectmodel.TextWeight; + +public class TextRendererUtil +{ + + static int getTextAlignment(HorizontalAlignment textAlignment) + { + int alignment; + if (textAlignment == HorizontalAlignment.Center) + { + alignment = Gravity.CENTER; + } + else if (textAlignment == HorizontalAlignment.Left) + { + alignment = Gravity.LEFT; + } + else if (textAlignment == HorizontalAlignment.Right) + { + alignment = Gravity.RIGHT; + } + else + { + throw new IllegalArgumentException("Invalid text alignment: " + textAlignment.toString()); + } + + return alignment; + } + + static long getTextSize(FontStyle style, TextSize textSize, HostConfig hostConfig) + { + return hostConfig.GetFontSize(style, textSize); + } + + static Typeface getTextFormat(HostConfig hostConfig, FontStyle style) + { + String fontFamily = hostConfig.GetFontFamily(style); + + Typeface typeface; + if (fontFamily.isEmpty() && style == FontStyle.Monospace) + { + typeface = Typeface.MONOSPACE; + } + else + { + typeface = Typeface.create(fontFamily, Typeface.NORMAL); + } + + return typeface; + } + + static String getTextColor(ForegroundColor foregroundColor, HostConfig hostConfig, boolean isSubtle, ContainerStyle containerStyle) + { + return hostConfig.GetForegroundColor(containerStyle, foregroundColor, isSubtle); + } + + static int getTextWeight(TextWeight textWeight) + { + int weight; + if (textWeight == TextWeight.Default) + { + weight = Typeface.NORMAL; + } + else if (textWeight == TextWeight.Bolder) + { + weight = Typeface.BOLD; + } + else if (textWeight == TextWeight.Lighter) + { + weight = Typeface.ITALIC; + } + else + { + throw new IllegalArgumentException("Invalid text weight: " + textWeight.toString()); + } + + return weight; + } + +} diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/registration/CardRendererRegistration.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/registration/CardRendererRegistration.java index f5a060740c..e1eb60468f 100644 --- a/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/registration/CardRendererRegistration.java +++ b/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/registration/CardRendererRegistration.java @@ -13,6 +13,7 @@ import io.adaptivecards.objectmodel.Column; import io.adaptivecards.objectmodel.Container; import io.adaptivecards.objectmodel.ContainerStyle; +import io.adaptivecards.objectmodel.RichTextBlock; import io.adaptivecards.objectmodel.VerticalContentAlignment; import io.adaptivecards.renderer.AdaptiveWarning; import io.adaptivecards.renderer.IResourceResolver; @@ -42,6 +43,7 @@ import io.adaptivecards.renderer.readonly.ImageRenderer; import io.adaptivecards.renderer.readonly.ImageSetRenderer; import io.adaptivecards.renderer.readonly.MediaRenderer; +import io.adaptivecards.renderer.readonly.RichTextBlockRenderer; import io.adaptivecards.renderer.readonly.TextBlockRenderer; import java.util.HashMap; @@ -58,6 +60,7 @@ private CardRendererRegistration() registerRenderer(AdaptiveCardObjectModel.CardElementTypeToString(CardElementType.Image), ImageRenderer.getInstance()); registerRenderer(AdaptiveCardObjectModel.CardElementTypeToString(CardElementType.ImageSet), ImageSetRenderer.getInstance()); registerRenderer(AdaptiveCardObjectModel.CardElementTypeToString(CardElementType.Media), MediaRenderer.getInstance()); + registerRenderer(AdaptiveCardObjectModel.CardElementTypeToString(CardElementType.RichTextBlock), RichTextBlockRenderer.getInstance()); registerRenderer(AdaptiveCardObjectModel.CardElementTypeToString(CardElementType.TextBlock), TextBlockRenderer.getInstance()); // Register Input Renderers diff --git a/source/shared/cpp/ObjectModel/Paragraph.cpp b/source/shared/cpp/ObjectModel/Paragraph.cpp index 00a3b487e4..8e9aad4fb7 100644 --- a/source/shared/cpp/ObjectModel/Paragraph.cpp +++ b/source/shared/cpp/ObjectModel/Paragraph.cpp @@ -33,7 +33,7 @@ std::shared_ptr AdaptiveSharedNamespace::Paragraph::Deserialize(Parse std::shared_ptr paragraph = std::make_shared(); auto inlines = - ParseUtil::GetElementCollectionOfSingleType(context, json, AdaptiveCardSchemaKey::Inlines, Inline::Deserialize, true); + ParseUtil::GetElementCollectionOfSingleType(context, json, AdaptiveCardSchemaKey::Inlines, Inline::Deserialize, false); paragraph->m_inlines = std::move(inlines); HandleUnknownProperties(json, paragraph->m_knownProperties, paragraph->m_additionalProperties);