PageRenderTime 51ms CodeModel.GetById 2ms app.highlight 44ms RepoModel.GetById 1ms app.codeStats 1ms

/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
 28#include "llstring.h"
 29#include "llfile.h"
 30#include "llavatarnamecache.h"
 31#include "llcachename.h"
 32#include "lluuid.h"
 33#include "message.h"
 34
 35#include <string>
 36
 37// Stub for LLAvatarNameCache
 38bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
 39{
 40	return false;
 41}
 42
 43void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot)
 44{
 45	return;
 46}
 47
 48bool LLAvatarNameCache::useDisplayNames()
 49{
 50	return false;
 51}
 52
 53//
 54// Stub implementation for LLCacheName
 55//
 56BOOL LLCacheName::getFullName(const LLUUID& id, std::string& fullname)
 57{
 58	fullname = "Lynx Linden";
 59	return TRUE;
 60}
 61
 62BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group)
 63{
 64	group = "My Group";
 65	return TRUE;
 66}
 67
 68boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback)
 69{
 70	return boost::signals2::connection();
 71}
 72
 73boost::signals2::connection LLCacheName::getGroup(const LLUUID& id, const LLCacheNameCallback& callback)
 74{
 75	return boost::signals2::connection();
 76}
 77
 78LLCacheName* gCacheName = NULL;
 79
 80//
 81// Stub implementation for LLTrans
 82//
 83class LLTrans
 84{
 85public:
 86	static std::string getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args);
 87};
 88
 89std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args)
 90{
 91	return std::string();
 92}
 93
 94//
 95// Stub implementation for LLStyle::Params::Params
 96//
 97
 98LLStyle::Params::Params()
 99{
100}
101
102//
103// Stub implementations for various LLInitParam classes
104//
105
106namespace LLInitParam
107{
108	Param::Param(BaseBlock* enclosing_block)
109	:	mIsProvided(false)
110	{
111		const U8* my_addr = reinterpret_cast<const U8*>(this);
112		const U8* block_addr = reinterpret_cast<const U8*>(enclosing_block);
113		mEnclosingBlockOffset = (U16)(my_addr - block_addr);
114	}
115
116	void BaseBlock::addParam(BlockDescriptor& block_data, const ParamDescriptorPtr in_param, const char* char_name){}
117	void BaseBlock::addSynonym(Param& param, const std::string& synonym) {}
118	param_handle_t BaseBlock::getHandleFromParam(const Param* param) const {return 0;}
119	
120	void BaseBlock::init(BlockDescriptor& descriptor, BlockDescriptor& base_descriptor, size_t block_size)
121	{
122		descriptor.mCurrentBlockPtr = this;
123	}
124	bool BaseBlock::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack, bool new_name){ return true; }
125	void BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const LLInitParam::BaseBlock* diff_block) const {}
126	bool BaseBlock::inspectBlock(Parser& parser, Parser::name_stack_t name_stack, S32 min_value, S32 max_value) const { return true; }
127	bool BaseBlock::mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { return true; }
128	bool BaseBlock::validateBlock(bool emit_errors) const { return true; }
129
130	ParamValue<LLUIColor, TypeValues<LLUIColor> >::ParamValue(const LLUIColor& color)
131	:	super_t(color)
132	{}
133
134	void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateValueFromBlock() 
135	{}
136	
137	void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateBlockFromValue(bool)
138	{}
139
140	bool ParamCompare<const LLFontGL*, false>::equals(const LLFontGL* a, const LLFontGL* b)
141	{
142		return false;
143	}
144
145	ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::ParamValue(const LLFontGL* fontp)
146	:	super_t(fontp)
147	{}
148
149	void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateValueFromBlock()
150	{}
151	
152	void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateBlockFromValue(bool)
153	{}
154
155	void TypeValues<LLFontGL::HAlign>::declareValues()
156	{}
157
158	void TypeValues<LLFontGL::VAlign>::declareValues()
159	{}
160
161	void TypeValues<LLFontGL::ShadowType>::declareValues()
162	{}
163
164	void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateValueFromBlock()
165	{}
166	
167	void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateBlockFromValue(bool)
168	{}
169
170	
171	bool ParamCompare<LLUIImage*, false>::equals(
172		LLUIImage* const &a,
173		LLUIImage* const &b)
174	{
175		return false;
176	}
177
178	bool ParamCompare<LLUIColor, false>::equals(const LLUIColor &a, const LLUIColor &b)
179	{
180		return false;
181	}
182
183}
184
185//static
186LLFontGL* LLFontGL::getFontDefault()
187{
188	return NULL; 
189}
190
191char const* const _PREHASH_AgentData = (char *)"AgentData";
192char const* const _PREHASH_AgentID = (char *)"AgentID";
193
194LLHost LLHost::invalid(INVALID_PORT,INVALID_HOST_IP_ADDRESS);
195
196LLMessageSystem* gMessageSystem = NULL;
197
198//
199// Stub implementation for LLMessageSystem
200//
201void LLMessageSystem::newMessage(const char *name) { }
202void LLMessageSystem::nextBlockFast(const char *blockname) { }
203void LLMessageSystem::nextBlock(const char *blockname) { }
204void LLMessageSystem::addUUIDFast( const char *varname, const LLUUID& uuid) { }
205void LLMessageSystem::addUUID( const char *varname, const LLUUID& uuid) { }
206S32 LLMessageSystem::sendReliable(const LLHost &host) { return 0; }