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_INSTALL_HXX
19 #define SG_PACKAGE_INSTALL_HXX
23 #include <simgear/misc/sg_path.hxx>
24 #include <simgear/package/Delegate.hxx>
26 #include <simgear/structure/SGReferenced.hxx>
27 #include <simgear/structure/SGSharedPtr.hxx>
40 typedef SGSharedPtr<Package> PackageRef;
41 typedef SGSharedPtr<Catalog> CatalogRef;
42 typedef SGSharedPtr<Install> InstallRef;
47 class Install : public SGReferenced
51 * create from a directory on disk, or fail.
53 static InstallRef createFromPath(const SGPath& aPath, CatalogRef aCat);
55 unsigned int revsion() const
56 { return m_revision; }
58 PackageRef package() const
64 bool hasUpdate() const;
70 // boost signals time?
78 class PackageArchiveDownloader;
79 friend class PackageArchiveDownloader;
81 Install(PackageRef aPkg, const SGPath& aPath);
84 void writeRevisionFile();
86 void installResult(Delegate::FailureCode aReason);
87 void installProgress(unsigned int aBytes, unsigned int aTotal);
90 unsigned int m_revision; ///< revision on disk
91 SGPath m_path; ///< installation point on disk
93 PackageArchiveDownloader* m_download;
99 } // of namespace simgear
101 #endif // of SG_PACKAGE_CATALOG_HXX