/* * Copyright 2013-2014, Stephan Aßmus . * Copyright 2020-2023, Andrew Lindesay * All rights reserved. Distributed under the terms of the MIT License. */ #ifndef PACKAGE_INFO_VIEW_H #define PACKAGE_INFO_VIEW_H #include #include "Model.h" #include "PackageInfo.h" #include "PackageInfoListener.h" #include "ProcessCoordinator.h" class BCardLayout; class BLocker; class OnePackageMessagePackageListener; class PackageActionView; class PagesView; class TitleView; enum { MSG_RATE_PACKAGE = 'rate', MSG_SHOW_SCREENSHOT = 'shws', }; class PackageInfoView : public BView { public: PackageInfoView(Model* model, ProcessCoordinatorConsumer* processCoordinatorConsumer); virtual ~PackageInfoView(); virtual void AttachedToWindow(); virtual void MessageReceived(BMessage* message); void SetPackage(const PackageInfoRef& package); const PackageInfoRef& Package() const { return fPackage; } void Clear(); void HandleScreenshotCached(const ScreenshotCoordinate& coordinate); private: static const ScreenshotCoordinate _ScreenshotThumbCoordinate(const PackageInfoRef& package); void _SetPackageScreenshotThumb(const PackageInfoRef& package); void _HandleScreenshotCached(const PackageInfoRef& package, const ScreenshotCoordinate& coordinate); private: Model* fModel; BCardLayout* fCardLayout; TitleView* fTitleView; PackageActionView* fPackageActionView; PagesView* fPagesView; PackageInfoRef fPackage; OnePackageMessagePackageListener* fPackageListener; ProcessCoordinatorConsumer* fProcessCoordinatorConsumer; }; #endif // PACKAGE_INFO_VIEW_H