#pragma once #include "iconstreams.h" #include "trayparser.h" #include #include #include #include #include #include class TrayJuggler { public: TrayJuggler(const TrayParser &parser); // Find record based on substring present in record's application path. std::shared_ptr findRecord(const std::wstring &path) const; enum class TraySearchGroup { Visible, Hidden }; uint32_t getNextFreeOrdinal(TraySearchGroup searchGroup) const; // // Fix up and inject record. // The icon will be displayed in the rightmost position. // void injectRecord(const ICON_STREAMS_RECORD &record); // // Update and promote existing record. // The icon will be displayed in the rightmost position. // void promoteRecord(std::shared_ptr record); bool enumerateRecords(std::function record)> callback) const; // Generate a valid stream including header. std::vector pack() const; static std::wstring DecodeString(const uint16_t *encoded, size_t bufferSize); private: // // This is the original header. // We keep it around to be able to preserve the values for // the unknown fields. // ICON_STREAMS_HEADER m_header; std::list > m_records; };