@@ -30,7 +30,7 @@ inline std::string WStringToString(const std::wstring& s)
3030namespace ktvr
3131{
3232 // Interface Version
33- static const char * IK2API_Devices_Version = " IK2API_Version_012 " ;
33+ static const char * IK2API_Devices_Version = " IK2API_Version_013 " ;
3434
3535 // Return messaging types
3636 enum K2InitErrorType
@@ -637,7 +637,7 @@ namespace ktvr
637637 virtual void AppendSingleElement (
638638 const Element& element,
639639 const SingleLayoutHorizontalAlignment& alignment =
640- SingleLayoutHorizontalAlignment::Left)
640+ SingleLayoutHorizontalAlignment::Left)
641641 {
642642 }
643643
@@ -723,7 +723,10 @@ namespace ktvr
723723 // Both should be updated either on call or as frequent as possible
724724 virtual HRESULT getStatusResult () { return E_NOTIMPL; }
725725 // Device status wide string: to get system locale/language, use GetUserDefaultUILanguage
726- virtual std::wstring statusResultWString (HRESULT stat) { return L" Not Defined\n E_NOT_DEFINED\n statusResultWString behaviour not defined" ; }
726+ virtual std::wstring statusResultWString (HRESULT stat)
727+ {
728+ return L" Not Defined\n E_NOT_DEFINED\n statusResultWString behaviour not defined" ;
729+ }
727730
728731 // This should be updated on every frame,
729732 // along with joint devices
@@ -772,6 +775,12 @@ namespace ktvr
772775 // Request a refresh of the status/name/etc. interface
773776 std::function<void ()> requestStatusUIRefresh;
774777
778+ // Request a code of the currently selected language, i.e. en | fr | ja
779+ std::function<std::wstring()> requestLanguageCode;
780+
781+ // Request a string from AME resources, empty for no match
782+ std::function<std::wstring(std::wstring)> requestLocalizedString;
783+
775784 // To support settings daemon and register the layout root,
776785 // the device must properly report it first
777786 // -> will lead to showing an additional 'settings' button
@@ -789,31 +798,31 @@ namespace ktvr
789798 Interface::LayoutRoot* layoutRoot;
790799
791800 // Create a text block
792- std::function<Interface::TextBlock* (const std::wstring& text)> CreateTextBlock;
801+ std::function<Interface::TextBlock*(const std::wstring& text)> CreateTextBlock;
793802
794803 // Create a labeled button
795- std::function<Interface::Button* (const std::wstring& content)> CreateButton;
804+ std::function<Interface::Button*(const std::wstring& content)> CreateButton;
796805
797806 // Create a number box
798- std::function<Interface::NumberBox* (const int & value)> CreateNumberBox;
807+ std::function<Interface::NumberBox*(const int & value)> CreateNumberBox;
799808
800809 // Create a combo box
801- std::function<Interface::ComboBox* (const std::vector<std::wstring>& entries)> CreateComboBox;
810+ std::function<Interface::ComboBox*(const std::vector<std::wstring>& entries)> CreateComboBox;
802811
803812 // Create a check box
804- std::function<Interface::CheckBox* ()> CreateCheckBox;
813+ std::function<Interface::CheckBox*()> CreateCheckBox;
805814
806815 // Create a toggle switch
807- std::function<Interface::ToggleSwitch* ()> CreateToggleSwitch;
816+ std::function<Interface::ToggleSwitch*()> CreateToggleSwitch;
808817
809818 // Create a text box
810- std::function<Interface::TextBox* ()> CreateTextBox;
819+ std::function<Interface::TextBox*()> CreateTextBox;
811820
812821 // Create a progress ring
813- std::function<Interface::ProgressRing* ()> CreateProgressRing;
822+ std::function<Interface::ProgressRing*()> CreateProgressRing;
814823
815824 // Create a progress bar
816- std::function<Interface::ProgressBar* ()> CreateProgressBar;
825+ std::function<Interface::ProgressBar*()> CreateProgressBar;
817826
818827 protected:
819828 K2DeviceCharacteristics deviceCharacteristics = K2_Character_Unknown;
@@ -943,7 +952,10 @@ namespace ktvr
943952 // Both should be updated either on call or as frequent as possible
944953 virtual HRESULT getStatusResult () { return E_NOTIMPL; }
945954 // Device status wide string: to get system locale/language, use GetUserDefaultUILanguage
946- virtual std::wstring statusResultWString (HRESULT stat) { return L" Not Defined\n E_NOT_DEFINED\n statusResultWString behaviour not defined" ; }
955+ virtual std::wstring statusResultWString (HRESULT stat)
956+ {
957+ return L" Not Defined\n E_NOT_DEFINED\n statusResultWString behaviour not defined" ;
958+ }
947959
948960 // Signal the joint eg psm_id0 that it's being selected
949961 virtual void signalJoint (uint32_t at)
@@ -989,6 +1001,12 @@ namespace ktvr
9891001 // Request a refresh of the status/name/etc. interface
9901002 std::function<void ()> requestStatusUIRefresh;
9911003
1004+ // Request a code of the currently selected language, i.e. en | fr | ja
1005+ std::function<std::wstring()> requestLanguageCode;
1006+
1007+ // Request a string from AME resources, empty for no match
1008+ std::function<std::wstring(std::wstring)> requestLocalizedString;
1009+
9921010 // To support settings daemon and register the layout root,
9931011 // the device must properly report it first
9941012 // -> will lead to showing an additional 'settings' button
@@ -1006,31 +1024,31 @@ namespace ktvr
10061024 Interface::LayoutRoot* layoutRoot;
10071025
10081026 // Create a text block
1009- std::function<Interface::TextBlock* (const std::wstring& text)> CreateTextBlock;
1027+ std::function<Interface::TextBlock*(const std::wstring& text)> CreateTextBlock;
10101028
10111029 // Create a labeled button
1012- std::function<Interface::Button* (const std::wstring& content)> CreateButton;
1030+ std::function<Interface::Button*(const std::wstring& content)> CreateButton;
10131031
10141032 // Create a number box
1015- std::function<Interface::NumberBox* (const int & value)> CreateNumberBox;
1033+ std::function<Interface::NumberBox*(const int & value)> CreateNumberBox;
10161034
10171035 // Create a combo box
1018- std::function<Interface::ComboBox* (const std::vector<std::wstring>& entries)> CreateComboBox;
1036+ std::function<Interface::ComboBox*(const std::vector<std::wstring>& entries)> CreateComboBox;
10191037
10201038 // Create a check box
1021- std::function<Interface::CheckBox* ()> CreateCheckBox;
1039+ std::function<Interface::CheckBox*()> CreateCheckBox;
10221040
10231041 // Create a toggle switch
1024- std::function<Interface::ToggleSwitch* ()> CreateToggleSwitch;
1042+ std::function<Interface::ToggleSwitch*()> CreateToggleSwitch;
10251043
10261044 // Create a text box
1027- std::function<Interface::TextBox* ()> CreateTextBox;
1045+ std::function<Interface::TextBox*()> CreateTextBox;
10281046
10291047 // Create a progress ring
1030- std::function<Interface::ProgressRing* ()> CreateProgressRing;
1048+ std::function<Interface::ProgressRing*()> CreateProgressRing;
10311049
10321050 // Create a progress bar
1033- std::function<Interface::ProgressBar* ()> CreateProgressBar;
1051+ std::function<Interface::ProgressBar*()> CreateProgressBar;
10341052
10351053 protected:
10361054 K2DeviceType deviceType = K2_Unknown;
@@ -1096,5 +1114,11 @@ namespace ktvr
10961114 * Note: Waist,LFoot,RFoot,LElbow,RElbow,LKnee,RKnee
10971115 */
10981116 std::function<std::array<K2TrackedJoint, 7 >()> getAppJointPoses;
1117+
1118+ // Request a code of the currently selected language, i.e. en | fr | ja
1119+ std::function<std::wstring()> requestLanguageCode;
1120+
1121+ // Request a string from AME resources, empty for no match
1122+ std::function<std::wstring(const std::wstring&)> requestLocalizedString;
10991123 };
11001124}
0 commit comments