1 // Copyright (C) 2013 James Turner - zakalawe@mac.com
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Library General Public
5 // License as published by the Free Software Foundation; either
6 // version 2 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Library General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 #ifndef SG_PACKAGE_DELEGATE_HXX
19 #define SG_PACKAGE_DELEGATE_HXX
31 * package delegate is the mechanism to discover progress / completion /
32 * errors in packaging steps asynchronously.
38 FAIL_SUCCESS = 0, ///< not a failure :)
40 FAIL_CHECKSUM, ///< package MD5 verificstion failed
41 FAIL_DOWNLOAD, ///< network issue
42 FAIL_EXTRACT, ///< package archive failed to extract cleanly
43 FAIL_FILESYSTEM, ///< unknown filesystem error occurred
44 FAIL_VERSION ///< version check mismatch
48 virtual ~Delegate() { }
51 * invoked when all catalogs have finished refreshing - either successfully
54 virtual void refreshComplete() = 0;
57 * emitted when a catalog fails to refresh, due to a network issue or
60 virtual void failedRefresh(Catalog*, FailureCode aReason) = 0;
62 virtual void startInstall(Install* aInstall) = 0;
63 virtual void installProgress(Install* aInstall, unsigned int aBytes, unsigned int aTotal) = 0;
64 virtual void finishInstall(Install* aInstall) = 0;
67 virtual void failedInstall(Install* aInstall, FailureCode aReason) = 0;
73 } // of namespace simgear
75 #endif // of SG_PACKAGE_DELEGATE_HXX