/indra/llui/tests/llurlentry_stub.cpp

https://bitbucket.org/lindenlab/viewer-beta/ · C++ · 206 lines · 124 code · 39 blank · 43 comment · 0 complexity · 3a0ea5c4a04b46b1d7b0fc01cad97b29 MD5 · raw file

  1. /**
  2. * @file llurlentry_stub.cpp
  3. * @author Martin Reddy
  4. * @brief Stub implementations for LLUrlEntry unit test dependencies
  5. *
  6. * $LicenseInfo:firstyear=2009&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2010, Linden Research, Inc.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation;
  13. * version 2.1 of the License only.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  25. * $/LicenseInfo$
  26. */
  27. #include "llstring.h"
  28. #include "llfile.h"
  29. #include "llavatarnamecache.h"
  30. #include "llcachename.h"
  31. #include "lluuid.h"
  32. #include "message.h"
  33. #include <string>
  34. // Stub for LLAvatarNameCache
  35. bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
  36. {
  37. return false;
  38. }
  39. void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot)
  40. {
  41. return;
  42. }
  43. bool LLAvatarNameCache::useDisplayNames()
  44. {
  45. return false;
  46. }
  47. //
  48. // Stub implementation for LLCacheName
  49. //
  50. BOOL LLCacheName::getFullName(const LLUUID& id, std::string& fullname)
  51. {
  52. fullname = "Lynx Linden";
  53. return TRUE;
  54. }
  55. BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group)
  56. {
  57. group = "My Group";
  58. return TRUE;
  59. }
  60. boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback)
  61. {
  62. return boost::signals2::connection();
  63. }
  64. boost::signals2::connection LLCacheName::getGroup(const LLUUID& id, const LLCacheNameCallback& callback)
  65. {
  66. return boost::signals2::connection();
  67. }
  68. LLCacheName* gCacheName = NULL;
  69. //
  70. // Stub implementation for LLTrans
  71. //
  72. class LLTrans
  73. {
  74. public:
  75. static std::string getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args);
  76. };
  77. std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args)
  78. {
  79. return std::string();
  80. }
  81. //
  82. // Stub implementation for LLStyle::Params::Params
  83. //
  84. LLStyle::Params::Params()
  85. {
  86. }
  87. //
  88. // Stub implementations for various LLInitParam classes
  89. //
  90. namespace LLInitParam
  91. {
  92. Param::Param(BaseBlock* enclosing_block)
  93. : mIsProvided(false)
  94. {
  95. const U8* my_addr = reinterpret_cast<const U8*>(this);
  96. const U8* block_addr = reinterpret_cast<const U8*>(enclosing_block);
  97. mEnclosingBlockOffset = (U16)(my_addr - block_addr);
  98. }
  99. void BaseBlock::addParam(BlockDescriptor& block_data, const ParamDescriptorPtr in_param, const char* char_name){}
  100. void BaseBlock::addSynonym(Param& param, const std::string& synonym) {}
  101. param_handle_t BaseBlock::getHandleFromParam(const Param* param) const {return 0;}
  102. void BaseBlock::init(BlockDescriptor& descriptor, BlockDescriptor& base_descriptor, size_t block_size)
  103. {
  104. descriptor.mCurrentBlockPtr = this;
  105. }
  106. bool BaseBlock::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack, bool new_name){ return true; }
  107. void BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const LLInitParam::BaseBlock* diff_block) const {}
  108. bool BaseBlock::inspectBlock(Parser& parser, Parser::name_stack_t name_stack, S32 min_value, S32 max_value) const { return true; }
  109. bool BaseBlock::mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { return true; }
  110. bool BaseBlock::validateBlock(bool emit_errors) const { return true; }
  111. ParamValue<LLUIColor, TypeValues<LLUIColor> >::ParamValue(const LLUIColor& color)
  112. : super_t(color)
  113. {}
  114. void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateValueFromBlock()
  115. {}
  116. void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateBlockFromValue(bool)
  117. {}
  118. bool ParamCompare<const LLFontGL*, false>::equals(const LLFontGL* a, const LLFontGL* b)
  119. {
  120. return false;
  121. }
  122. ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::ParamValue(const LLFontGL* fontp)
  123. : super_t(fontp)
  124. {}
  125. void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateValueFromBlock()
  126. {}
  127. void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateBlockFromValue(bool)
  128. {}
  129. void TypeValues<LLFontGL::HAlign>::declareValues()
  130. {}
  131. void TypeValues<LLFontGL::VAlign>::declareValues()
  132. {}
  133. void TypeValues<LLFontGL::ShadowType>::declareValues()
  134. {}
  135. void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateValueFromBlock()
  136. {}
  137. void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateBlockFromValue(bool)
  138. {}
  139. bool ParamCompare<LLUIImage*, false>::equals(
  140. LLUIImage* const &a,
  141. LLUIImage* const &b)
  142. {
  143. return false;
  144. }
  145. bool ParamCompare<LLUIColor, false>::equals(const LLUIColor &a, const LLUIColor &b)
  146. {
  147. return false;
  148. }
  149. }
  150. //static
  151. LLFontGL* LLFontGL::getFontDefault()
  152. {
  153. return NULL;
  154. }
  155. char const* const _PREHASH_AgentData = (char *)"AgentData";
  156. char const* const _PREHASH_AgentID = (char *)"AgentID";
  157. LLHost LLHost::invalid(INVALID_PORT,INVALID_HOST_IP_ADDRESS);
  158. LLMessageSystem* gMessageSystem = NULL;
  159. //
  160. // Stub implementation for LLMessageSystem
  161. //
  162. void LLMessageSystem::newMessage(const char *name) { }
  163. void LLMessageSystem::nextBlockFast(const char *blockname) { }
  164. void LLMessageSystem::nextBlock(const char *blockname) { }
  165. void LLMessageSystem::addUUIDFast( const char *varname, const LLUUID& uuid) { }
  166. void LLMessageSystem::addUUID( const char *varname, const LLUUID& uuid) { }
  167. S32 LLMessageSystem::sendReliable(const LLHost &host) { return 0; }