PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/viewer_components/updater/llupdatechecker.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 82 lines | 28 code | 18 blank | 36 comment | 0 complexity | 854a37e88903507e305eaef38aee77a2 MD5 | raw file
 1/** 
 2 * @file llupdatechecker.h
 3 *
 4 * $LicenseInfo:firstyear=2010&license=viewerlgpl$
 5 * Second Life Viewer Source Code
 6 * Copyright (C) 2010, Linden Research, Inc.
 7 * 
 8 * This library is free software; you can redistribute it and/or
 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation;
11 * version 2.1 of the License only.
12 * 
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 * Lesser General Public License for more details.
17 * 
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21 * 
22 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
23 * $/LicenseInfo$
24 */
25
26#ifndef LL_UPDATERCHECKER_H
27#define LL_UPDATERCHECKER_H
28
29
30#include <boost/shared_ptr.hpp>
31
32
33//
34// Implements asynchronous checking for updates.
35//
36class LLUpdateChecker {
37public:
38	class Client;
39	class Implementation;
40	
41	// An exception that may be raised on check errors.
42	class CheckError;
43	
44	LLUpdateChecker(Client & client);
45	
46	// Check status of current app on the given host for the channel and version provided.
47	void check(std::string const & protocolVersion, std::string const & hostUrl, 
48			   std::string const & servicePath, std::string channel, std::string version);
49	
50private:
51	boost::shared_ptr<Implementation> mImplementation;
52};
53
54
55class LLURI; // From lluri.h
56
57
58//
59// The client interface implemented by a requestor checking for an update.
60//
61class LLUpdateChecker::Client
62{
63public:
64	// An error occurred while checking for an update.
65	virtual void error(std::string const & message) = 0;
66	
67	// A newer version is available, but the current version may still be used.
68	virtual void optionalUpdate(std::string const & newVersion,
69								LLURI const & uri,
70								std::string const & hash) = 0;
71	
72	// A newer version is available, and the current version is no longer valid. 
73	virtual void requiredUpdate(std::string const & newVersion,
74								LLURI const & uri,
75								std::string const & hash) = 0;
76	
77	// The checked version is up to date; no newer version exists.
78	virtual void upToDate(void) = 0;
79};
80
81
82#endif